diff --git a/res/layout/contact_tile_small.xml b/res/layout/contact_tile_single.xml
similarity index 76%
rename from res/layout/contact_tile_small.xml
rename to res/layout/contact_tile_single.xml
index 9eda2cf..e1bdccc 100644
--- a/res/layout/contact_tile_small.xml
+++ b/res/layout/contact_tile_single.xml
@@ -17,28 +17,28 @@
     xmlns:android="http://schemas.android.com/apk/res/android"
     class="com.android.contacts.list.ContactTileView"
     android:focusable="true"
-    android:padding="5dip"
-    android:background="@drawable/list_selector" >
+    android:background="@drawable/list_selector"
+    android:paddingRight="16dip"
+    android:paddingLeft="16dip" >
 
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="match_parent" >
 
-        <ImageView
-            android:layout_width="0dip"
-            android:layout_height="wrap_content"
-            android:layout_weight="1"
-            android:id="@+id/contact_tile_image"
-            android:gravity="top"
-            android:scaleType="centerCrop" />
-
         <TextView
-            android:layout_width="0dip"
-            android:layout_height="wrap_content"
-            android:layout_weight="1"
             android:id="@+id/contact_tile_name"
-            android:paddingTop="8dip"
-            android:paddingLeft="4dip" />
+            android:layout_width="0dip"
+            android:layout_height="fill_parent"
+            android:layout_weight="1"
+            android:textSize="18sp"
+            android:textColor="#333333"
+            android:paddingTop="24dip" />
+
+        <ImageView
+            android:id="@+id/contact_tile_image"
+            android:layout_width="64dip"
+            android:layout_height="64dip"
+            android:scaleType="centerCrop" />
 
     </LinearLayout>
 
diff --git a/src/com/android/contacts/list/ContactTileAdapter.java b/src/com/android/contacts/list/ContactTileAdapter.java
index f3d7dae..feb308c 100644
--- a/src/com/android/contacts/list/ContactTileAdapter.java
+++ b/src/com/android/contacts/list/ContactTileAdapter.java
@@ -86,7 +86,7 @@
 
         /**
          * Display only most frequently contacted in a
-         * small {@link ContactTileView} layout.
+         * single {@link ContactTileView} layout.
          */
         FREQUENT_ONLY,
 
@@ -192,10 +192,21 @@
 
     @Override
     public int getCount() {
-        int numRows = getNumRows(mContacts2.size()) + getNumRows(mContacts.size());
+        // Addin Containter (if any) that always has multi columns
+        int rowCount = getNumRows(mContacts2.size());
+
+        if (mDisplayType == DisplayType.FREQUENT_ONLY || mDisplayType == DisplayType.STREQUENT) {
+            // Adding Container that has single columns
+            rowCount += mContacts.size();
+        } else {
+            // Adding Containter that has multi columns
+            rowCount += getNumRows(mContacts.size());
+        }
+
         // Adding Divider Row if Neccessary
-        if (mDisplayType == DisplayType.STREQUENT && mContacts.size() > 0) numRows++;
-        return numRows;
+        if (mDisplayType == DisplayType.STREQUENT && mContacts.size() > 0) rowCount++;
+
+        return rowCount;
     }
 
     /**
@@ -223,6 +234,9 @@
         } else {
             if (mDisplayType == DisplayType.STREQUENT) {
                 contactIndex = (position - mDividerRowIndex - 1) * mColumnCount;
+
+                resultList.add(mContacts.get(position - mDividerRowIndex - 1));
+                return resultList;
             }
             contactList = mContacts;
         }
@@ -259,24 +273,37 @@
 
     @Override
     public View getView(int position, View convertView, ViewGroup parent) {
+        int itemViewType = getItemViewType(position);
 
-        // Checking position to draw the divider
-        if (position == mDividerRowIndex) {
+        if (itemViewType == ViewTypes.DIVIDER) {
+            // Checking For Divider First so not to cast convertView
             return convertView == null ? createDivider() : convertView;
         }
 
         ContactTileRow contactTileRowView = (ContactTileRow) convertView;
         ArrayList<ContactEntry> contactList = getItem(position);
+        int layoutResId = getLayoutResourceId(itemViewType);
+        int columnCount = -1;
 
-        // Creating new row if needed
-        if (contactTileRowView == null) {
-            int itemViewType = getItemViewType(position);
-            int layoutResId = getLayoutResourceId(itemViewType);
-            contactTileRowView = new ContactTileRow(mContext, layoutResId,
-                    itemViewType == ViewTypes.REGULAR);
+        switch (itemViewType) {
+            case ViewTypes.REGULAR:
+                if (contactTileRowView == null) {
+                    // Creating new row if needed
+                    contactTileRowView = new ContactTileRow(mContext, layoutResId, true);
+                }
+                columnCount = mColumnCount;
+                break;
+
+            case ViewTypes.SINGLE_ROW:
+                if (contactTileRowView == null) {
+                    // Creating new row if needed
+                    contactTileRowView = new ContactTileRow(mContext, layoutResId, false);
+                }
+                columnCount = 1;
+                break;
         }
 
-        contactTileRowView.configureRow(contactList);
+        contactTileRowView.configureRow(contactList, columnCount);
         return contactTileRowView;
     }
 
@@ -294,10 +321,10 @@
 
     private int getLayoutResourceId(int viewType) {
         switch (viewType) {
-            case ViewTypes.SMALL:
-                return R.layout.contact_tile_small;
             case ViewTypes.REGULAR:
                 return R.layout.contact_tile_regular;
+            case ViewTypes.SINGLE_ROW:
+                return R.layout.contact_tile_single;
             default:
                 throw new IllegalArgumentException("Received unrecognized viewType " + viewType);
         }
@@ -324,13 +351,13 @@
                 } else if (position == mDividerRowIndex) {
                     return ViewTypes.DIVIDER;
                 } else {
-                    return ViewTypes.SMALL;
+                    return ViewTypes.SINGLE_ROW;
                 }
             case STARRED_ONLY:
             case GROUP_MEMBERS:
                 return ViewTypes.REGULAR;
             case FREQUENT_ONLY:
-                return ViewTypes.SMALL;
+                return ViewTypes.SINGLE_ROW;
             default:
                 throw new IllegalStateException(
                         "Received unrecognized DisplayType " + mDisplayType);
@@ -353,9 +380,9 @@
         /**
          * Configures the row to add {@link ContactEntry}s information to the views
          */
