diff --git a/res/raw/rollo.c b/res/raw/rollo.c
index 8d09127..5862373 100644
--- a/res/raw/rollo.c
+++ b/res/raw/rollo.c
@@ -1,7 +1,7 @@
 #pragma version(1)
 #pragma stateVertex(PV)
-#pragma stateFragment(PF)
-#pragma stateFragmentStore(PFS)
+#pragma stateFragment(PFTexLinear)
+#pragma stateStore(PSIcons)
 
 #define PI 3.14159f
 
@@ -89,7 +89,6 @@
     if (g_PosPage > (g_PageCount - 1)) {
         g_PosVelocity = minf(0, g_PosVelocity);
     }
-    //g_Zoom += (maxf(fabsf(g_PosVelocity), 3) - 3) / 2.f;
 }
 
 void touchUp() {
@@ -128,18 +127,10 @@
         return;
     }
 
-    //debugF("g_PosPage", g_PosPage);
-    //debugF("  g_PosVelocity", g_PosVelocity);
-
     float tablePosNorm = fracf(g_PosPage + 0.5f);
     float tablePosF = tablePosNorm * g_PhysicsTableSize;
     int tablePosI = tablePosF;
     float tablePosFrac = tablePosF - tablePosI;
-    //debugF("tablePosNorm", tablePosNorm);
-    //debugF("tablePosF", tablePosF);
-    //debugF("tablePosI", tablePosI);
-    //debugF("tablePosFrac", tablePosFrac);
-
     float accel = lerpf(g_AttractionTable[tablePosI],
                         g_AttractionTable[tablePosI + 1],
                         tablePosFrac) * g_DT;