-        public void configureRow(ArrayList<ContactEntry> list) {
+        public void configureRow(ArrayList<ContactEntry> list, int columnCount) {
             // Adding tiles to row and filling in contact information
-            for (int columnCounter = 0; columnCounter < mColumnCount; columnCounter++) {
+            for (int columnCounter = 0; columnCounter < columnCount; columnCounter++) {
                 ContactEntry entry =
                         columnCounter < list.size() ? list.get(columnCounter) : null;
                 addTileFromEntry(entry, columnCounter);
@@ -397,9 +424,9 @@
 
     private static class ViewTypes {
         public static final int COUNT = 3;
-        public static final int SMALL = 0;
-        public static final int REGULAR = 1;
-        public static final int DIVIDER = 2;
+        public static final int REGULAR = 0;
+        public static final int DIVIDER = 1;
+        public static final int SINGLE_ROW = 2;
     }
 
     public interface Listener {
diff --git a/src/com/android/contacts/list/ContactTileView.java b/src/com/android/contacts/list/ContactTileView.java
index 4cce82e..da1351f 100644
--- a/src/com/android/contacts/list/ContactTileView.java
+++ b/src/com/android/contacts/list/ContactTileView.java
@@ -34,11 +34,16 @@
 public class ContactTileView extends FrameLayout {
     private final static String TAG = "ContactTileView";
 
+    /**
+     * This divides into the width to define the height when
+     * {link DisplayTypes@SINLGE_ROW} is true.
+     */
+    private final static int HEIGHT_RATIO = 5;
     private Uri mLookupUri;
     private ImageView mPhoto;
     private TextView mName;
     private ContactPhotoManager mPhotoManager = null;
-    /*
+    /**
      * Is set to true if the {@link ContactTileView} is a square.
      * A {@link ViewType#REGULAR} is displayed as a square.
      */
@@ -95,6 +100,6 @@
         int width = getDefaultSize(getSuggestedMinimumWidth(), widthMeasureSpec);
         int childMeasureSpec = MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY);
         measureChildren(childMeasureSpec, childMeasureSpec);
-        setMeasuredDimension(width, width / (mIsSquare ? 1 : 2));
+        setMeasuredDimension(width, width / (mIsSquare ? 1 : HEIGHT_RATIO));
     }
 }