@@ -257,14 +248,14 @@
 
             color(1.0f, 1.0f, 1.0f, 0.99f);
             if (state->selectedIconIndex == icon) {
-                bindTexture(NAMED_PF, 0, state->selectedIconTexture);
+                bindTexture(NAMED_PFTexLinear, 0, state->selectedIconTexture);
                 drawQuadTexCoords(
                         iconLeftX, iconTextureTop, iconLeftZ,       0.0f, 0.0f,
                         iconRightX, iconTextureTop, iconRightZ,     1.0f, 0.0f,
                         iconRightX, iconTextureBottom, iconRightZ,  1.0f, 1.0f,
                         iconLeftX, iconTextureBottom, iconLeftZ,    0.0f, 1.0f);
             } else {
-                bindTexture(NAMED_PF, 0, loadI32(ALLOC_ICON_IDS, icon));
+                bindTexture(NAMED_PFTexLinear, 0, loadI32(ALLOC_ICON_IDS, icon));
                 drawQuadTexCoords(
                         iconLeftX, iconTextureTop, iconLeftZ,       0.0f, 0.0f,
                         iconRightX, iconTextureTop, iconRightZ,     1.0f, 0.0f,
@@ -281,7 +272,7 @@
                 float labelLeftX = centerX - farLabelWidth * 0.5f;
                 float labelRightX = centerX + farLabelWidth * 0.5f;
 
-                bindTexture(NAMED_PF, 0, loadI32(ALLOC_LABEL_IDS, icon));
+                bindTexture(NAMED_PFTexLinear, 0, loadI32(ALLOC_LABEL_IDS, icon));
                 drawQuadTexCoords(
                         labelLeftX, labelTop, centerZ,       0.0f, 0.0f,
                         labelRightX, labelTop, centerZ,      labelTextureWidth, 0.0f,
@@ -346,9 +337,6 @@
     //debugF("    draw g_PosPage", g_PosPage);
 
     // Draw the icons ========================================
-    bindProgramVertex(NAMED_PV);
-    bindProgramFragment(NAMED_PF);
-    bindProgramFragmentStore(NAMED_PFS);
 
     // Bug makes 1.0f alpha fail.
     color(1.0f, 1.0f, 1.0f, 0.99f);
diff --git a/src/com/android/launcher2/AllAppsView.java b/src/com/android/launcher2/AllAppsView.java
index 17d9a78..df43814 100644
--- a/src/com/android/launcher2/AllAppsView.java
+++ b/src/com/android/launcher2/AllAppsView.java
@@ -262,7 +262,7 @@
             return;
         }
         int index = mRollo.mState.selectedIconIndex;
-        if (mRollo.mState.flingVelocityX == 0 && index >= 0 && index < mAllAppsList.size()) {
+        if (mRollo.mReadback.velocity < 1 && index >= 0 && index < mAllAppsList.size()) {
             ApplicationInfo app = mAllAppsList.get(index);
             mLauncher.startActivitySafely(app.intent);
         }
@@ -416,17 +416,13 @@
         private Script.Invokable mInvokeSetZoom;
         private Script.Invokable mInvokeTouchUp;
 
-        private Sampler mSampler;
-        private Sampler mSamplerText;
-        private ProgramStore mPSBackground;
+        private ProgramStore mPSIcons;
         private ProgramStore mPSText;
-        private ProgramFragment mPFDebug;
-        private ProgramFragment mPFImages;
-        private ProgramFragment mPFOrtho;
+        private ProgramFragment mPFColor;
+        private ProgramFragment mPFTexLinear;
+        private ProgramFragment mPFTexNearest;
         private ProgramVertex mPV;
-        private ProgramVertex.MatrixAllocation mPVAlloc;
         private ProgramVertex mPVOrtho;
-        private ProgramVertex.MatrixAllocation mPVOrthoAlloc;
 
         private Allocation mScrollHandle;
 
@@ -518,75 +514,76 @@
             mRes = res;
             mWidth = width;
             mHeight = height;
+            initProgramVertex();
+            initProgramFragment();
+            initProgramStore();
             initGl();
             initData();
             initTouchState();
             initRs();
         }
 
-        private void initGl() {
-            Sampler.Builder sb = new Sampler.Builder(mRS);
-            sb.setMin(Sampler.Value.LINEAR);//_MIP_LINEAR);
-            sb.setMag(Sampler.Value.LINEAR);
-            sb.setWrapS(Sampler.Value.CLAMP);
-            sb.setWrapT(Sampler.Value.CLAMP);
-            mSampler = sb.create();
-
-            sb.setMin(Sampler.Value.NEAREST);
-            sb.setMag(Sampler.Value.NEAREST);
-            mSamplerText = sb.create();
-
-            ProgramFragment.Builder dbg = new ProgramFragment.Builder(mRS, null, null);
-            mPFDebug = dbg.create();
-            mPFDebug.setName("PFDebug");
-
-            ProgramFragment.Builder bf = new ProgramFragment.Builder(mRS, null, null);
-            bf.setTexEnable(true, 0);
-            bf.setTexEnvMode(ProgramFragment.EnvMode.MODULATE, 0);
-            mPFImages = bf.create();
-            mPFImages.setName("PF");
-            mPFImages.bindSampler(mSampler, 0);
-
-            bf.setTexEnvMode(ProgramFragment.EnvMode.MODULATE, 0);
-            //mPFOrtho = bf.create();
-            mPFOrtho = (new ProgramFragment.Builder(mRS, null, null)).create();
-            mPFOrtho.setName("PFOrtho");
-            mPFOrtho.bindSampler(mSamplerText, 0);
-
-            ProgramStore.Builder bs = new ProgramStore.Builder(mRS, null, null);
-            bs.setDepthFunc(ProgramStore.DepthFunc.ALWAYS);
-            bs.setDitherEnable(false);
-            bs.setDepthMask(true);
-            bs.setBlendFunc(ProgramStore.BlendSrcFunc.SRC_ALPHA,
-                            ProgramStore.BlendDstFunc.ONE_MINUS_SRC_ALPHA);
-            mPSBackground = bs.create();
-            mPSBackground.setName("PFS");
-
-            bs.setDepthFunc(ProgramStore.DepthFunc.ALWAYS);
-            bs.setDepthMask(false);
-            bs.setBlendFunc(ProgramStore.BlendSrcFunc.SRC_ALPHA,
-                            ProgramStore.BlendDstFunc.ONE_MINUS_SRC_ALPHA);
-            mPSText = bs.create();
-            mPSText.setName("PFSText");
-
-            mPVAlloc = new ProgramVertex.MatrixAllocation(mRS);
-            mPVAlloc.setupProjectionNormalized(mWidth, mHeight);
+        private void initProgramVertex() {
+            ProgramVertex.MatrixAllocation pva = new ProgramVertex.MatrixAllocation(mRS);
+            pva.setupProjectionNormalized(mWidth, mHeight);
 
             ProgramVertex.Builder pvb = new ProgramVertex.Builder(mRS, null, null);
             mPV = pvb.create();
             mPV.setName("PV");
-            mPV.bindAllocation(mPVAlloc);
+            mPV.bindAllocation(pva);
 
-            mPVOrthoAlloc = new ProgramVertex.MatrixAllocation(mRS);
-            mPVOrthoAlloc.setupOrthoWindow(mWidth, mHeight);
-
+            pva = new ProgramVertex.MatrixAllocation(mRS);
+            pva.setupOrthoWindow(mWidth, mHeight);
             pvb.setTextureMatrixEnable(true);
             mPVOrtho = pvb.create();
             mPVOrtho.setName("PVOrtho");
-            mPVOrtho.bindAllocation(mPVOrthoAlloc);
+            mPVOrtho.bindAllocation(pva);
 
             mRS.contextBindProgramVertex(mPV);
+        }
 
+        private void initProgramFragment() {
+            Sampler.Builder sb = new Sampler.Builder(mRS);
+            sb.setMin(Sampler.Value.LINEAR);
+            sb.setMag(Sampler.Value.LINEAR);
+            sb.setWrapS(Sampler.Value.CLAMP);
+            sb.setWrapT(Sampler.Value.CLAMP);
+            Sampler linear = sb.create();
+
+            sb.setMin(Sampler.Value.NEAREST);
+            sb.setMag(Sampler.Value.NEAREST);
+            Sampler nearest = sb.create();
+
+            ProgramFragment.Builder bf = new ProgramFragment.Builder(mRS, null, null);
+            mPFColor = bf.create();
+            mPFColor.setName("PFColor");
+
+            bf.setTexEnable(true, 0);
+            bf.setTexEnvMode(ProgramFragment.EnvMode.MODULATE, 0);
+            mPFTexLinear = bf.create();
+            mPFTexLinear.setName("PFTexLinear");
+            mPFTexLinear.bindSampler(linear, 0);
+
+            mPFTexNearest = bf.create();
+            mPFTexNearest.setName("PFTexNearest");
+            mPFTexNearest.bindSampler(nearest, 0);
+        }
+
+        private void initProgramStore() {
+            ProgramStore.Builder bs = new ProgramStore.Builder(mRS, null, null);
+            bs.setDepthFunc(ProgramStore.DepthFunc.ALWAYS);
+            bs.setDitherEnable(true);
+            bs.setBlendFunc(ProgramStore.BlendSrcFunc.SRC_ALPHA,
+                            ProgramStore.BlendDstFunc.ONE_MINUS_SRC_ALPHA);
+            mPSIcons = bs.create();
+            mPSIcons.setName("PSIcons");
+
+            //bs.setDitherEnable(false);
+            //mPSText = bs.create();
+            //mPSText.setName("PSText");
+        }
+
+        private void initGl() {
             mTouchXBorders = new int[Defines.COLUMNS_PER_PAGE+1];
             mAllocTouchXBorders = Allocation.createSized(mRS, Element.USER_I32(mRS),
                     mTouchXBorders.length);
