commit 6cf89a3eb9e6dd2fc1423aad410af3b4e39a954b
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Tue Aug 31 15:38:08 2021 +0200

    Introduce pseudorandom balancing into scrambling in case of the two Dinos (from now on, the more times a particular (ax,layer) combination has been chosen already in the scrambling sequence, the less likely it is to be chosen next).
    Fix Dino6 - isSolved(). Sadly, it cannot be the geeneric function - it needs to be another special case.

diff --git a/src/main/java/org/distorted/helpers/ScrambleState.java b/src/main/java/org/distorted/helpers/ScrambleState.java
new file mode 100644
index 00000000..dc396c98
--- /dev/null
+++ b/src/main/java/org/distorted/helpers/ScrambleState.java
@@ -0,0 +1,155 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Copyright 2021 Leszek Koltunski                                                               //
+//                                                                                               //
+// This file is part of Magic Cube.                                                              //
+//                                                                                               //
+// Magic Cube is free software: you can redistribute it and/or modify                            //
+// it under the terms of the GNU General Public License as published by                          //
+// the Free Software Foundation, either version 2 of the License, or                             //
+// (at your option) any later version.                                                           //
+//                                                                                               //
+// Magic Cube is distributed in the hope that it will be useful,                                 //
+// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
+// GNU General Public License for more details.                                                  //
+//                                                                                               //
+// You should have received a copy of the GNU General Public License                             //
+// along with Magic Cube.  If not, see <http://www.gnu.org/licenses/>.                           //
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+package org.distorted.helpers;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+import java.util.Random;
+
+public class ScrambleState
+{
+  private final int mTotal, mNumAxis;
+  private final int[] mNum;
+  private final int[] mInfo;
+  private final int[] mTmp;
+  private final int LEN = 4;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public ScrambleState(int[][] axis)
+    {
+    mTmp = new int[LEN];
+
+    mNumAxis = axis.length;
+    mNum = new int[mNumAxis];
+    int total =0;
+
+    for(int i=0; i<mNumAxis; i++)
+      {
+      mNum[i] = axis[i]==null ? 0 : axis[i].length/(LEN-1);
+      total += mNum[i];
+      }
+
+    mTotal = total;
+
+    mInfo = new int[LEN*total];
+    int start = 0;
+
+    for(int i=0; i<mNumAxis; i++)
+      {
+      for(int j=0; j<mNum[i]; j++)
+        {
+        mInfo[LEN*j   + start] = i;
+        mInfo[LEN*j+1 + start] = axis[i][(LEN-1)*j  ];
+        mInfo[LEN*j+2 + start] = axis[i][(LEN-1)*j+1];
+        mInfo[LEN*j+3 + start] = axis[i][(LEN-1)*j+2];
+        }
+
+      start += LEN*mNum[i];
+      }
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private int getIndex(int num, int indexExcluded)
+    {
+    int current= -1;
+
+    for(int i=0; i<mTotal; i++)
+      if( mInfo[LEN*i]!=indexExcluded && ++current==num ) return i;
+
+    return -1;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public int[] getRandom(Random rnd, int indexExcluded, int[][] scrambleTable, int[] numOccurences)
+    {
+    int num=0, total=0, max=0, ax, layer;
+
+    for(int i=0; i<mTotal; i++)
+      {
+      ax = mInfo[LEN*i];
+
+      if( ax!=indexExcluded )
+        {
+        layer = mInfo[LEN*i+1];
+        int value = scrambleTable[ax][layer];
+        if( value>max ) max=value;
+        }
+      }
+
+    for(int i=0; i<mTotal; i++)
+      {
+      ax = mInfo[LEN*i];
+
+      if( ax!=indexExcluded )
+        {
+        layer = mInfo[LEN*i+1];
+        int value = scrambleTable[ax][layer];
+        numOccurences[total] = 1 + max - value + (total==0 ? 0 : numOccurences[total-1]);
+        total++;
+        }
+      }
+
+    float random= rnd.nextFloat()*numOccurences[total-1];
+
+    for(int i=0; i<total; i++)
+      {
+      if( random <= numOccurences[i] )
+        {
+        num=i;
+        break;
+        }
+      }
+
+    int index = getIndex(num,indexExcluded);
+
+    mTmp[0] = mInfo[LEN*index  ];   // axis
+    mTmp[1] = mInfo[LEN*index+1];   // row
+    mTmp[2] = mInfo[LEN*index+2];   // angle
+    mTmp[3] = mInfo[LEN*index+3];   // next state
+
+    scrambleTable[mTmp[0]][mTmp[1]]++;
+
+    return mTmp;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public int getTotal(int indexExcluded)
+    {
+    return ( indexExcluded>=0 && indexExcluded<mNumAxis ) ? mTotal-mNum[indexExcluded] : mTotal;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public int[] getInfo(int num, int indexExcluded)
+    {
+    int index = getIndex(num,indexExcluded);
+
+    mTmp[0] = mInfo[LEN*index  ];   // axis
+    mTmp[1] = mInfo[LEN*index+1];   // row
+    mTmp[2] = mInfo[LEN*index+2];   // angle
+    mTmp[3] = mInfo[LEN*index+3];   // next state
+
+    return mTmp;
+    }
+}
\ No newline at end of file
diff --git a/src/main/java/org/distorted/helpers/ScrambleStateBandagedEvil.java b/src/main/java/org/distorted/helpers/ScrambleStateBandagedEvil.java
new file mode 100644
index 00000000..4f6055d7
--- /dev/null
+++ b/src/main/java/org/distorted/helpers/ScrambleStateBandagedEvil.java
@@ -0,0 +1,669 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Copyright 2021 Leszek Koltunski                                                               //
+//                                                                                               //
+// This file is part of Magic Cube.                                                              //
+//                                                                                               //
+// Magic Cube is free software: you can redistribute it and/or modify                            //
+// it under the terms of the GNU General Public License as published by                          //
+// the Free Software Foundation, either version 2 of the License, or                             //
+// (at your option) any later version.                                                           //
+//                                                                                               //
+// Magic Cube is distributed in the hope that it will be useful,                                 //
+// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
+// GNU General Public License for more details.                                                  //
+//                                                                                               //
+// You should have received a copy of the GNU General Public License                             //
+// along with Magic Cube.  If not, see <http://www.gnu.org/licenses/>.                           //
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+package org.distorted.helpers;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// producer of the ScrambleStateGraph - but only for a single Twisty Puzzle, the 'BandagedEvil'.
+
+import java.util.ArrayList;
+
+public class ScrambleStateBandagedEvil
+{
+  private static final int INVALID_MOVE = -1;
+
+  private static final int CORNER_S = 0;
+  private static final int CORNER_X = 1;
+  private static final int CORNER_Y = 2;
+  private static final int CORNER_Z = 3;
+
+  private static final int CENTER_0 = 0;
+  private static final int CENTER_1 = 1;
+  private static final int CENTER_2 = 2;
+  private static final int CENTER_3 = 3;
+
+  private int mID;
+  private final int[] mMoves;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public ScrambleStateBandagedEvil(int id)
+    {
+    mID = id;
+    mMoves = createMoves(mID);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public static void computeGraph()
+    {
+    ArrayList<ScrambleStateBandagedEvil> graph;
+
+    int id = 0;
+    int id1 = setCenter(id  , CENTER_2, 0);
+    int id2 = setCenter(id1 , CENTER_2, 1);
+    int id3 = setCenter(id2 , CENTER_3, 2);
+    int id4 = setCenter(id3 , CENTER_2, 3);
+
+    int id5 = setCorner(id4 , CORNER_X, 0);
+    int id6 = setCorner(id5 , CORNER_Y, 1);
+    int id7 = setCorner(id6 , CORNER_X, 2);
+    int id8 = setCorner(id7 , CORNER_Z, 3);
+    int id9 = setCorner(id8 , CORNER_Y, 4);
+    int id10= setCorner(id9 , CORNER_Y, 5);
+    int id11= setCorner(id10, CORNER_S, 6);
+    int id12= setCorner(id11, CORNER_Z, 7);
+
+    ScrambleStateBandagedEvil bsg = new ScrambleStateBandagedEvil(id12);
+    graph = new ArrayList<>();
+    graph.add(bsg);
+
+    insertChildren(graph,id12);
+    pruneGraph(graph);
+    remapGraph(graph);
+
+    int num = graph.size();
+    android.util.Log.e("D", "\n"+num+" states\n");
+
+    for(int i=0; i<num; i++)
+      {
+      bsg = graph.get(i);
+      android.util.Log.e("D", formatMoves(bsg));
+      }
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private static void insertChildren(ArrayList<ScrambleStateBandagedEvil> list, int id)
+    {
+    ScrambleStateBandagedEvil bsg = findState(list,id);
+
+    if( bsg==null )
+      {
+      android.util.Log.e("D", "error: "+id+" doesn't exist");
+      return;
+      }
+
+    for(int i=0; i<12; i++)
+      {
+      int move = bsg.getMove(i);
+
+      if( move!=INVALID_MOVE )
+        {
+        ScrambleStateBandagedEvil tmp = findState(list,move);
+
+        if( tmp==null )
+          {
+          tmp = new ScrambleStateBandagedEvil(move);
+          list.add(tmp);
+          insertChildren(list,move);
+          }
+        }
+      }
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private static void pruneGraph(ArrayList<ScrambleStateBandagedEvil> list)
+    {
+    int num = list.size(), numAxis;
+    boolean pruned = false;
+    ScrambleStateBandagedEvil bsg;
+
+    for(int i=0; i<num; i++)
+      {
+      bsg = list.get(i);
+      numAxis = bsg.numAxis();
+
+      if( numAxis<2 )
+        {
+        list.remove(i);
+        int id = bsg.getID();
+        pruned = true;
+        remapID(list,id,INVALID_MOVE);
+        break;
+        }
+      }
+
+    if( pruned ) pruneGraph(list);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private static void remapGraph(ArrayList<ScrambleStateBandagedEvil> list)
+    {
+    int id, num = list.size();
+    ScrambleStateBandagedEvil bsg;
+
+    for(int i=0; i<num; i++ )
+      {
+      bsg = list.get(i);
+      id = bsg.getID();
+      bsg.setID(i);
+      remapID(list,id,i);
+      }
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private static void remapID(ArrayList<ScrambleStateBandagedEvil> list, int id, int newId)
+    {
+    ScrambleStateBandagedEvil bsg;
+    int size = list.size();
+
+    for(int i=0; i<size; i++)
+      {
+      bsg = list.get(i);
+
+      for(int j=0; j<12; j++)
+        {
+        if( bsg.getMove(j)==id ) bsg.setMove(j,newId);
+        }
+      }
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private static ScrambleStateBandagedEvil findState(ArrayList<ScrambleStateBandagedEvil> list, int id)
+    {
+    ScrambleStateBandagedEvil bsg;
+    int num = list.size();
+
+    for(int i=0; i<num; i++)
+      {
+      bsg= list.get(i);
+      if( bsg.getID() == id ) return bsg;
+      }
+
+    return null;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private static String formatMoves(ScrambleStateBandagedEvil bsg)
+    {
+    String x = getTable(bsg,0);
+    String y = getTable(bsg,3);
+    String z = getTable(bsg,6);
+
+    return "    new ScrambleStateGraph( new int[][] { "+x+", "+y+", "+z+" } ),";
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private static String getTable(ScrambleStateBandagedEvil sc, int index)
+    {
+    String ret = "";
+
+    if( index==0 || index==3 )
+      {
+      int m0 = sc.getMove(index  );
+      int m1 = sc.getMove(index+1);
+      int m2 = sc.getMove(index+2);
+
+      if( m0==INVALID_MOVE && m1==INVALID_MOVE && m2==INVALID_MOVE ) return formatL("{}");
+
+      if( m0!=INVALID_MOVE ) ret += formatRet(ret,2, 1,m0);
+      if( m1!=INVALID_MOVE ) ret += formatRet(ret,2, 2,m1);
+      if( m2!=INVALID_MOVE ) ret += formatRet(ret,2,-1,m2);
+      }
+    else
+      {
+      int m0 = sc.getMove(index  );
+      int m1 = sc.getMove(index+1);
+      int m2 = sc.getMove(index+2);
+      int m3 = sc.getMove(index+3);
+      int m4 = sc.getMove(index+4);
+      int m5 = sc.getMove(index+5);
+
+      if( m0==INVALID_MOVE && m1==INVALID_MOVE && m2==INVALID_MOVE &&
+          m3==INVALID_MOVE && m4==INVALID_MOVE && m5==INVALID_MOVE  )
+        {
+        return formatL("{}");
+        }
+
+      if( m0!=INVALID_MOVE ) ret += formatRet(ret,0, 1,m0);
+      if( m1!=INVALID_MOVE ) ret += formatRet(ret,0, 2,m1);
+      if( m2!=INVALID_MOVE ) ret += formatRet(ret,0,-1,m2);
+      if( m3!=INVALID_MOVE ) ret += formatRet(ret,2, 1,m3);
+      if( m4!=INVALID_MOVE ) ret += formatRet(ret,2, 2,m4);
+      if( m5!=INVALID_MOVE ) ret += formatRet(ret,2,-1,m5);
+      }
+
+    return formatL("{" + ret + "}");
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private static String formatRet(String str, int row, int angle, int id)
+    {
+    String ret = str.length()!=0 ? ",":"";
+
+    ret += row;
+    ret += angle<0 ? "," : ", ";
+    ret += angle;
+
+         if( id< 10 ) ret += (",  "+id);
+    else if( id<100 ) ret += (", " +id);
+    else              ret += (","  +id);
+
+    return ret;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private static final int LENGTH = 28;
+
+  private static String formatL(String input)
+    {
+    int len = input.length();
+    String ret = input;
+    for(int i=0 ;i<LENGTH-len; i++) ret += " ";
+    return ret;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private int getID()
+    {
+    return mID;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private void setID(int id)
+    {
+    mID = id;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private int getMove(int index)
+    {
+    return (index>=0 && index<12) ? mMoves[index] : -1;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private int numAxis()
+    {
+    int num = 0;
+
+    if( mMoves[ 0]!=INVALID_MOVE || mMoves[ 1]!=INVALID_MOVE || mMoves[ 2]!=INVALID_MOVE ) num++;
+    if( mMoves[ 3]!=INVALID_MOVE || mMoves[ 4]!=INVALID_MOVE || mMoves[ 5]!=INVALID_MOVE ) num++;
+    if( mMoves[ 6]!=INVALID_MOVE || mMoves[ 7]!=INVALID_MOVE || mMoves[ 8]!=INVALID_MOVE ) num++;
+    if( mMoves[ 9]!=INVALID_MOVE || mMoves[10]!=INVALID_MOVE || mMoves[11]!=INVALID_MOVE ) num++;
+
+    return num;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private void setMove(int index, int newMove)
+    {
+    if( index>=0 && index<12 ) mMoves[index] = newMove;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private static String debug(int id)
+    {
+    int ce0 = getCenter(id,0);
+    int ce1 = getCenter(id,1);
+    int ce2 = getCenter(id,2);
+    int ce3 = getCenter(id,3);
+
+    int co0 = getCorner(id,0);
+    int co1 = getCorner(id,1);
+    int co2 = getCorner(id,2);
+    int co3 = getCorner(id,3);
+    int co4 = getCorner(id,4);
+    int co5 = getCorner(id,5);
+    int co6 = getCorner(id,6);
+    int co7 = getCorner(id,7);
+
+    String center = centerString(ce0) + centerString(ce1) + centerString(ce2) + centerString(ce3);
+    String corner = cornerString(co0) + cornerString(co1) + cornerString(co2) + cornerString(co3) +
+                    cornerString(co4) + cornerString(co5) + cornerString(co6) + cornerString(co7);
+
+    return center + " -" + corner;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private static String centerString(int center)
+    {
+    return " "+center;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private static String cornerString(int corner)
+    {
+    switch(corner)
+      {
+      case CORNER_S: return " S";
+      case CORNER_X: return " X";
+      case CORNER_Y: return " Y";
+      case CORNER_Z: return " Z";
+      }
+
+    return "?";
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private static int[] createMoves(int id)
+    {
+    int[] ret = new int[12];
+
+    boolean moveX  = xPossible(id);
+    boolean moveY  = yPossible(id);
+    boolean moveZ0 = z0Possible(id);
+    boolean moveZ2 = z2Possible(id);
+
+    if( moveX ) createXmoves(id,ret);
+    else        { ret[ 0] = INVALID_MOVE; ret[ 1] = INVALID_MOVE; ret[ 2] = INVALID_MOVE; }
+    if( moveY ) createYmoves(id,ret);
+    else        { ret[ 3] = INVALID_MOVE; ret[ 4] = INVALID_MOVE; ret[ 5] = INVALID_MOVE; }
+    if( moveZ0) createZ0moves(id,ret);
+    else        { ret[ 6] = INVALID_MOVE; ret[ 7] = INVALID_MOVE; ret[ 8] = INVALID_MOVE; }
+    if( moveZ2) createZ2moves(id,ret);
+    else        { ret[ 9] = INVALID_MOVE; ret[10] = INVALID_MOVE; ret[11] = INVALID_MOVE; }
+
+    return ret;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private static boolean xPossible(int id)
+    {
+    if( getCorner(id,4)==CORNER_X ) return false;
+    if( getCorner(id,5)==CORNER_X ) return false;
+    if( getCorner(id,6)==CORNER_X ) return false;
+    if( getCorner(id,7)==CORNER_X ) return false;
+
+    if( getCenter(id,1)==CENTER_1 ) return false;
+    if( getCenter(id,2)==CENTER_1 ) return false;
+    if( getCenter(id,3)==CENTER_1 ) return false;
+
+    return true;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private static boolean yPossible(int id)
+    {
+    if( getCorner(id,2)==CORNER_Y ) return false;
+    if( getCorner(id,3)==CORNER_Y ) return false;
+    if( getCorner(id,6)==CORNER_Y ) return false;
+    if( getCorner(id,7)==CORNER_Y ) return false;
+
+    if( getCenter(id,0)==CENTER_0 ) return false;
+    if( getCenter(id,2)==CENTER_0 ) return false;
+    if( getCenter(id,3)==CENTER_0 ) return false;
+
+    return true;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private static boolean z0Possible(int id)
+    {
+    if( getCorner(id,0)==CORNER_Z ) return false;
+    if( getCorner(id,2)==CORNER_Z ) return false;
+    if( getCorner(id,4)==CORNER_Z ) return false;
+    if( getCorner(id,6)==CORNER_Z ) return false;
+
+    if( getCenter(id,0)==CENTER_1 ) return false;
+    if( getCenter(id,1)==CENTER_0 ) return false;
+
+    return true;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private static boolean z2Possible(int id)
+    {
+    if( getCorner(id,1)==CORNER_Z ) return false;
+    if( getCorner(id,3)==CORNER_Z ) return false;
+    if( getCorner(id,5)==CORNER_Z ) return false;
+    if( getCorner(id,7)==CORNER_Z ) return false;
+
+    if( getCenter(id,0)==CENTER_3 ) return false;
+    if( getCenter(id,1)==CENTER_2 ) return false;
+
+    return true;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private static int getCorner(int id, int index)
+    {
+    return (id>>(14-2*index))&3;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private static int getCenter(int id, int index)
+    {
+    return (id>>(22-2*index))&3;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private static int setCorner(int id, int corner, int index)
+    {
+    return id + ((corner-getCorner(id,index))<<(14-2*index));
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private static int setCenter(int id, int center, int index)
+    {
+    return id + ((center-getCenter(id,index))<<(22-2*index));
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private static void createXmoves(int id, int[] moves)
+    {
+    int id1 = rotateX(id);
+    moves[0] = id1;
+    int id2 = rotateX(id1);
+    moves[1] = id2;
+    int id3 = rotateX(id2);
+    moves[2] = id3;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private static void createYmoves(int id, int[] moves)
+    {
+    int id1 = rotateY(id);
+    moves[3] = id1;
+    int id2 = rotateY(id1);
+    moves[4] = id2;
+    int id3 = rotateY(id2);
+    moves[5] = id3;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private static void createZ0moves(int id, int[] moves)
+    {
+    int id1 = rotateZ0(id);
+    moves[6] = id1;
+    int id2 = rotateZ0(id1);
+    moves[7] = id2;
+    int id3 = rotateZ0(id2);
+    moves[8] = id3;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private static void createZ2moves(int id, int[] moves)
+    {
+    int id1 = rotateZ2(id);
+    moves[ 9] = id1;
+    int id2 = rotateZ2(id1);
+    moves[10] = id2;
+    int id3 = rotateZ2(id2);
+    moves[11] = id3;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private static int rotateX(int id)
+    {
+    int newCorner4 = rotCornerX(getCorner(id,5));
+    int newCorner5 = rotCornerX(getCorner(id,7));
+    int newCorner6 = rotCornerX(getCorner(id,4));
+    int newCorner7 = rotCornerX(getCorner(id,6));
+    int newCenter  = rotCenter (getCenter(id,0));
+
+    int id1 = setCorner(id ,newCorner4,4);
+    int id2 = setCorner(id1,newCorner5,5);
+    int id3 = setCorner(id2,newCorner6,6);
+    int id4 = setCorner(id3,newCorner7,7);
+    int id5 = setCenter(id4,newCenter ,0);
+
+    return id5;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private static int rotateY(int id)
+    {
+    int newCorner2 = rotCornerY(getCorner(id,6));
+    int newCorner3 = rotCornerY(getCorner(id,2));
+    int newCorner6 = rotCornerY(getCorner(id,7));
+    int newCorner7 = rotCornerY(getCorner(id,3));
+    int newCenter  = rotCenter (getCenter(id,1));
+
+    int id1 = setCorner(id ,newCorner2,2);
+    int id2 = setCorner(id1,newCorner3,3);
+    int id3 = setCorner(id2,newCorner6,6);
+    int id4 = setCorner(id3,newCorner7,7);
+    int id5 = setCenter(id4,newCenter ,1);
+
+    return id5;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private static int rotateZ0(int id)
+    {
+    int newCorner0 = rotCornerZ(getCorner(id,2));
+    int newCorner2 = rotCornerZ(getCorner(id,6));
+    int newCorner4 = rotCornerZ(getCorner(id,0));
+    int newCorner6 = rotCornerZ(getCorner(id,4));
+    int newCenter  = rotCenter (getCenter(id,2));
+
+    int id1 = setCorner(id ,newCorner0,0);
+    int id2 = setCorner(id1,newCorner2,2);
+    int id3 = setCorner(id2,newCorner4,4);
+    int id4 = setCorner(id3,newCorner6,6);
+    int id5 = setCenter(id4,newCenter ,2);
+
+    return id5;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private static int rotateZ2(int id)
+    {
+    int newCorner1 = rotCornerZ(getCorner(id,3));
+    int newCorner3 = rotCornerZ(getCorner(id,7));
+    int newCorner5 = rotCornerZ(getCorner(id,1));
+    int newCorner7 = rotCornerZ(getCorner(id,5));
+    int newCenter  = rotCenter (getCenter(id,3));
+
+    int id1 = setCorner(id ,newCorner1,1);
+    int id2 = setCorner(id1,newCorner3,3);
+    int id3 = setCorner(id2,newCorner5,5);
+    int id4 = setCorner(id3,newCorner7,7);
+    int id5 = setCenter(id4,newCenter ,3);
+
+    return id5;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private static int rotCornerX(int corner)
+    {
+    switch(corner)
+      {
+      case CORNER_S: return CORNER_S;
+      case CORNER_X: android.util.Log.e("DIST", "rotateX: ERROR");
+                     return CORNER_S;
+      case CORNER_Y: return CORNER_Z;
+      case CORNER_Z: return CORNER_Y;
+      }
+
+    return CORNER_S;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private static int rotCornerY(int corner)
+    {
+    switch(corner)
+      {
+      case CORNER_S: return CORNER_S;
+      case CORNER_X: return CORNER_Z;
+      case CORNER_Y: android.util.Log.e("DIST", "rotateY: ERROR");
+                     return CORNER_S;
+      case CORNER_Z: return CORNER_X;
+      }
+
+    return CORNER_S;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private static int rotCornerZ(int corner)
+    {
+    switch(corner)
+      {
+      case CORNER_S: return CORNER_S;
+      case CORNER_X: return CORNER_Y;
+      case CORNER_Y: return CORNER_X;
+      case CORNER_Z: android.util.Log.e("DIST", "rotateZ: ERROR");
+                     return CORNER_S;
+      }
+
+    return CORNER_S;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private static int rotCenter(int center)
+    {
+    switch(center)
+      {
+      case CENTER_0: return CENTER_3;
+      case CENTER_1: return CENTER_0;
+      case CENTER_2: return CENTER_1;
+      case CENTER_3: return CENTER_2;
+      }
+
+    return CENTER_0;
+    }
+}
diff --git a/src/main/java/org/distorted/helpers/ScrambleStateGraph.java b/src/main/java/org/distorted/helpers/ScrambleStateGraph.java
deleted file mode 100644
index 4b8c6b00..00000000
--- a/src/main/java/org/distorted/helpers/ScrambleStateGraph.java
+++ /dev/null
@@ -1,99 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Copyright 2021 Leszek Koltunski                                                               //
-//                                                                                               //
-// This file is part of Magic Cube.                                                              //
-//                                                                                               //
-// Magic Cube is free software: you can redistribute it and/or modify                            //
-// it under the terms of the GNU General Public License as published by                          //
-// the Free Software Foundation, either version 2 of the License, or                             //
-// (at your option) any later version.                                                           //
-//                                                                                               //
-// Magic Cube is distributed in the hope that it will be useful,                                 //
-// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
-// GNU General Public License for more details.                                                  //
-//                                                                                               //
-// You should have received a copy of the GNU General Public License                             //
-// along with Magic Cube.  If not, see <http://www.gnu.org/licenses/>.                           //
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-package org.distorted.helpers;
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-public class ScrambleStateGraph
-{
-  private final int mTotal, mNumAxis;
-  private final int[] mNum;
-  private final int[] mInfo;
-  private final int[] mTmp;
-  private final int LEN = 4;
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  public ScrambleStateGraph(int[][] axis)
-    {
-    mTmp = new int[LEN];
-
-    mNumAxis = axis.length;
-    mNum = new int[mNumAxis];
-    int total =0;
-
-    for(int i=0; i<mNumAxis; i++)
-      {
-      mNum[i] = axis[i]==null ? 0 : axis[i].length/(LEN-1);
-      total += mNum[i];
-      }
-
-    mTotal = total;
-
-    mInfo = new int[LEN*total];
-    int start = 0;
-
-    for(int i=0; i<mNumAxis; i++)
-      {
-      for(int j=0; j<mNum[i]; j++)
-        {
-        mInfo[LEN*j   + start] = i;
-        mInfo[LEN*j+1 + start] = axis[i][(LEN-1)*j  ];
-        mInfo[LEN*j+2 + start] = axis[i][(LEN-1)*j+1];
-        mInfo[LEN*j+3 + start] = axis[i][(LEN-1)*j+2];
-        }
-
-      start += LEN*mNum[i];
-      }
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private int getIndex(int num, int indexExcluded)
-    {
-    int current= -1;
-
-    for(int i=0; i<mTotal; i++)
-      if( mInfo[LEN*i]!=indexExcluded && ++current==num ) return i;
-
-    return -1;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  public int getTotal(int indexExcluded)
-    {
-    return ( indexExcluded>=0 && indexExcluded<mNumAxis ) ? mTotal-mNum[indexExcluded] : mTotal;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  public int[] getInfo(int num, int indexExcluded)
-    {
-    int index = getIndex(num,indexExcluded);
-
-    mTmp[0] = mInfo[LEN*index  ];   // axis
-    mTmp[1] = mInfo[LEN*index+1];   // row
-    mTmp[2] = mInfo[LEN*index+2];   // angle
-    mTmp[3] = mInfo[LEN*index+3];   // next state
-
-    return mTmp;
-    }
-}
\ No newline at end of file
diff --git a/src/main/java/org/distorted/helpers/ScrambleStateGraphProducer.java b/src/main/java/org/distorted/helpers/ScrambleStateGraphProducer.java
deleted file mode 100644
index 50d6dd10..00000000
--- a/src/main/java/org/distorted/helpers/ScrambleStateGraphProducer.java
+++ /dev/null
@@ -1,669 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Copyright 2021 Leszek Koltunski                                                               //
-//                                                                                               //
-// This file is part of Magic Cube.                                                              //
-//                                                                                               //
-// Magic Cube is free software: you can redistribute it and/or modify                            //
-// it under the terms of the GNU General Public License as published by                          //
-// the Free Software Foundation, either version 2 of the License, or                             //
-// (at your option) any later version.                                                           //
-//                                                                                               //
-// Magic Cube is distributed in the hope that it will be useful,                                 //
-// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
-// GNU General Public License for more details.                                                  //
-//                                                                                               //
-// You should have received a copy of the GNU General Public License                             //
-// along with Magic Cube.  If not, see <http://www.gnu.org/licenses/>.                           //
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-package org.distorted.helpers;
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// producer of the ScrambleStateGraph - but only for a single Twisty Puzzle, the 'BandagedEvil'.
-
-import java.util.ArrayList;
-
-public class ScrambleStateGraphProducer
-{
-  private static final int INVALID_MOVE = -1;
-
-  private static final int CORNER_S = 0;
-  private static final int CORNER_X = 1;
-  private static final int CORNER_Y = 2;
-  private static final int CORNER_Z = 3;
-
-  private static final int CENTER_0 = 0;
-  private static final int CENTER_1 = 1;
-  private static final int CENTER_2 = 2;
-  private static final int CENTER_3 = 3;
-
-  private int mID;
-  private final int[] mMoves;
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  public ScrambleStateGraphProducer(int id)
-    {
-    mID = id;
-    mMoves = createMoves(mID);
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  public static void computeGraph()
-    {
-    ArrayList<ScrambleStateGraphProducer> graph;
-
-    int id = 0;
-    int id1 = setCenter(id  , CENTER_2, 0);
-    int id2 = setCenter(id1 , CENTER_2, 1);
-    int id3 = setCenter(id2 , CENTER_3, 2);
-    int id4 = setCenter(id3 , CENTER_2, 3);
-
-    int id5 = setCorner(id4 , CORNER_X, 0);
-    int id6 = setCorner(id5 , CORNER_Y, 1);
-    int id7 = setCorner(id6 , CORNER_X, 2);
-    int id8 = setCorner(id7 , CORNER_Z, 3);
-    int id9 = setCorner(id8 , CORNER_Y, 4);
-    int id10= setCorner(id9 , CORNER_Y, 5);
-    int id11= setCorner(id10, CORNER_S, 6);
-    int id12= setCorner(id11, CORNER_Z, 7);
-
-    ScrambleStateGraphProducer bsg = new ScrambleStateGraphProducer(id12);
-    graph = new ArrayList<>();
-    graph.add(bsg);
-
-    insertChildren(graph,id12);
-    pruneGraph(graph);
-    remapGraph(graph);
-
-    int num = graph.size();
-    android.util.Log.e("D", "\n"+num+" states\n");
-
-    for(int i=0; i<num; i++)
-      {
-      bsg = graph.get(i);
-      android.util.Log.e("D", formatMoves(bsg));
-      }
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private static void insertChildren(ArrayList<ScrambleStateGraphProducer> list, int id)
-    {
-    ScrambleStateGraphProducer bsg = findState(list,id);
-
-    if( bsg==null )
-      {
-      android.util.Log.e("D", "error: "+id+" doesn't exist");
-      return;
-      }
-
-    for(int i=0; i<12; i++)
-      {
-      int move = bsg.getMove(i);
-
-      if( move!=INVALID_MOVE )
-        {
-        ScrambleStateGraphProducer tmp = findState(list,move);
-
-        if( tmp==null )
-          {
-          tmp = new ScrambleStateGraphProducer(move);
-          list.add(tmp);
-          insertChildren(list,move);
-          }
-        }
-      }
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private static void pruneGraph(ArrayList<ScrambleStateGraphProducer> list)
-    {
-    int num = list.size(), numAxis;
-    boolean pruned = false;
-    ScrambleStateGraphProducer bsg;
-
-    for(int i=0; i<num; i++)
-      {
-      bsg = list.get(i);
-      numAxis = bsg.numAxis();
-
-      if( numAxis<2 )
-        {
-        list.remove(i);
-        int id = bsg.getID();
-        pruned = true;
-        remapID(list,id,INVALID_MOVE);
-        break;
-        }
-      }
-
-    if( pruned ) pruneGraph(list);
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private static void remapGraph(ArrayList<ScrambleStateGraphProducer> list)
-    {
-    int id, num = list.size();
-    ScrambleStateGraphProducer bsg;
-
-    for(int i=0; i<num; i++ )
-      {
-      bsg = list.get(i);
-      id = bsg.getID();
-      bsg.setID(i);
-      remapID(list,id,i);
-      }
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private static void remapID(ArrayList<ScrambleStateGraphProducer> list, int id, int newId)
-    {
-    ScrambleStateGraphProducer bsg;
-    int size = list.size();
-
-    for(int i=0; i<size; i++)
-      {
-      bsg = list.get(i);
-
-      for(int j=0; j<12; j++)
-        {
-        if( bsg.getMove(j)==id ) bsg.setMove(j,newId);
-        }
-      }
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private static ScrambleStateGraphProducer findState(ArrayList<ScrambleStateGraphProducer> list, int id)
-    {
-    ScrambleStateGraphProducer bsg;
-    int num = list.size();
-
-    for(int i=0; i<num; i++)
-      {
-      bsg= list.get(i);
-      if( bsg.getID() == id ) return bsg;
-      }
-
-    return null;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private static String formatMoves(ScrambleStateGraphProducer bsg)
-    {
-    String x = getTable(bsg,0);
-    String y = getTable(bsg,3);
-    String z = getTable(bsg,6);
-
-    return "    new ScrambleStateGraph( new int[][] { "+x+", "+y+", "+z+" } ),";
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private static String getTable(ScrambleStateGraphProducer sc, int index)
-    {
-    String ret = "";
-
-    if( index==0 || index==3 )
-      {
-      int m0 = sc.getMove(index  );
-      int m1 = sc.getMove(index+1);
-      int m2 = sc.getMove(index+2);
-
-      if( m0==INVALID_MOVE && m1==INVALID_MOVE && m2==INVALID_MOVE ) return formatL("{}");
-
-      if( m0!=INVALID_MOVE ) ret += formatRet(ret,2, 1,m0);
-      if( m1!=INVALID_MOVE ) ret += formatRet(ret,2, 2,m1);
-      if( m2!=INVALID_MOVE ) ret += formatRet(ret,2,-1,m2);
-      }
-    else
-      {
-      int m0 = sc.getMove(index  );
-      int m1 = sc.getMove(index+1);
-      int m2 = sc.getMove(index+2);
-      int m3 = sc.getMove(index+3);
-      int m4 = sc.getMove(index+4);
-      int m5 = sc.getMove(index+5);
-
-      if( m0==INVALID_MOVE && m1==INVALID_MOVE && m2==INVALID_MOVE &&
-          m3==INVALID_MOVE && m4==INVALID_MOVE && m5==INVALID_MOVE  )
-        {
-        return formatL("{}");
-        }
-
-      if( m0!=INVALID_MOVE ) ret += formatRet(ret,0, 1,m0);
-      if( m1!=INVALID_MOVE ) ret += formatRet(ret,0, 2,m1);
-      if( m2!=INVALID_MOVE ) ret += formatRet(ret,0,-1,m2);
-      if( m3!=INVALID_MOVE ) ret += formatRet(ret,2, 1,m3);
-      if( m4!=INVALID_MOVE ) ret += formatRet(ret,2, 2,m4);
-      if( m5!=INVALID_MOVE ) ret += formatRet(ret,2,-1,m5);
-      }
-
-    return formatL("{" + ret + "}");
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private static String formatRet(String str, int row, int angle, int id)
-    {
-    String ret = str.length()!=0 ? ",":"";
-
-    ret += row;
-    ret += angle<0 ? "," : ", ";
-    ret += angle;
-
-         if( id< 10 ) ret += (",  "+id);
-    else if( id<100 ) ret += (", " +id);
-    else              ret += (","  +id);
-
-    return ret;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private static final int LENGTH = 28;
-
-  private static String formatL(String input)
-    {
-    int len = input.length();
-    String ret = input;
-    for(int i=0 ;i<LENGTH-len; i++) ret += " ";
-    return ret;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private int getID()
-    {
-    return mID;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private void setID(int id)
-    {
-    mID = id;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private int getMove(int index)
-    {
-    return (index>=0 && index<12) ? mMoves[index] : -1;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private int numAxis()
-    {
-    int num = 0;
-
-    if( mMoves[ 0]!=INVALID_MOVE || mMoves[ 1]!=INVALID_MOVE || mMoves[ 2]!=INVALID_MOVE ) num++;
-    if( mMoves[ 3]!=INVALID_MOVE || mMoves[ 4]!=INVALID_MOVE || mMoves[ 5]!=INVALID_MOVE ) num++;
-    if( mMoves[ 6]!=INVALID_MOVE || mMoves[ 7]!=INVALID_MOVE || mMoves[ 8]!=INVALID_MOVE ) num++;
-    if( mMoves[ 9]!=INVALID_MOVE || mMoves[10]!=INVALID_MOVE || mMoves[11]!=INVALID_MOVE ) num++;
-
-    return num;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private void setMove(int index, int newMove)
-    {
-    if( index>=0 && index<12 ) mMoves[index] = newMove;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private static String debug(int id)
-    {
-    int ce0 = getCenter(id,0);
-    int ce1 = getCenter(id,1);
-    int ce2 = getCenter(id,2);
-    int ce3 = getCenter(id,3);
-
-    int co0 = getCorner(id,0);
-    int co1 = getCorner(id,1);
-    int co2 = getCorner(id,2);
-    int co3 = getCorner(id,3);
-    int co4 = getCorner(id,4);
-    int co5 = getCorner(id,5);
-    int co6 = getCorner(id,6);
-    int co7 = getCorner(id,7);
-
-    String center = centerString(ce0) + centerString(ce1) + centerString(ce2) + centerString(ce3);
-    String corner = cornerString(co0) + cornerString(co1) + cornerString(co2) + cornerString(co3) +
-                    cornerString(co4) + cornerString(co5) + cornerString(co6) + cornerString(co7);
-
-    return center + " -" + corner;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private static String centerString(int center)
-    {
-    return " "+center;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private static String cornerString(int corner)
-    {
-    switch(corner)
-      {
-      case CORNER_S: return " S";
-      case CORNER_X: return " X";
-      case CORNER_Y: return " Y";
-      case CORNER_Z: return " Z";
-      }
-
-    return "?";
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private static int[] createMoves(int id)
-    {
-    int[] ret = new int[12];
-
-    boolean moveX  = xPossible(id);
-    boolean moveY  = yPossible(id);
-    boolean moveZ0 = z0Possible(id);
-    boolean moveZ2 = z2Possible(id);
-
-    if( moveX ) createXmoves(id,ret);
-    else        { ret[ 0] = INVALID_MOVE; ret[ 1] = INVALID_MOVE; ret[ 2] = INVALID_MOVE; }
-    if( moveY ) createYmoves(id,ret);
-    else        { ret[ 3] = INVALID_MOVE; ret[ 4] = INVALID_MOVE; ret[ 5] = INVALID_MOVE; }
-    if( moveZ0) createZ0moves(id,ret);
-    else        { ret[ 6] = INVALID_MOVE; ret[ 7] = INVALID_MOVE; ret[ 8] = INVALID_MOVE; }
-    if( moveZ2) createZ2moves(id,ret);
-    else        { ret[ 9] = INVALID_MOVE; ret[10] = INVALID_MOVE; ret[11] = INVALID_MOVE; }
-
-    return ret;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private static boolean xPossible(int id)
-    {
-    if( getCorner(id,4)==CORNER_X ) return false;
-    if( getCorner(id,5)==CORNER_X ) return false;
-    if( getCorner(id,6)==CORNER_X ) return false;
-    if( getCorner(id,7)==CORNER_X ) return false;
-
-    if( getCenter(id,1)==CENTER_1 ) return false;
-    if( getCenter(id,2)==CENTER_1 ) return false;
-    if( getCenter(id,3)==CENTER_1 ) return false;
-
-    return true;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private static boolean yPossible(int id)
-    {
-    if( getCorner(id,2)==CORNER_Y ) return false;
-    if( getCorner(id,3)==CORNER_Y ) return false;
-    if( getCorner(id,6)==CORNER_Y ) return false;
-    if( getCorner(id,7)==CORNER_Y ) return false;
-
-    if( getCenter(id,0)==CENTER_0 ) return false;
-    if( getCenter(id,2)==CENTER_0 ) return false;
-    if( getCenter(id,3)==CENTER_0 ) return false;
-
-    return true;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private static boolean z0Possible(int id)
-    {
-    if( getCorner(id,0)==CORNER_Z ) return false;
-    if( getCorner(id,2)==CORNER_Z ) return false;
-    if( getCorner(id,4)==CORNER_Z ) return false;
-    if( getCorner(id,6)==CORNER_Z ) return false;
-
-    if( getCenter(id,0)==CENTER_1 ) return false;
-    if( getCenter(id,1)==CENTER_0 ) return false;
-
-    return true;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private static boolean z2Possible(int id)
-    {
-    if( getCorner(id,1)==CORNER_Z ) return false;
-    if( getCorner(id,3)==CORNER_Z ) return false;
-    if( getCorner(id,5)==CORNER_Z ) return false;
-    if( getCorner(id,7)==CORNER_Z ) return false;
-
-    if( getCenter(id,0)==CENTER_3 ) return false;
-    if( getCenter(id,1)==CENTER_2 ) return false;
-
-    return true;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private static int getCorner(int id, int index)
-    {
-    return (id>>(14-2*index))&3;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private static int getCenter(int id, int index)
-    {
-    return (id>>(22-2*index))&3;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private static int setCorner(int id, int corner, int index)
-    {
-    return id + ((corner-getCorner(id,index))<<(14-2*index));
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private static int setCenter(int id, int center, int index)
-    {
-    return id + ((center-getCenter(id,index))<<(22-2*index));
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private static void createXmoves(int id, int[] moves)
-    {
-    int id1 = rotateX(id);
-    moves[0] = id1;
-    int id2 = rotateX(id1);
-    moves[1] = id2;
-    int id3 = rotateX(id2);
-    moves[2] = id3;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private static void createYmoves(int id, int[] moves)
-    {
-    int id1 = rotateY(id);
-    moves[3] = id1;
-    int id2 = rotateY(id1);
-    moves[4] = id2;
-    int id3 = rotateY(id2);
-    moves[5] = id3;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private static void createZ0moves(int id, int[] moves)
-    {
-    int id1 = rotateZ0(id);
-    moves[6] = id1;
-    int id2 = rotateZ0(id1);
-    moves[7] = id2;
-    int id3 = rotateZ0(id2);
-    moves[8] = id3;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private static void createZ2moves(int id, int[] moves)
-    {
-    int id1 = rotateZ2(id);
-    moves[ 9] = id1;
-    int id2 = rotateZ2(id1);
-    moves[10] = id2;
-    int id3 = rotateZ2(id2);
-    moves[11] = id3;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private static int rotateX(int id)
-    {
-    int newCorner4 = rotCornerX(getCorner(id,5));
-    int newCorner5 = rotCornerX(getCorner(id,7));
-    int newCorner6 = rotCornerX(getCorner(id,4));
-    int newCorner7 = rotCornerX(getCorner(id,6));
-    int newCenter  = rotCenter (getCenter(id,0));
-
-    int id1 = setCorner(id ,newCorner4,4);
-    int id2 = setCorner(id1,newCorner5,5);
-    int id3 = setCorner(id2,newCorner6,6);
-    int id4 = setCorner(id3,newCorner7,7);
-    int id5 = setCenter(id4,newCenter ,0);
-
-    return id5;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private static int rotateY(int id)
-    {
-    int newCorner2 = rotCornerY(getCorner(id,6));
-    int newCorner3 = rotCornerY(getCorner(id,2));
-    int newCorner6 = rotCornerY(getCorner(id,7));
-    int newCorner7 = rotCornerY(getCorner(id,3));
-    int newCenter  = rotCenter (getCenter(id,1));
-
-    int id1 = setCorner(id ,newCorner2,2);
-    int id2 = setCorner(id1,newCorner3,3);
-    int id3 = setCorner(id2,newCorner6,6);
-    int id4 = setCorner(id3,newCorner7,7);
-    int id5 = setCenter(id4,newCenter ,1);
-
-    return id5;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private static int rotateZ0(int id)
-    {
-    int newCorner0 = rotCornerZ(getCorner(id,2));
-    int newCorner2 = rotCornerZ(getCorner(id,6));
-    int newCorner4 = rotCornerZ(getCorner(id,0));
-    int newCorner6 = rotCornerZ(getCorner(id,4));
-    int newCenter  = rotCenter (getCenter(id,2));
-
-    int id1 = setCorner(id ,newCorner0,0);
-    int id2 = setCorner(id1,newCorner2,2);
-    int id3 = setCorner(id2,newCorner4,4);
-    int id4 = setCorner(id3,newCorner6,6);
-    int id5 = setCenter(id4,newCenter ,2);
-
-    return id5;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private static int rotateZ2(int id)
-    {
-    int newCorner1 = rotCornerZ(getCorner(id,3));
-    int newCorner3 = rotCornerZ(getCorner(id,7));
-    int newCorner5 = rotCornerZ(getCorner(id,1));
-    int newCorner7 = rotCornerZ(getCorner(id,5));
-    int newCenter  = rotCenter (getCenter(id,3));
-
-    int id1 = setCorner(id ,newCorner1,1);
-    int id2 = setCorner(id1,newCorner3,3);
-    int id3 = setCorner(id2,newCorner5,5);
-    int id4 = setCorner(id3,newCorner7,7);
-    int id5 = setCenter(id4,newCenter ,3);
-
-    return id5;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private static int rotCornerX(int corner)
-    {
-    switch(corner)
-      {
-      case CORNER_S: return CORNER_S;
-      case CORNER_X: android.util.Log.e("DIST", "rotateX: ERROR");
-                     return CORNER_S;
-      case CORNER_Y: return CORNER_Z;
-      case CORNER_Z: return CORNER_Y;
-      }
-
-    return CORNER_S;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private static int rotCornerY(int corner)
-    {
-    switch(corner)
-      {
-      case CORNER_S: return CORNER_S;
-      case CORNER_X: return CORNER_Z;
-      case CORNER_Y: android.util.Log.e("DIST", "rotateY: ERROR");
-                     return CORNER_S;
-      case CORNER_Z: return CORNER_X;
-      }
-
-    return CORNER_S;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private static int rotCornerZ(int corner)
-    {
-    switch(corner)
-      {
-      case CORNER_S: return CORNER_S;
-      case CORNER_X: return CORNER_Y;
-      case CORNER_Y: return CORNER_X;
-      case CORNER_Z: android.util.Log.e("DIST", "rotateZ: ERROR");
-                     return CORNER_S;
-      }
-
-    return CORNER_S;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  private static int rotCenter(int center)
-    {
-    switch(center)
-      {
-      case CENTER_0: return CENTER_3;
-      case CENTER_1: return CENTER_0;
-      case CENTER_2: return CENTER_1;
-      case CENTER_3: return CENTER_2;
-      }
-
-    return CENTER_0;
-    }
-}
diff --git a/src/main/java/org/distorted/objects/TwistyBandaged2Bar.java b/src/main/java/org/distorted/objects/TwistyBandaged2Bar.java
index b198def0..73b1de3c 100644
--- a/src/main/java/org/distorted/objects/TwistyBandaged2Bar.java
+++ b/src/main/java/org/distorted/objects/TwistyBandaged2Bar.java
@@ -21,7 +21,7 @@ package org.distorted.objects;
 
 import android.content.res.Resources;
 
-import org.distorted.helpers.ScrambleStateGraph;
+import org.distorted.helpers.ScrambleState;
 import org.distorted.library.main.DistortedEffects;
 import org.distorted.library.main.DistortedTexture;
 import org.distorted.library.mesh.MeshSquare;
@@ -67,11 +67,11 @@ class TwistyBandaged2Bar extends TwistyBandagedAbstract
     {
     super(size, quat, texture, mesh, effects, moves, ObjectList.BAN2, res, scrWidth);
 
-    mStates = new ScrambleStateGraph[]
+    mStates = new ScrambleState[]
       {
-      new ScrambleStateGraph( new int[][] { {}                                          , {0,1,1, 0,-1,1, 2,1,2, 2,-1,2}, {} }),
-      new ScrambleStateGraph( new int[][] { {0,-1,1, 0,1,1, 0,2,1, 2,-1,1, 2,1,1, 2,2,1}, {0,2,1, 2,2,1}                , {} }),
-      new ScrambleStateGraph( new int[][] { {}, {0,2,2, 2,2,2}                , {0,-1,2, 0,1,2, 0,2,2, 2,-1,2, 2,1,2, 2,2,2} })
+      new ScrambleState( new int[][] { {}                                          , {0,1,1, 0,-1,1, 2,1,2, 2,-1,2}, {} }),
+      new ScrambleState( new int[][] { {0,-1,1, 0,1,1, 0,2,1, 2,-1,1, 2,1,1, 2,2,1}, {0,2,1, 2,2,1}                , {} }),
+      new ScrambleState( new int[][] { {}, {0,2,2, 2,2,2}                , {0,-1,2, 0,1,2, 0,2,2, 2,-1,2, 2,1,2, 2,2,2} })
       };
     }
 
diff --git a/src/main/java/org/distorted/objects/TwistyBandaged3Plate.java b/src/main/java/org/distorted/objects/TwistyBandaged3Plate.java
index 5e5597e1..79c020d7 100644
--- a/src/main/java/org/distorted/objects/TwistyBandaged3Plate.java
+++ b/src/main/java/org/distorted/objects/TwistyBandaged3Plate.java
@@ -25,7 +25,7 @@ import org.distorted.library.main.DistortedEffects;
 import org.distorted.library.main.DistortedTexture;
 import org.distorted.library.mesh.MeshSquare;
 import org.distorted.library.type.Static4D;
-import org.distorted.helpers.ScrambleStateGraph;
+import org.distorted.helpers.ScrambleState;
 import org.distorted.main.R;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -62,24 +62,24 @@ class TwistyBandaged3Plate extends TwistyBandagedAbstract
     {
     super(size, quat, texture, mesh, effects, moves, ObjectList.BAN3, res, scrWidth);
 
-    mStates = new ScrambleStateGraph[]
+    mStates = new ScrambleState[]
     {
-    new ScrambleStateGraph( new int[][] {{ 2,-1, 1, 2, 1, 6                  }, { 0,-1, 5, 0, 1, 3                  }, { 2,-1, 2, 2, 1, 4                  }} ),
-    new ScrambleStateGraph( new int[][] {{ 2, 1, 0                           }, {                                   }, { 2, 1,10, 2, 2, 7                  }} ),
-    new ScrambleStateGraph( new int[][] {{                                   }, { 0,-1,11, 0, 2, 8                  }, { 2, 1, 0                           }} ),
-    new ScrambleStateGraph( new int[][] {{ 2, 1,12, 2, 2, 9                  }, { 0,-1, 0                           }, {                                   }} ),
-    new ScrambleStateGraph( new int[][] {{ 2,-1,10, 2, 2,13                  }, {                                   }, { 2,-1, 0                           }} ),
-    new ScrambleStateGraph( new int[][] {{                                   }, { 0, 1, 0                           }, { 2,-1,11, 2, 2,14                  }} ),
-    new ScrambleStateGraph( new int[][] {{ 2,-1, 0                           }, { 0, 1,12, 0, 2,15                  }, {                                   }} ),
-    new ScrambleStateGraph( new int[][] {{                                   }, { 2,-2, 7, 2,-1, 7, 2, 1, 7, 2, 2, 7}, { 2,-1,10, 2, 2, 1                  }} ),
-    new ScrambleStateGraph( new int[][] {{ 0,-2, 8, 0,-1, 8, 0, 1, 8, 0, 2, 8}, { 0, 1,11, 0, 2, 2                  }, {                                   }} ),
-    new ScrambleStateGraph( new int[][] {{ 2,-1,12, 2, 2, 3                  }, {                                   }, { 0,-2, 9, 0,-1, 9, 0, 1, 9, 0, 2, 9}} ),
-    new ScrambleStateGraph( new int[][] {{ 2,-1,13, 2, 1, 4                  }, { 2,-2,10, 2,-1,10, 2, 1,10, 2, 2,10}, { 2,-1, 1, 2, 1, 7                  }} ),
-    new ScrambleStateGraph( new int[][] {{ 0,-2,11, 0,-1,11, 0, 1,11, 0, 2,11}, { 0,-1, 8, 0, 1, 2                  }, { 2,-1,14, 2, 1, 5                  }} ),
-    new ScrambleStateGraph( new int[][] {{ 2,-1, 3, 2, 1, 9                  }, { 0,-1, 6, 0, 1,15                  }, { 0,-2,12, 0,-1,12, 0, 1,12, 0, 2,12}} ),
-    new ScrambleStateGraph( new int[][] {{ 2, 1,10, 2, 2, 4                  }, { 2,-2,13, 2,-1,13, 2, 1,13, 2, 2,13}, {                                   }} ),
-    new ScrambleStateGraph( new int[][] {{ 0,-2,14, 0,-1,14, 0, 1,14, 0, 2,14}, {                                   }, { 2, 1,11, 2, 2, 5                  }} ),
-    new ScrambleStateGraph( new int[][] {{                                   }, { 0,-1,12, 0, 2, 6                  }, { 0,-2,15, 0,-1,15, 0, 1,15, 0, 2,15}} )
+    new ScrambleState( new int[][] {{ 2,-1, 1, 2, 1, 6                  }, { 0,-1, 5, 0, 1, 3                  }, { 2,-1, 2, 2, 1, 4                  }} ),
+    new ScrambleState( new int[][] {{ 2, 1, 0                           }, {                                   }, { 2, 1,10, 2, 2, 7                  }} ),
+    new ScrambleState( new int[][] {{                                   }, { 0,-1,11, 0, 2, 8                  }, { 2, 1, 0                           }} ),
+    new ScrambleState( new int[][] {{ 2, 1,12, 2, 2, 9                  }, { 0,-1, 0                           }, {                                   }} ),
+    new ScrambleState( new int[][] {{ 2,-1,10, 2, 2,13                  }, {                                   }, { 2,-1, 0                           }} ),
+    new ScrambleState( new int[][] {{                                   }, { 0, 1, 0                           }, { 2,-1,11, 2, 2,14                  }} ),
+    new ScrambleState( new int[][] {{ 2,-1, 0                           }, { 0, 1,12, 0, 2,15                  }, {                                   }} ),
+    new ScrambleState( new int[][] {{                                   }, { 2,-2, 7, 2,-1, 7, 2, 1, 7, 2, 2, 7}, { 2,-1,10, 2, 2, 1                  }} ),
+    new ScrambleState( new int[][] {{ 0,-2, 8, 0,-1, 8, 0, 1, 8, 0, 2, 8}, { 0, 1,11, 0, 2, 2                  }, {                                   }} ),
+    new ScrambleState( new int[][] {{ 2,-1,12, 2, 2, 3                  }, {                                   }, { 0,-2, 9, 0,-1, 9, 0, 1, 9, 0, 2, 9}} ),
+    new ScrambleState( new int[][] {{ 2,-1,13, 2, 1, 4                  }, { 2,-2,10, 2,-1,10, 2, 1,10, 2, 2,10}, { 2,-1, 1, 2, 1, 7                  }} ),
+    new ScrambleState( new int[][] {{ 0,-2,11, 0,-1,11, 0, 1,11, 0, 2,11}, { 0,-1, 8, 0, 1, 2                  }, { 2,-1,14, 2, 1, 5                  }} ),
+    new ScrambleState( new int[][] {{ 2,-1, 3, 2, 1, 9                  }, { 0,-1, 6, 0, 1,15                  }, { 0,-2,12, 0,-1,12, 0, 1,12, 0, 2,12}} ),
+    new ScrambleState( new int[][] {{ 2, 1,10, 2, 2, 4                  }, { 2,-2,13, 2,-1,13, 2, 1,13, 2, 2,13}, {                                   }} ),
+    new ScrambleState( new int[][] {{ 0,-2,14, 0,-1,14, 0, 1,14, 0, 2,14}, {                                   }, { 2, 1,11, 2, 2, 5                  }} ),
+    new ScrambleState( new int[][] {{                                   }, { 0,-1,12, 0, 2, 6                  }, { 0,-2,15, 0,-1,15, 0, 1,15, 0, 2,15}} )
     };
     }
 
diff --git a/src/main/java/org/distorted/objects/TwistyBandagedAbstract.java b/src/main/java/org/distorted/objects/TwistyBandagedAbstract.java
index aec7fa9f..d68d4084 100644
--- a/src/main/java/org/distorted/objects/TwistyBandagedAbstract.java
+++ b/src/main/java/org/distorted/objects/TwistyBandagedAbstract.java
@@ -23,7 +23,7 @@ import android.content.res.Resources;
 
 import org.distorted.helpers.ObjectShape;
 import org.distorted.helpers.ObjectSticker;
-import org.distorted.helpers.ScrambleStateGraph;
+import org.distorted.helpers.ScrambleState;
 import org.distorted.library.main.DistortedEffects;
 import org.distorted.library.main.DistortedTexture;
 import org.distorted.library.mesh.MeshSquare;
@@ -153,7 +153,7 @@ abstract class TwistyBandagedAbstract extends TwistyObject
 
   private int mCurrState;
   private int mIndexExcluded;
-  ScrambleStateGraph[] mStates;
+  ScrambleState[] mStates;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
diff --git a/src/main/java/org/distorted/objects/TwistyBandagedEvil.java b/src/main/java/org/distorted/objects/TwistyBandagedEvil.java
index b762584f..ae2aac3a 100644
--- a/src/main/java/org/distorted/objects/TwistyBandagedEvil.java
+++ b/src/main/java/org/distorted/objects/TwistyBandagedEvil.java
@@ -21,7 +21,7 @@ package org.distorted.objects;
 
 import android.content.res.Resources;
 
-import org.distorted.helpers.ScrambleStateGraph;
+import org.distorted.helpers.ScrambleState;
 import org.distorted.library.main.DistortedEffects;
 import org.distorted.library.main.DistortedTexture;
 import org.distorted.library.mesh.MeshSquare;
@@ -59,152 +59,152 @@ class TwistyBandagedEvil extends TwistyBandagedAbstract
     {
     super(size, quat, texture, mesh, effects, moves, ObjectList.BAN4, res, scrWidth);
 
-    mStates = new ScrambleStateGraph[]
+    mStates = new ScrambleState[]
      {
-     new ScrambleStateGraph( new int[][] {{2, 1,  1,2,-1,  2}         , {2, 2,142,2,-1, 28}         , {0, 1,114}          }),   //0
-     new ScrambleStateGraph( new int[][] {{2, 2,  2}                  , {2,-1,143}                  , {}                  }),
-     new ScrambleStateGraph( new int[][] {{2, 2,  1}                  , {}                          , {0, 1,  3,0, 2, 47} }),
-     new ScrambleStateGraph( new int[][] {{2, 1,  4}                  , {2, 1,132,2,-1,131}         , {0, 1, 47,0,-1,  2} }),
-     new ScrambleStateGraph( new int[][] {{2,-1,  3}                  , {2, 1,  5,2,-1,  6}         , {}                  }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 2,  6,2,-1,  4}         , {0, 1, 51}          }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 1,  4,2, 2,  5}         , {2, 2,  7,2,-1, 80} }),
-     new ScrambleStateGraph( new int[][] {{2, 2,  8}                  , {}                          , {2, 1, 80,2, 2,  6} }),
-     new ScrambleStateGraph( new int[][] {{2, 2,  7}                  , {}                          , {0,-1,  9}          }),
-     new ScrambleStateGraph( new int[][] {{2, 1, 10,2, 2, 11,2,-1, 12}, {}                          , {0, 1,  8}          }),
-     new ScrambleStateGraph( new int[][] {{2, 1, 11,2, 2, 12,2,-1,  9}, {}                          , {0,-1,118}          }),   //10
-     new ScrambleStateGraph( new int[][] {{2, 1, 12,2, 2,  9,2,-1, 10}, {}                          , {2, 1, 77}          }),
-     new ScrambleStateGraph( new int[][] {{2, 1,  9,2, 2, 10,2,-1, 11}, {}                          , {2, 1, 13,2, 2,143} }),
-     new ScrambleStateGraph( new int[][] {{2, 1, 14,2, 2, 15,2,-1, 16}, {2, 1, 57,2,-1, 58}         , {2, 1,143,2,-1, 12} }),
-     new ScrambleStateGraph( new int[][] {{2, 1, 15,2, 2, 16,2,-1, 13}, {}                          , {2, 1, 41}          }),
-     new ScrambleStateGraph( new int[][] {{2, 1, 16,2, 2, 13,2,-1, 14}, {}                          , {0, 1, 82}          }),
-     new ScrambleStateGraph( new int[][] {{2, 1, 13,2, 2, 14,2,-1, 15}, {2, 1, 17,2,-1, 18}         , {0, 1,111,0,-1,115} }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 2, 18,2,-1, 16}         , {0,-1,139}          }),
-     new ScrambleStateGraph( new int[][] {{2, 1, 19,2,-1, 20}         , {2, 1, 16,2, 2, 17}         , {2, 1,142}          }),
-     new ScrambleStateGraph( new int[][] {{2, 2, 20,2,-1, 18}         , {}                          , {2, 1, 39,2, 2,140} }),
-     new ScrambleStateGraph( new int[][] {{2, 1, 18,2, 2, 19}         , {2, 1, 21}                  , {}                  }),   //20
-     new ScrambleStateGraph( new int[][] {{}                          , {2,-1, 20}                  , {0,-1, 22}          }),
-     new ScrambleStateGraph( new int[][] {{2, 2, 23,2,-1, 24}         , {}                          , {0, 1, 21}          }),
-     new ScrambleStateGraph( new int[][] {{2, 1, 24,2, 2, 22}         , {}                          , {2, 1, 92}          }),
-     new ScrambleStateGraph( new int[][] {{2, 1, 22,2,-1, 23}         , {}                          , {0, 1, 25}          }),
-     new ScrambleStateGraph( new int[][] {{2, 1, 26,2, 2, 27}         , {}                          , {0,-1, 24}          }),
-     new ScrambleStateGraph( new int[][] {{2, 1, 27,2,-1, 25}         , {2, 1, 74}                  , {}                  }),
-     new ScrambleStateGraph( new int[][] {{2, 2, 25,2,-1, 26}         , {}                          , {2, 1, 28,2, 2,124} }),
-     new ScrambleStateGraph( new int[][] {{2, 1, 29,2, 2, 30,2,-1, 31}, {2,-1,142}                  , {2, 1,124,2,-1, 27} }),
-     new ScrambleStateGraph( new int[][] {{2, 1, 30,2, 2, 31,2,-1, 28}, {}                          , {2, 1,141}          }),
-     new ScrambleStateGraph( new int[][] {{2, 1, 31,2, 2, 28,2,-1, 29}, {}                          , {0, 1,130}          }),   //30
-     new ScrambleStateGraph( new int[][] {{2, 1, 28,2, 2, 29,2,-1, 30}, {2, 1, 32,2,-1, 33}         , {0, 1, 89,0,-1, 90} }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 2, 33,2,-1, 31}         , {0,-1,137}          }),
-     new ScrambleStateGraph( new int[][] {{2, 1, 34}                  , {2, 1, 31,2, 2, 32}         , {}                  }),
-     new ScrambleStateGraph( new int[][] {{2,-1, 33}                  , {}                          , {2, 1, 35}          }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2,-1, 36}                  , {2,-1, 34}          }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 35}                  , {2,-1, 37}          }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 38,2, 2, 93}         , {2, 1, 36}          }),
-     new ScrambleStateGraph( new int[][] {{2, 1, 39}                  , {2, 1, 93,2,-1, 37}         , {}                  }),
-     new ScrambleStateGraph( new int[][] {{2,-1, 38}                  , {2, 1, 40,2,-1, 64}         , {2, 1,140,2,-1, 19} }),
-     new ScrambleStateGraph( new int[][] {{2, 1, 41,2,-1, 42}         , {2, 2, 64,2,-1, 39}         , {}                  }),   //40
-     new ScrambleStateGraph( new int[][] {{2, 2, 42,2,-1, 40}         , {}                          , {2,-1, 14}          }),
-     new ScrambleStateGraph( new int[][] {{2, 1, 40,2, 2, 41}         , {}                          , {0, 1, 43,0, 2,128} }),
-     new ScrambleStateGraph( new int[][] {{2, 1, 44,2,-1, 45}         , {2, 1,114,2, 2,113,2,-1, 86}, {0, 1,128,0,-1, 42} }),
-     new ScrambleStateGraph( new int[][] {{2, 2, 45,2,-1, 43}         , {2, 1, 48,2,-1,108}         , {2,-1, 81}          }),
-     new ScrambleStateGraph( new int[][] {{2, 1, 43,2, 2, 44}         , {}                          , {0, 1, 46}          }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 47}                  , {0,-1, 45}          }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2,-1, 46}                  , {0, 2,  2,0,-1,  3} }),
-     new ScrambleStateGraph( new int[][] {{2,-1, 49}                  , {2, 2,108,2,-1, 44}         , {}                  }),
-     new ScrambleStateGraph( new int[][] {{2, 1, 48}                  , {}                          , {0, 1, 50}          }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 51,2, 2, 52}         , {0,-1, 49}          }),   //50
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 52,2,-1, 50}         , {0,-1,  5}          }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 2, 50,2,-1, 51}         , {2,-1, 53}          }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 54,2, 2, 55}         , {2, 1, 52}          }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 55,2,-1, 53}         , {0,-1,104}          }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 2, 53,2,-1, 54}         , {0, 2, 56,0,-1, 65} }),
-     new ScrambleStateGraph( new int[][] {{2, 1, 57}                  , {}                          , {0, 1, 65,0, 2, 55} }),
-     new ScrambleStateGraph( new int[][] {{2,-1, 56}                  , {2, 2, 58,2,-1, 13}         , {}                  }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 13,2, 2, 57}         , {2,-1, 59}          }),
-     new ScrambleStateGraph( new int[][] {{2, 1, 60}                  , {}                          , {2, 1, 58}          }),
-     new ScrambleStateGraph( new int[][] {{2,-1, 59}                  , {}                          , {2, 1, 61}          }),   //60
-     new ScrambleStateGraph( new int[][] {{2,-1, 62}                  , {}                          , {2,-1, 60}          }),
-     new ScrambleStateGraph( new int[][] {{2, 1, 61}                  , {2,-1, 63}                  , {}                  }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 62}                  , {2, 1, 64}          }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 39,2, 2, 40}         , {2,-1, 63}          }),
-     new ScrambleStateGraph( new int[][] {{2, 1, 66,2,-1, 67}         , {2, 1, 78,2, 2, 79,2,-1, 80}, {0, 1, 55,0,-1, 56} }),
-     new ScrambleStateGraph( new int[][] {{2, 2, 67,2,-1, 65}         , {2,-1,107}                  , {}                  }),
-     new ScrambleStateGraph( new int[][] {{2, 1, 65,2, 2, 66}         , {}                          , {0, 1, 68}          }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 69}                  , {0,-1, 67}          }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2,-1, 68}                  , {0,-1, 70}          }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2,-1, 71}                  , {0, 1, 69}          }),   //70
-     new ScrambleStateGraph( new int[][] {{2,-1, 72}                  , {2, 1, 70}                  , {}                  }),
-     new ScrambleStateGraph( new int[][] {{2, 1, 71}                  , {}                          , {0,-1, 73}          }),
-     new ScrambleStateGraph( new int[][] {{2, 1, 74,2, 2, 75}         , {}                          , {0, 1, 72}          }),
-     new ScrambleStateGraph( new int[][] {{2, 1, 75,2,-1, 73}         , {2,-1, 26}                  , {0, 1, 83,0,-1,138} }),
-     new ScrambleStateGraph( new int[][] {{2, 2, 73,2,-1, 74}         , {2, 1, 76,2,-1, 77}         , {}                  }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 2, 77,2,-1, 75}         , {0, 1, 78}          }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 75,2, 2, 76}         , {2,-1, 11}          }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 79,2, 2, 80,2,-1, 65}, {0,-1, 76}          }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 80,2, 2, 65,2,-1, 78}, {2,-1,110}          }),
-     new ScrambleStateGraph( new int[][] {{2, 1, 81,2,-1, 82}         , {2, 1, 65,2, 2, 78,2,-1, 79}, {2, 1,  6,2,-1,  7} }),   //80
-     new ScrambleStateGraph( new int[][] {{2, 2, 82,2,-1, 80}         , {}                          , {2, 1, 44}          }),
-     new ScrambleStateGraph( new int[][] {{2, 1, 80,2, 2, 81}         , {2, 1, 83,2,-1, 84}         , {0,-1, 15}          }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 2, 84,2,-1, 82}         , {0, 2,138,0,-1, 74} }),
-     new ScrambleStateGraph( new int[][] {{2, 1, 85}                  , {2, 1, 82,2, 2, 83}         , {}                  }),
-     new ScrambleStateGraph( new int[][] {{2,-1, 84}                  , {}                          , {2, 1, 86,2, 2,119} }),
-     new ScrambleStateGraph( new int[][] {{2, 1, 87,2,-1, 88}         , {2, 1, 43,2, 2,114,2,-1,113}, {2, 1,119,2,-1, 85} }),
-     new ScrambleStateGraph( new int[][] {{2, 2, 88,2,-1, 86}         , {}                          , {2, 1, 94}          }),
-     new ScrambleStateGraph( new int[][] {{2, 1, 86,2, 2, 87}         , {2, 1, 89}                  , {}                  }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2,-1, 88}                  , {0, 2, 90,0,-1, 31} }),
-     new ScrambleStateGraph( new int[][] {{2, 1, 91,2, 2, 92}         , {}                          , {0, 1, 31,0, 2, 89} }),   //90
-     new ScrambleStateGraph( new int[][] {{2, 1, 92,2,-1, 90}         , {}                          , {0, 1, 93}          }),
-     new ScrambleStateGraph( new int[][] {{2, 2, 90,2,-1, 91}         , {}                          , {2,-1, 23}          }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 2, 37,2,-1, 38}         , {0,-1, 91}          }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2,-1, 95}                  , {2,-1, 87}          }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 94}                  , {2,-1, 96}          }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 97}                  , {2, 1, 95}          }),
-     new ScrambleStateGraph( new int[][] {{2, 1, 98}                  , {2,-1, 96}                  , {}                  }),
-     new ScrambleStateGraph( new int[][] {{2,-1, 97}                  , {}                          , {2,-1, 99}          }),
-     new ScrambleStateGraph( new int[][] {{2, 2,100,2,-1,101}         , {}                          , {2, 1, 98}          }),
-     new ScrambleStateGraph( new int[][] {{2, 1,101,2, 2, 99}         , {2, 1,111,2,-1,112}         , {}                  }),   //100
-     new ScrambleStateGraph( new int[][] {{2, 1, 99,2,-1,100}         , {2, 1,102}                  , {2, 1,108,2,-1,109} }),
-     new ScrambleStateGraph( new int[][] {{2, 1,103,2,-1,104}         , {2,-1,101}                  , {}                  }),
-     new ScrambleStateGraph( new int[][] {{2, 2,104,2,-1,102}         , {}                          , {2,-1,105}          }),
-     new ScrambleStateGraph( new int[][] {{2, 1,102,2, 2,103}         , {}                          , {0, 1, 54}          }),
-     new ScrambleStateGraph( new int[][] {{2,-1,106}                  , {}                          , {2, 1,103}          }),
-     new ScrambleStateGraph( new int[][] {{2, 1,105}                  , {}                          , {2, 1,107}          }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 66}                  , {2,-1,106}          }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 44,2, 2, 48}         , {2, 2,109,2,-1,101} }),
-     new ScrambleStateGraph( new int[][] {{2,-1,110}                  , {}                          , {2, 1,101,2, 2,108} }),
-     new ScrambleStateGraph( new int[][] {{2, 1,109}                  , {}                          , {2, 1, 79}          }),   //110
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 2,112,2,-1,100}         , {0, 2,115,0,-1, 16} }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 1,100,2, 2,111}         , {2, 1,113}          }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 86,2, 2, 43,2,-1,114}, {2,-1,112}          }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 1,113,2, 2, 86,2,-1, 43}, {0,-1,  0}          }),
-     new ScrambleStateGraph( new int[][] {{2, 2,116}                  , {}                          , {0, 1, 16,0, 2,111} }),
-     new ScrambleStateGraph( new int[][] {{2, 2,115}                  , {}                          , {2,-1,117}          }),
-     new ScrambleStateGraph( new int[][] {{2, 1,118}                  , {}                          , {2, 1,116}          }),
-     new ScrambleStateGraph( new int[][] {{2,-1,117}                  , {}                          , {0, 1, 10}          }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 1,120,2, 2,121,2,-1,122}, {2, 2, 85,2,-1, 86} }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 1,121,2, 2,122,2,-1,119}, {2,-1,129}          }),   //120
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 1,122,2, 2,119,2,-1,120}, {0, 1,125}          }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 1,119,2, 2,120,2,-1,121}, {0,-1,123}          }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 2,124}                  , {0, 1,122}          }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 2,123}                  , {2, 2, 27,2,-1, 28} }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 1,126}                  , {0,-1,121}          }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2,-1,125}                  , {2,-1,127}          }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 2,128}                  , {2, 1,126}          }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 2,127}                  , {0, 2, 42,0,-1, 43} }),
-     new ScrambleStateGraph( new int[][] {{2, 2,130,2,-1,131}         , {}                          , {2, 1,120}          }),
-     new ScrambleStateGraph( new int[][] {{2, 1,131,2, 2,129}         , {}                          , {0,-1, 30}          }),   //130
-     new ScrambleStateGraph( new int[][] {{2, 1,129,2,-1,130}         , {2, 1,  3,2, 2,132}         , {}                  }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 2,131,2,-1,  3}         , {0,-1,133}          }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2,-1,134}                  , {0, 1,132}          }),
-     new ScrambleStateGraph( new int[][] {{2,-1,135}                  , {2, 1,133}                  , {}                  }),
-     new ScrambleStateGraph( new int[][] {{2, 1,134}                  , {}                          , {0,-1,136}          }),
-     new ScrambleStateGraph( new int[][] {{2, 1,137}                  , {}                          , {0, 1,135}          }),
-     new ScrambleStateGraph( new int[][] {{2,-1,136}                  , {}                          , {0, 1, 32}          }),
-     new ScrambleStateGraph( new int[][] {{2, 1,139}                  , {}                          , {0, 1, 74,0, 2, 83} }),
-     new ScrambleStateGraph( new int[][] {{2,-1,138}                  , {}                          , {0, 1, 17}          }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 1,141}                  , {2, 2, 19,2,-1, 39} }),   //140
-     new ScrambleStateGraph( new int[][] {{}                          , {2,-1,140}                  , {2,-1, 29}          }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 28}                  , {2,-1, 18}          }),
-     new ScrambleStateGraph( new int[][] {{}                          , {2, 1,  1}                  , {2, 2, 12,2,-1, 13} })
+     new ScrambleState( new int[][] {{2, 1,  1,2,-1,  2}         , {2, 2,142,2,-1, 28}         , {0, 1,114}          }),   //0
+     new ScrambleState( new int[][] {{2, 2,  2}                  , {2,-1,143}                  , {}                  }),
+     new ScrambleState( new int[][] {{2, 2,  1}                  , {}                          , {0, 1,  3,0, 2, 47} }),
+     new ScrambleState( new int[][] {{2, 1,  4}                  , {2, 1,132,2,-1,131}         , {0, 1, 47,0,-1,  2} }),
+     new ScrambleState( new int[][] {{2,-1,  3}                  , {2, 1,  5,2,-1,  6}         , {}                  }),
+     new ScrambleState( new int[][] {{}                          , {2, 2,  6,2,-1,  4}         , {0, 1, 51}          }),
+     new ScrambleState( new int[][] {{}                          , {2, 1,  4,2, 2,  5}         , {2, 2,  7,2,-1, 80} }),
+     new ScrambleState( new int[][] {{2, 2,  8}                  , {}                          , {2, 1, 80,2, 2,  6} }),
+     new ScrambleState( new int[][] {{2, 2,  7}                  , {}                          , {0,-1,  9}          }),
+     new ScrambleState( new int[][] {{2, 1, 10,2, 2, 11,2,-1, 12}, {}                          , {0, 1,  8}          }),
+     new ScrambleState( new int[][] {{2, 1, 11,2, 2, 12,2,-1,  9}, {}                          , {0,-1,118}          }),   //10
+     new ScrambleState( new int[][] {{2, 1, 12,2, 2,  9,2,-1, 10}, {}                          , {2, 1, 77}          }),
+     new ScrambleState( new int[][] {{2, 1,  9,2, 2, 10,2,-1, 11}, {}                          , {2, 1, 13,2, 2,143} }),
+     new ScrambleState( new int[][] {{2, 1, 14,2, 2, 15,2,-1, 16}, {2, 1, 57,2,-1, 58}         , {2, 1,143,2,-1, 12} }),
+     new ScrambleState( new int[][] {{2, 1, 15,2, 2, 16,2,-1, 13}, {}                          , {2, 1, 41}          }),
+     new ScrambleState( new int[][] {{2, 1, 16,2, 2, 13,2,-1, 14}, {}                          , {0, 1, 82}          }),
+     new ScrambleState( new int[][] {{2, 1, 13,2, 2, 14,2,-1, 15}, {2, 1, 17,2,-1, 18}         , {0, 1,111,0,-1,115} }),
+     new ScrambleState( new int[][] {{}                          , {2, 2, 18,2,-1, 16}         , {0,-1,139}          }),
+     new ScrambleState( new int[][] {{2, 1, 19,2,-1, 20}         , {2, 1, 16,2, 2, 17}         , {2, 1,142}          }),
+     new ScrambleState( new int[][] {{2, 2, 20,2,-1, 18}         , {}                          , {2, 1, 39,2, 2,140} }),
+     new ScrambleState( new int[][] {{2, 1, 18,2, 2, 19}         , {2, 1, 21}                  , {}                  }),   //20
+     new ScrambleState( new int[][] {{}                          , {2,-1, 20}                  , {0,-1, 22}          }),
+     new ScrambleState( new int[][] {{2, 2, 23,2,-1, 24}         , {}                          , {0, 1, 21}          }),
+     new ScrambleState( new int[][] {{2, 1, 24,2, 2, 22}         , {}                          , {2, 1, 92}          }),
+     new ScrambleState( new int[][] {{2, 1, 22,2,-1, 23}         , {}                          , {0, 1, 25}          }),
+     new ScrambleState( new int[][] {{2, 1, 26,2, 2, 27}         , {}                          , {0,-1, 24}          }),
+     new ScrambleState( new int[][] {{2, 1, 27,2,-1, 25}         , {2, 1, 74}                  , {}                  }),
+     new ScrambleState( new int[][] {{2, 2, 25,2,-1, 26}         , {}                          , {2, 1, 28,2, 2,124} }),
+     new ScrambleState( new int[][] {{2, 1, 29,2, 2, 30,2,-1, 31}, {2,-1,142}                  , {2, 1,124,2,-1, 27} }),
+     new ScrambleState( new int[][] {{2, 1, 30,2, 2, 31,2,-1, 28}, {}                          , {2, 1,141}          }),
+     new ScrambleState( new int[][] {{2, 1, 31,2, 2, 28,2,-1, 29}, {}                          , {0, 1,130}          }),   //30
+     new ScrambleState( new int[][] {{2, 1, 28,2, 2, 29,2,-1, 30}, {2, 1, 32,2,-1, 33}         , {0, 1, 89,0,-1, 90} }),
+     new ScrambleState( new int[][] {{}                          , {2, 2, 33,2,-1, 31}         , {0,-1,137}          }),
+     new ScrambleState( new int[][] {{2, 1, 34}                  , {2, 1, 31,2, 2, 32}         , {}                  }),
+     new ScrambleState( new int[][] {{2,-1, 33}                  , {}                          , {2, 1, 35}          }),
+     new ScrambleState( new int[][] {{}                          , {2,-1, 36}                  , {2,-1, 34}          }),
+     new ScrambleState( new int[][] {{}                          , {2, 1, 35}                  , {2,-1, 37}          }),
+     new ScrambleState( new int[][] {{}                          , {2, 1, 38,2, 2, 93}         , {2, 1, 36}          }),
+     new ScrambleState( new int[][] {{2, 1, 39}                  , {2, 1, 93,2,-1, 37}         , {}                  }),
+     new ScrambleState( new int[][] {{2,-1, 38}                  , {2, 1, 40,2,-1, 64}         , {2, 1,140,2,-1, 19} }),
+     new ScrambleState( new int[][] {{2, 1, 41,2,-1, 42}         , {2, 2, 64,2,-1, 39}         , {}                  }),   //40
+     new ScrambleState( new int[][] {{2, 2, 42,2,-1, 40}         , {}                          , {2,-1, 14}          }),
+     new ScrambleState( new int[][] {{2, 1, 40,2, 2, 41}         , {}                          , {0, 1, 43,0, 2,128} }),
+     new ScrambleState( new int[][] {{2, 1, 44,2,-1, 45}         , {2, 1,114,2, 2,113,2,-1, 86}, {0, 1,128,0,-1, 42} }),
+     new ScrambleState( new int[][] {{2, 2, 45,2,-1, 43}         , {2, 1, 48,2,-1,108}         , {2,-1, 81}          }),
+     new ScrambleState( new int[][] {{2, 1, 43,2, 2, 44}         , {}                          , {0, 1, 46}          }),
+     new ScrambleState( new int[][] {{}                          , {2, 1, 47}                  , {0,-1, 45}          }),
+     new ScrambleState( new int[][] {{}                          , {2,-1, 46}                  , {0, 2,  2,0,-1,  3} }),
+     new ScrambleState( new int[][] {{2,-1, 49}                  , {2, 2,108,2,-1, 44}         , {}                  }),
+     new ScrambleState( new int[][] {{2, 1, 48}                  , {}                          , {0, 1, 50}          }),
+     new ScrambleState( new int[][] {{}                          , {2, 1, 51,2, 2, 52}         , {0,-1, 49}          }),   //50
+     new ScrambleState( new int[][] {{}                          , {2, 1, 52,2,-1, 50}         , {0,-1,  5}          }),
+     new ScrambleState( new int[][] {{}                          , {2, 2, 50,2,-1, 51}         , {2,-1, 53}          }),
+     new ScrambleState( new int[][] {{}                          , {2, 1, 54,2, 2, 55}         , {2, 1, 52}          }),
+     new ScrambleState( new int[][] {{}                          , {2, 1, 55,2,-1, 53}         , {0,-1,104}          }),
+     new ScrambleState( new int[][] {{}                          , {2, 2, 53,2,-1, 54}         , {0, 2, 56,0,-1, 65} }),
+     new ScrambleState( new int[][] {{2, 1, 57}                  , {}                          , {0, 1, 65,0, 2, 55} }),
+     new ScrambleState( new int[][] {{2,-1, 56}                  , {2, 2, 58,2,-1, 13}         , {}                  }),
+     new ScrambleState( new int[][] {{}                          , {2, 1, 13,2, 2, 57}         , {2,-1, 59}          }),
+     new ScrambleState( new int[][] {{2, 1, 60}                  , {}                          , {2, 1, 58}          }),
+     new ScrambleState( new int[][] {{2,-1, 59}                  , {}                          , {2, 1, 61}          }),   //60
+     new ScrambleState( new int[][] {{2,-1, 62}                  , {}                          , {2,-1, 60}          }),
+     new ScrambleState( new int[][] {{2, 1, 61}                  , {2,-1, 63}                  , {}                  }),
+     new ScrambleState( new int[][] {{}                          , {2, 1, 62}                  , {2, 1, 64}          }),
+     new ScrambleState( new int[][] {{}                          , {2, 1, 39,2, 2, 40}         , {2,-1, 63}          }),
+     new ScrambleState( new int[][] {{2, 1, 66,2,-1, 67}         , {2, 1, 78,2, 2, 79,2,-1, 80}, {0, 1, 55,0,-1, 56} }),
+     new ScrambleState( new int[][] {{2, 2, 67,2,-1, 65}         , {2,-1,107}                  , {}                  }),
+     new ScrambleState( new int[][] {{2, 1, 65,2, 2, 66}         , {}                          , {0, 1, 68}          }),
+     new ScrambleState( new int[][] {{}                          , {2, 1, 69}                  , {0,-1, 67}          }),
+     new ScrambleState( new int[][] {{}                          , {2,-1, 68}                  , {0,-1, 70}          }),
+     new ScrambleState( new int[][] {{}                          , {2,-1, 71}                  , {0, 1, 69}          }),   //70
+     new ScrambleState( new int[][] {{2,-1, 72}                  , {2, 1, 70}                  , {}                  }),
+     new ScrambleState( new int[][] {{2, 1, 71}                  , {}                          , {0,-1, 73}          }),
+     new ScrambleState( new int[][] {{2, 1, 74,2, 2, 75}         , {}                          , {0, 1, 72}          }),
+     new ScrambleState( new int[][] {{2, 1, 75,2,-1, 73}         , {2,-1, 26}                  , {0, 1, 83,0,-1,138} }),
+     new ScrambleState( new int[][] {{2, 2, 73,2,-1, 74}         , {2, 1, 76,2,-1, 77}         , {}                  }),
+     new ScrambleState( new int[][] {{}                          , {2, 2, 77,2,-1, 75}         , {0, 1, 78}          }),
+     new ScrambleState( new int[][] {{}                          , {2, 1, 75,2, 2, 76}         , {2,-1, 11}          }),
+     new ScrambleState( new int[][] {{}                          , {2, 1, 79,2, 2, 80,2,-1, 65}, {0,-1, 76}          }),
+     new ScrambleState( new int[][] {{}                          , {2, 1, 80,2, 2, 65,2,-1, 78}, {2,-1,110}          }),
+     new ScrambleState( new int[][] {{2, 1, 81,2,-1, 82}         , {2, 1, 65,2, 2, 78,2,-1, 79}, {2, 1,  6,2,-1,  7} }),   //80
+     new ScrambleState( new int[][] {{2, 2, 82,2,-1, 80}         , {}                          , {2, 1, 44}          }),
+     new ScrambleState( new int[][] {{2, 1, 80,2, 2, 81}         , {2, 1, 83,2,-1, 84}         , {0,-1, 15}          }),
+     new ScrambleState( new int[][] {{}                          , {2, 2, 84,2,-1, 82}         , {0, 2,138,0,-1, 74} }),
+     new ScrambleState( new int[][] {{2, 1, 85}                  , {2, 1, 82,2, 2, 83}         , {}                  }),
+     new ScrambleState( new int[][] {{2,-1, 84}                  , {}                          , {2, 1, 86,2, 2,119} }),
+     new ScrambleState( new int[][] {{2, 1, 87,2,-1, 88}         , {2, 1, 43,2, 2,114,2,-1,113}, {2, 1,119,2,-1, 85} }),
+     new ScrambleState( new int[][] {{2, 2, 88,2,-1, 86}         , {}                          , {2, 1, 94}          }),
+     new ScrambleState( new int[][] {{2, 1, 86,2, 2, 87}         , {2, 1, 89}                  , {}                  }),
+     new ScrambleState( new int[][] {{}                          , {2,-1, 88}                  , {0, 2, 90,0,-1, 31} }),
+     new ScrambleState( new int[][] {{2, 1, 91,2, 2, 92}         , {}                          , {0, 1, 31,0, 2, 89} }),   //90
+     new ScrambleState( new int[][] {{2, 1, 92,2,-1, 90}         , {}                          , {0, 1, 93}          }),
+     new ScrambleState( new int[][] {{2, 2, 90,2,-1, 91}         , {}                          , {2,-1, 23}          }),
+     new ScrambleState( new int[][] {{}                          , {2, 2, 37,2,-1, 38}         , {0,-1, 91}          }),
+     new ScrambleState( new int[][] {{}                          , {2,-1, 95}                  , {2,-1, 87}          }),
+     new ScrambleState( new int[][] {{}                          , {2, 1, 94}                  , {2,-1, 96}          }),
+     new ScrambleState( new int[][] {{}                          , {2, 1, 97}                  , {2, 1, 95}          }),
+     new ScrambleState( new int[][] {{2, 1, 98}                  , {2,-1, 96}                  , {}                  }),
+     new ScrambleState( new int[][] {{2,-1, 97}                  , {}                          , {2,-1, 99}          }),
+     new ScrambleState( new int[][] {{2, 2,100,2,-1,101}         , {}                          , {2, 1, 98}          }),
+     new ScrambleState( new int[][] {{2, 1,101,2, 2, 99}         , {2, 1,111,2,-1,112}         , {}                  }),   //100
+     new ScrambleState( new int[][] {{2, 1, 99,2,-1,100}         , {2, 1,102}                  , {2, 1,108,2,-1,109} }),
+     new ScrambleState( new int[][] {{2, 1,103,2,-1,104}         , {2,-1,101}                  , {}                  }),
+     new ScrambleState( new int[][] {{2, 2,104,2,-1,102}         , {}                          , {2,-1,105}          }),
+     new ScrambleState( new int[][] {{2, 1,102,2, 2,103}         , {}                          , {0, 1, 54}          }),
+     new ScrambleState( new int[][] {{2,-1,106}                  , {}                          , {2, 1,103}          }),
+     new ScrambleState( new int[][] {{2, 1,105}                  , {}                          , {2, 1,107}          }),
+     new ScrambleState( new int[][] {{}                          , {2, 1, 66}                  , {2,-1,106}          }),
+     new ScrambleState( new int[][] {{}                          , {2, 1, 44,2, 2, 48}         , {2, 2,109,2,-1,101} }),
+     new ScrambleState( new int[][] {{2,-1,110}                  , {}                          , {2, 1,101,2, 2,108} }),
+     new ScrambleState( new int[][] {{2, 1,109}                  , {}                          , {2, 1, 79}          }),   //110
+     new ScrambleState( new int[][] {{}                          , {2, 2,112,2,-1,100}         , {0, 2,115,0,-1, 16} }),
+     new ScrambleState( new int[][] {{}                          , {2, 1,100,2, 2,111}         , {2, 1,113}          }),
+     new ScrambleState( new int[][] {{}                          , {2, 1, 86,2, 2, 43,2,-1,114}, {2,-1,112}          }),
+     new ScrambleState( new int[][] {{}                          , {2, 1,113,2, 2, 86,2,-1, 43}, {0,-1,  0}          }),
+     new ScrambleState( new int[][] {{2, 2,116}                  , {}                          , {0, 1, 16,0, 2,111} }),
+     new ScrambleState( new int[][] {{2, 2,115}                  , {}                          , {2,-1,117}          }),
+     new ScrambleState( new int[][] {{2, 1,118}                  , {}                          , {2, 1,116}          }),
+     new ScrambleState( new int[][] {{2,-1,117}                  , {}                          , {0, 1, 10}          }),
+     new ScrambleState( new int[][] {{}                          , {2, 1,120,2, 2,121,2,-1,122}, {2, 2, 85,2,-1, 86} }),
+     new ScrambleState( new int[][] {{}                          , {2, 1,121,2, 2,122,2,-1,119}, {2,-1,129}          }),   //120
+     new ScrambleState( new int[][] {{}                          , {2, 1,122,2, 2,119,2,-1,120}, {0, 1,125}          }),
+     new ScrambleState( new int[][] {{}                          , {2, 1,119,2, 2,120,2,-1,121}, {0,-1,123}          }),
+     new ScrambleState( new int[][] {{}                          , {2, 2,124}                  , {0, 1,122}          }),
+     new ScrambleState( new int[][] {{}                          , {2, 2,123}                  , {2, 2, 27,2,-1, 28} }),
+     new ScrambleState( new int[][] {{}                          , {2, 1,126}                  , {0,-1,121}          }),
+     new ScrambleState( new int[][] {{}                          , {2,-1,125}                  , {2,-1,127}          }),
+     new ScrambleState( new int[][] {{}                          , {2, 2,128}                  , {2, 1,126}          }),
+     new ScrambleState( new int[][] {{}                          , {2, 2,127}                  , {0, 2, 42,0,-1, 43} }),
+     new ScrambleState( new int[][] {{2, 2,130,2,-1,131}         , {}                          , {2, 1,120}          }),
+     new ScrambleState( new int[][] {{2, 1,131,2, 2,129}         , {}                          , {0,-1, 30}          }),   //130
+     new ScrambleState( new int[][] {{2, 1,129,2,-1,130}         , {2, 1,  3,2, 2,132}         , {}                  }),
+     new ScrambleState( new int[][] {{}                          , {2, 2,131,2,-1,  3}         , {0,-1,133}          }),
+     new ScrambleState( new int[][] {{}                          , {2,-1,134}                  , {0, 1,132}          }),
+     new ScrambleState( new int[][] {{2,-1,135}                  , {2, 1,133}                  , {}                  }),
+     new ScrambleState( new int[][] {{2, 1,134}                  , {}                          , {0,-1,136}          }),
+     new ScrambleState( new int[][] {{2, 1,137}                  , {}                          , {0, 1,135}          }),
+     new ScrambleState( new int[][] {{2,-1,136}                  , {}                          , {0, 1, 32}          }),
+     new ScrambleState( new int[][] {{2, 1,139}                  , {}                          , {0, 1, 74,0, 2, 83} }),
+     new ScrambleState( new int[][] {{2,-1,138}                  , {}                          , {0, 1, 17}          }),
+     new ScrambleState( new int[][] {{}                          , {2, 1,141}                  , {2, 2, 19,2,-1, 39} }),   //140
+     new ScrambleState( new int[][] {{}                          , {2,-1,140}                  , {2,-1, 29}          }),
+     new ScrambleState( new int[][] {{}                          , {2, 1, 28}                  , {2,-1, 18}          }),
+     new ScrambleState( new int[][] {{}                          , {2, 1,  1}                  , {2, 2, 12,2,-1, 13} })
      };
     }
 
diff --git a/src/main/java/org/distorted/objects/TwistyBandagedFused.java b/src/main/java/org/distorted/objects/TwistyBandagedFused.java
index 3850b8f5..5eb1d63c 100644
--- a/src/main/java/org/distorted/objects/TwistyBandagedFused.java
+++ b/src/main/java/org/distorted/objects/TwistyBandagedFused.java
@@ -21,7 +21,7 @@ package org.distorted.objects;
 
 import android.content.res.Resources;
 
-import org.distorted.helpers.ScrambleStateGraph;
+import org.distorted.helpers.ScrambleState;
 import org.distorted.library.main.DistortedEffects;
 import org.distorted.library.main.DistortedTexture;
 import org.distorted.library.mesh.MeshSquare;
@@ -74,9 +74,9 @@ class TwistyBandagedFused extends TwistyBandagedAbstract
 
     int[] tmp = {0,-1,0, 0,1,0, 0,2,0, 2,-1,0, 2,1,0, 2,2,0};
 
-    mStates = new ScrambleStateGraph[]
+    mStates = new ScrambleState[]
       {
-      new ScrambleStateGraph( new int[][] {tmp,tmp,tmp} )
+      new ScrambleState( new int[][] {tmp,tmp,tmp} )
       };
     }
 
diff --git a/src/main/java/org/distorted/objects/TwistyCube.java b/src/main/java/org/distorted/objects/TwistyCube.java
index ea6d4c41..38fee4b6 100644
--- a/src/main/java/org/distorted/objects/TwistyCube.java
+++ b/src/main/java/org/distorted/objects/TwistyCube.java
@@ -23,7 +23,7 @@ import android.content.res.Resources;
 
 import org.distorted.helpers.ObjectShape;
 import org.distorted.helpers.ObjectSticker;
-import org.distorted.helpers.ScrambleStateGraph;
+import org.distorted.helpers.ScrambleState;
 import org.distorted.library.main.DistortedEffects;
 import org.distorted.library.main.DistortedTexture;
 import org.distorted.library.mesh.MeshSquare;
@@ -131,7 +131,7 @@ class TwistyCube extends TwistyObject
 
   private int mCurrState;
   private int mIndexExcluded;
-  private final ScrambleStateGraph[] mStates;
+  private final ScrambleState[] mStates;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -143,24 +143,24 @@ class TwistyCube extends TwistyObject
     int[][] m = new int[16][];
     for(int i=1; i<16; i++) m[i] = createEdges(size,i);
 
-    mStates = new ScrambleStateGraph[]  // built so that all 3 axes must be present in every 4 consecutive moves
+    mStates = new ScrambleState[]  // built so that all 3 axes must be present in every 4 consecutive moves
       {
-      new ScrambleStateGraph( new int[][] { m[ 1], m[ 2], m[ 3] } ),  // 0
-      new ScrambleStateGraph( new int[][] {  null, m[ 4], m[ 5] } ),  // x
-      new ScrambleStateGraph( new int[][] { m[ 6],  null, m[ 7] } ),  // y
-      new ScrambleStateGraph( new int[][] { m[ 8], m[ 8],  null } ),  // z
-      new ScrambleStateGraph( new int[][] { m[10],  null, m[ 7] } ),  // xy
-      new ScrambleStateGraph( new int[][] { m[11], m[ 9],  null } ),  // xz
-      new ScrambleStateGraph( new int[][] {  null, m[12], m[ 5] } ),  // yx
-      new ScrambleStateGraph( new int[][] { m[ 8], m[13],  null } ),  // yz
-      new ScrambleStateGraph( new int[][] {  null, m[ 4], m[14] } ),  // zx
-      new ScrambleStateGraph( new int[][] { m[ 6],  null, m[15] } ),  // zy
-      new ScrambleStateGraph( new int[][] {  null,  null, m[ 5] } ),  // xyx
-      new ScrambleStateGraph( new int[][] {  null, m[ 4],  null } ),  // xzx
-      new ScrambleStateGraph( new int[][] {  null,  null, m[ 7] } ),  // yxy
-      new ScrambleStateGraph( new int[][] { m[ 6],  null,  null } ),  // yzy
-      new ScrambleStateGraph( new int[][] {  null, m[ 9],  null } ),  // zxz
-      new ScrambleStateGraph( new int[][] { m[ 8],  null,  null } ),  // zyz
+      new ScrambleState( new int[][] { m[ 1], m[ 2], m[ 3] } ),  // 0
+      new ScrambleState( new int[][] {  null, m[ 4], m[ 5] } ),  // x
+      new ScrambleState( new int[][] { m[ 6],  null, m[ 7] } ),  // y
+      new ScrambleState( new int[][] { m[ 8], m[ 8],  null } ),  // z
+      new ScrambleState( new int[][] { m[10],  null, m[ 7] } ),  // xy
+      new ScrambleState( new int[][] { m[11], m[ 9],  null } ),  // xz
+      new ScrambleState( new int[][] {  null, m[12], m[ 5] } ),  // yx
+      new ScrambleState( new int[][] { m[ 8], m[13],  null } ),  // yz
+      new ScrambleState( new int[][] {  null, m[ 4], m[14] } ),  // zx
+      new ScrambleState( new int[][] { m[ 6],  null, m[15] } ),  // zy
+      new ScrambleState( new int[][] {  null,  null, m[ 5] } ),  // xyx
+      new ScrambleState( new int[][] {  null, m[ 4],  null } ),  // xzx
+      new ScrambleState( new int[][] {  null,  null, m[ 7] } ),  // yxy
+      new ScrambleState( new int[][] { m[ 6],  null,  null } ),  // yzy
+      new ScrambleState( new int[][] {  null, m[ 9],  null } ),  // zxz
+      new ScrambleState( new int[][] { m[ 8],  null,  null } ),  // zyz
       };
     }
 
diff --git a/src/main/java/org/distorted/objects/TwistyDiamond.java b/src/main/java/org/distorted/objects/TwistyDiamond.java
index 3d488a1f..4b8376ba 100644
--- a/src/main/java/org/distorted/objects/TwistyDiamond.java
+++ b/src/main/java/org/distorted/objects/TwistyDiamond.java
@@ -23,7 +23,7 @@ import android.content.res.Resources;
 
 import org.distorted.helpers.ObjectShape;
 import org.distorted.helpers.ObjectSticker;
-import org.distorted.helpers.ScrambleStateGraph;
+import org.distorted.helpers.ScrambleState;
 import org.distorted.library.main.DistortedEffects;
 import org.distorted.library.main.DistortedTexture;
 import org.distorted.library.mesh.MeshSquare;
@@ -138,7 +138,7 @@ public class TwistyDiamond extends TwistyObject
 
   private int mCurrState;
   private int mIndexExcluded;
-  private final ScrambleStateGraph[] mStates;
+  private final ScrambleState[] mStates;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -156,9 +156,9 @@ public class TwistyDiamond extends TwistyObject
       tmp[3*i+2] = 0;
       }
 
-    mStates = new ScrambleStateGraph[]
+    mStates = new ScrambleState[]
       {
-      new ScrambleStateGraph( new int[][] {tmp,tmp,tmp,tmp} )
+      new ScrambleState( new int[][] {tmp,tmp,tmp,tmp} )
       };
     }
 
diff --git a/src/main/java/org/distorted/objects/TwistyDino.java b/src/main/java/org/distorted/objects/TwistyDino.java
index b29cd550..4e217dce 100644
--- a/src/main/java/org/distorted/objects/TwistyDino.java
+++ b/src/main/java/org/distorted/objects/TwistyDino.java
@@ -23,7 +23,7 @@ import android.content.res.Resources;
 
 import org.distorted.helpers.ObjectShape;
 import org.distorted.helpers.ObjectSticker;
-import org.distorted.helpers.ScrambleStateGraph;
+import org.distorted.helpers.ScrambleState;
 import org.distorted.library.main.DistortedEffects;
 import org.distorted.library.main.DistortedTexture;
 import org.distorted.library.mesh.MeshSquare;
@@ -122,7 +122,9 @@ public abstract class TwistyDino extends TwistyObject
 
   private int mCurrState;
   private int mIndexExcluded;
-  ScrambleStateGraph[] mStates;
+  ScrambleState[] mStates;
+  private int[][] mScrambleTable;
+  private int[] mNumOccurences;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -237,6 +239,33 @@ public abstract class TwistyDino extends TwistyObject
     return 2.0f;
     }
 
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private void initializeScrambling()
+    {
+    int numLayers = getNumLayers();
+
+    if( mScrambleTable ==null )
+      {
+      mScrambleTable = new int[NUM_AXIS][numLayers];
+      }
+    if( mNumOccurences ==null )
+      {
+      int max=0;
+
+      for (ScrambleState mState : mStates)
+        {
+        int tmp = mState.getTotal(-1);
+        if (max < tmp) max = tmp;
+        }
+
+      mNumOccurences = new int[max];
+      }
+
+    for(int i=0; i<NUM_AXIS; i++)
+      for(int j=0; j<numLayers; j++) mScrambleTable[i][j] = 0;
+    }
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 // PUBLIC API
 
@@ -246,11 +275,10 @@ public abstract class TwistyDino extends TwistyObject
       {
       mCurrState     = 0;
       mIndexExcluded =-1;
+      initializeScrambling();
       }
 
-    int total = mStates[mCurrState].getTotal(mIndexExcluded);
-    int random= rnd.nextInt(total);
-    int[] info= mStates[mCurrState].getInfo(random,mIndexExcluded);
+    int[] info= mStates[mCurrState].getRandom(rnd, mIndexExcluded, mScrambleTable, mNumOccurences);
 
     scramble[curr][0] = info[0];
     scramble[curr][1] = info[1];
diff --git a/src/main/java/org/distorted/objects/TwistyDino4.java b/src/main/java/org/distorted/objects/TwistyDino4.java
index 9114084a..c4a9447f 100644
--- a/src/main/java/org/distorted/objects/TwistyDino4.java
+++ b/src/main/java/org/distorted/objects/TwistyDino4.java
@@ -21,7 +21,7 @@ package org.distorted.objects;
 
 import android.content.res.Resources;
 
-import org.distorted.helpers.ScrambleStateGraph;
+import org.distorted.helpers.ScrambleState;
 import org.distorted.library.main.DistortedEffects;
 import org.distorted.library.main.DistortedTexture;
 import org.distorted.library.mesh.MeshSquare;
@@ -41,17 +41,17 @@ public class TwistyDino4 extends TwistyDino
     {
     super(size, quat, texture, mesh, effects, moves, ObjectList.DIN4, res, scrWidth);
 
-    mStates = new ScrambleStateGraph[]
+    mStates = new ScrambleState[]
       {
-      new ScrambleStateGraph( new int[][] { {              2,1,2,2,-1,2},{0,1,3,0,-1,3              },{0,1,5,0,-1,5              },{              2,1,8,2,-1,8} } ),
-      new ScrambleStateGraph( new int[][] { {                          },{0,1,3,0,-1,3              },{0,1,5,0,-1,5,             },{              2,1,8,2,-1,8} } ),
-      new ScrambleStateGraph( new int[][] { {                          },{              2,1,4,2,-1,4},{              2,1,6,2,-1,6},{0,1,7,0,-1,7              } } ),
-      new ScrambleStateGraph( new int[][] { {0,1,1,0,-1,1              },{                          },{              2,1,6,2,-1,6},{0,1,7,0,-1,7              } } ),
-      new ScrambleStateGraph( new int[][] { {              2,1,2,2,-1,2},{                          },{0,1,5,0,-1,5,             },{              2,1,8,2,-1,8} } ),
-      new ScrambleStateGraph( new int[][] { {0,1,1,0,-1,1              },{              2,1,4,2,-1,4},{                          },{0,1,7,0,-1,7              } } ),
-      new ScrambleStateGraph( new int[][] { {              2,1,2,2,-1,2},{0,1,3,0,-1,3              },{                          },{              2,1,8,2,-1,8} } ),
-      new ScrambleStateGraph( new int[][] { {              2,1,2,2,-1,2},{0,1,3,0,-1,3              },{0,1,5,0,-1,5,             },{                          } } ),
-      new ScrambleStateGraph( new int[][] { {0,1,1,0,-1,1              },{              2,1,4,2,-1,4},{              2,1,6,2,-1,6},{                          } } ),
+      new ScrambleState( new int[][] { {              2,1,2,2,-1,2},{0,1,3,0,-1,3              },{0,1,5,0,-1,5              },{              2,1,8,2,-1,8} } ),
+      new ScrambleState( new int[][] { {                          },{0,1,3,0,-1,3              },{0,1,5,0,-1,5,             },{              2,1,8,2,-1,8} } ),
+      new ScrambleState( new int[][] { {                          },{              2,1,4,2,-1,4},{              2,1,6,2,-1,6},{0,1,7,0,-1,7              } } ),
+      new ScrambleState( new int[][] { {0,1,1,0,-1,1              },{                          },{              2,1,6,2,-1,6},{0,1,7,0,-1,7              } } ),
+      new ScrambleState( new int[][] { {              2,1,2,2,-1,2},{                          },{0,1,5,0,-1,5,             },{              2,1,8,2,-1,8} } ),
+      new ScrambleState( new int[][] { {0,1,1,0,-1,1              },{              2,1,4,2,-1,4},{                          },{0,1,7,0,-1,7              } } ),
+      new ScrambleState( new int[][] { {              2,1,2,2,-1,2},{0,1,3,0,-1,3              },{                          },{              2,1,8,2,-1,8} } ),
+      new ScrambleState( new int[][] { {              2,1,2,2,-1,2},{0,1,3,0,-1,3              },{0,1,5,0,-1,5,             },{                          } } ),
+      new ScrambleState( new int[][] { {0,1,1,0,-1,1              },{              2,1,4,2,-1,4},{              2,1,6,2,-1,6},{                          } } ),
       };
     }
 
diff --git a/src/main/java/org/distorted/objects/TwistyDino6.java b/src/main/java/org/distorted/objects/TwistyDino6.java
index a8352ab7..7ec901b4 100644
--- a/src/main/java/org/distorted/objects/TwistyDino6.java
+++ b/src/main/java/org/distorted/objects/TwistyDino6.java
@@ -21,7 +21,7 @@ package org.distorted.objects;
 
 import android.content.res.Resources;
 
-import org.distorted.helpers.ScrambleStateGraph;
+import org.distorted.helpers.ScrambleState;
 import org.distorted.library.main.DistortedEffects;
 import org.distorted.library.main.DistortedTexture;
 import org.distorted.library.mesh.MeshSquare;
@@ -43,47 +43,24 @@ public class TwistyDino6 extends TwistyDino
     {
     super(size, quat, texture, mesh, effects, moves, ObjectList.DINO, res, scrWidth);
 
-    mStates = new ScrambleStateGraph[]
+    mStates = new ScrambleState[]
       {
-      new ScrambleStateGraph( new int[][] { {0,1,1,0,-1,1, 2,1,2,2,-1,2},{0,1,3,0,-1,3, 2,1,4,2,-1,4},{0,1,5,0,-1,5, 2,1,6,2,-1,6},{0,1,7,0,-1,7, 2,1,8,2,-1,8} } ),
-      new ScrambleStateGraph( new int[][] { {                          },{0,1,3,0,-1,3              },{0,1,5,0,-1,5,             },{              2,1,8,2,-1,8} } ),
-      new ScrambleStateGraph( new int[][] { {                          },{              2,1,4,2,-1,4},{              2,1,6,2,-1,6},{0,1,7,0,-1,7              } } ),
-      new ScrambleStateGraph( new int[][] { {0,1,1,0,-1,1              },{                          },{              2,1,6,2,-1,6},{0,1,7,0,-1,7              } } ),
-      new ScrambleStateGraph( new int[][] { {              2,1,2,2,-1,2},{                          },{0,1,5,0,-1,5,             },{              2,1,8,2,-1,8} } ),
-      new ScrambleStateGraph( new int[][] { {0,1,1,0,-1,1              },{              2,1,4,2,-1,4},{                          },{0,1,7,0,-1,7              } } ),
-      new ScrambleStateGraph( new int[][] { {              2,1,2,2,-1,2},{0,1,3,0,-1,3              },{                          },{              2,1,8,2,-1,8} } ),
-      new ScrambleStateGraph( new int[][] { {              2,1,2,2,-1,2},{0,1,3,0,-1,3              },{0,1,5,0,-1,5,             },{                          } } ),
-      new ScrambleStateGraph( new int[][] { {0,1,1,0,-1,1              },{              2,1,4,2,-1,4},{              2,1,6,2,-1,6},{                          } } ),
+      new ScrambleState( new int[][] { {0,1,1,0,-1,1, 2,1,2,2,-1,2},{0,1,3,0,-1,3, 2,1,4,2,-1,4},{0,1,5,0,-1,5, 2,1,6,2,-1,6},{0,1,7,0,-1,7, 2,1,8,2,-1,8} } ),
+      new ScrambleState( new int[][] { {                          },{0,1,3,0,-1,3              },{0,1,5,0,-1,5,             },{              2,1,8,2,-1,8} } ),
+      new ScrambleState( new int[][] { {                          },{              2,1,4,2,-1,4},{              2,1,6,2,-1,6},{0,1,7,0,-1,7              } } ),
+      new ScrambleState( new int[][] { {0,1,1,0,-1,1              },{                          },{              2,1,6,2,-1,6},{0,1,7,0,-1,7              } } ),
+      new ScrambleState( new int[][] { {              2,1,2,2,-1,2},{                          },{0,1,5,0,-1,5,             },{              2,1,8,2,-1,8} } ),
+      new ScrambleState( new int[][] { {0,1,1,0,-1,1              },{              2,1,4,2,-1,4},{                          },{0,1,7,0,-1,7              } } ),
+      new ScrambleState( new int[][] { {              2,1,2,2,-1,2},{0,1,3,0,-1,3              },{                          },{              2,1,8,2,-1,8} } ),
+      new ScrambleState( new int[][] { {              2,1,2,2,-1,2},{0,1,3,0,-1,3              },{0,1,5,0,-1,5,             },{                          } } ),
+      new ScrambleState( new int[][] { {0,1,1,0,-1,1              },{              2,1,4,2,-1,4},{              2,1,6,2,-1,6},{                          } } ),
       };
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
-// Dino6 is solved if and only if:
-//
-// All four 'X' cubits (i.e. those whose longest edge goes along the X axis) are rotated
-// by the same quaternion qX, similarly all four 'Y' cubits by the same qY and all four 'Z'
-// by the same qZ, and then either:
-//
-// a) qX = qY = qZ
-// b) qY = qX*Q2 and qZ = qX*Q8  (i.e. swap of WHITE and YELLOW faces)
-// c) qX = qY*Q2 and qZ = qY*Q10 (i.e. swap of BLUE and GREEN faces)
-// d) qX = qZ*Q8 and qY = qZ*Q10 (i.e. swap of RED and BROWN faces)
-//
-// BUT: cases b), c) and d) are really the same - it's all just a mirror image of the original.
-//
-// X cubits: 0, 2, 8, 10
-// Y cubits: 1, 3, 9, 11
-// Z cubits: 4, 5, 6, 7
 
   int[] getSolvedQuats(int cubit, int numLayers)
     {
-    switch(cubit)
-      {
-      case 0: case 2: case 8: case 10: return null;
-      case 1: case 3: case 9: case 11: return new int[] {2};
-      case 4: case 5: case 6: case  7: return new int[] {8};
-      }
-
     return null;
     }
 
@@ -103,7 +80,7 @@ public class TwistyDino6 extends TwistyDino
 
   int getSolvedFunctionIndex()
     {
-    return 0;
+    return 2;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/java/org/distorted/objects/TwistyHelicopter.java b/src/main/java/org/distorted/objects/TwistyHelicopter.java
index 0e0bf77e..155596c7 100644
--- a/src/main/java/org/distorted/objects/TwistyHelicopter.java
+++ b/src/main/java/org/distorted/objects/TwistyHelicopter.java
@@ -23,7 +23,7 @@ import android.content.res.Resources;
 
 import org.distorted.helpers.ObjectShape;
 import org.distorted.helpers.ObjectSticker;
-import org.distorted.helpers.ScrambleStateGraph;
+import org.distorted.helpers.ScrambleState;
 import org.distorted.library.main.DistortedEffects;
 import org.distorted.library.main.DistortedTexture;
 import org.distorted.library.mesh.MeshSquare;
@@ -238,7 +238,7 @@ public class TwistyHelicopter extends TwistyObject
 
   private int mCurrState;
   private int mIndexExcluded;
-  private final ScrambleStateGraph[] mStates;
+  private final ScrambleState[] mStates;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -247,21 +247,21 @@ public class TwistyHelicopter extends TwistyObject
     {
     super(size, size, quat, texture, mesh, effects, moves, ObjectList.HELI, res, scrWidth);
 
-    mStates = new ScrambleStateGraph[]
+    mStates = new ScrambleState[]
       {
-      new ScrambleStateGraph( new int[][] { {0,1,1,2,1,2},{0,1,3,2,1,4},{0,1,5,2,1,6},{0,1,7,2,1,8},{0,1,9,2,1,10},{0,1,11,2,1,12} } ),
-      new ScrambleStateGraph( new int[][] { {           },{           },{0,1,5      },{0,1,7      },{      2,1,10},{       2,1,12} } ),
-      new ScrambleStateGraph( new int[][] { {           },{           },{      2,1,6},{      2,1,8},{0,1,9       },{0,1,11       } } ),
-      new ScrambleStateGraph( new int[][] { {           },{           },{0,1,5      },{0,1,7      },{0,1,9       },{0,1,11       } } ),
-      new ScrambleStateGraph( new int[][] { {           },{           },{      2,1,6},{      2,1,8},{      2,1,10},{       2,1,12} } ),
-      new ScrambleStateGraph( new int[][] { {0,1,1      },{0,1,3      },{           },{           },{0,1,9       },{       2,1,12} } ),
-      new ScrambleStateGraph( new int[][] { {      2,1,2},{      2,1,4},{           },{           },{      2,1,10},{0,1,11       } } ),
-      new ScrambleStateGraph( new int[][] { {0,1,1      },{0,1,3      },{           },{           },{      2,1,10},{0,1,11       } } ),
-      new ScrambleStateGraph( new int[][] { {      2,1,2},{      2,1,4},{           },{           },{0,1,9       },{       2,1,12} } ),
-      new ScrambleStateGraph( new int[][] { {      2,1,2},{0,1,3      },{0,1,5      },{      2,1,8},{            },{             } } ),
-      new ScrambleStateGraph( new int[][] { {0,1,1      },{      2,1,4},{      2,1,6},{0,1,7      },{            },{             } } ),
-      new ScrambleStateGraph( new int[][] { {      2,1,2},{0,1,3      },{      2,1,6},{0,1,7      },{            },{             } } ),
-      new ScrambleStateGraph( new int[][] { {0,1,1      },{      2,1,4},{0,1,5      },{      2,1,8},{            },{             } } ),
+      new ScrambleState( new int[][] { {0,1,1,2,1,2},{0,1,3,2,1,4},{0,1,5,2,1,6},{0,1,7,2,1,8},{0,1,9,2,1,10},{0,1,11,2,1,12} } ),
+      new ScrambleState( new int[][] { {           },{           },{0,1,5      },{0,1,7      },{      2,1,10},{       2,1,12} } ),
+      new ScrambleState( new int[][] { {           },{           },{      2,1,6},{      2,1,8},{0,1,9       },{0,1,11       } } ),
+      new ScrambleState( new int[][] { {           },{           },{0,1,5      },{0,1,7      },{0,1,9       },{0,1,11       } } ),
+      new ScrambleState( new int[][] { {           },{           },{      2,1,6},{      2,1,8},{      2,1,10},{       2,1,12} } ),
+      new ScrambleState( new int[][] { {0,1,1      },{0,1,3      },{           },{           },{0,1,9       },{       2,1,12} } ),
+      new ScrambleState( new int[][] { {      2,1,2},{      2,1,4},{           },{           },{      2,1,10},{0,1,11       } } ),
+      new ScrambleState( new int[][] { {0,1,1      },{0,1,3      },{           },{           },{      2,1,10},{0,1,11       } } ),
+      new ScrambleState( new int[][] { {      2,1,2},{      2,1,4},{           },{           },{0,1,9       },{       2,1,12} } ),
+      new ScrambleState( new int[][] { {      2,1,2},{0,1,3      },{0,1,5      },{      2,1,8},{            },{             } } ),
+      new ScrambleState( new int[][] { {0,1,1      },{      2,1,4},{      2,1,6},{0,1,7      },{            },{             } } ),
+      new ScrambleState( new int[][] { {      2,1,2},{0,1,3      },{      2,1,6},{0,1,7      },{            },{             } } ),
+      new ScrambleState( new int[][] { {0,1,1      },{      2,1,4},{0,1,5      },{      2,1,8},{            },{             } } ),
       };
     }
 
diff --git a/src/main/java/org/distorted/objects/TwistyIvy.java b/src/main/java/org/distorted/objects/TwistyIvy.java
index 434da856..7e117111 100644
--- a/src/main/java/org/distorted/objects/TwistyIvy.java
+++ b/src/main/java/org/distorted/objects/TwistyIvy.java
@@ -23,7 +23,7 @@ import android.content.res.Resources;
 
 import org.distorted.helpers.ObjectShape;
 import org.distorted.helpers.ObjectSticker;
-import org.distorted.helpers.ScrambleStateGraph;
+import org.distorted.helpers.ScrambleState;
 import org.distorted.library.main.DistortedEffects;
 import org.distorted.library.main.DistortedTexture;
 import org.distorted.library.mesh.MeshSquare;
@@ -119,7 +119,7 @@ public class TwistyIvy extends TwistyObject
 
   private int mCurrState;
   private int mIndexExcluded;
-  private final ScrambleStateGraph[] mStates;
+  private final ScrambleState[] mStates;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -130,9 +130,9 @@ public class TwistyIvy extends TwistyObject
 
     int[] tmp = {0,-1,0, 0,1,0, 1,-1,0, 1,1,0 };
 
-    mStates = new ScrambleStateGraph[]
+    mStates = new ScrambleState[]
       {
-      new ScrambleStateGraph( new int[][] {tmp,tmp,tmp,tmp} )
+      new ScrambleState( new int[][] {tmp,tmp,tmp,tmp} )
       };
     }
 
diff --git a/src/main/java/org/distorted/objects/TwistyJing.java b/src/main/java/org/distorted/objects/TwistyJing.java
index 2f01aa40..b248f41f 100644
--- a/src/main/java/org/distorted/objects/TwistyJing.java
+++ b/src/main/java/org/distorted/objects/TwistyJing.java
@@ -23,7 +23,7 @@ import android.content.res.Resources;
 
 import org.distorted.helpers.ObjectShape;
 import org.distorted.helpers.ObjectSticker;
-import org.distorted.helpers.ScrambleStateGraph;
+import org.distorted.helpers.ScrambleState;
 import org.distorted.library.main.DistortedEffects;
 import org.distorted.library.main.DistortedTexture;
 import org.distorted.library.mesh.MeshSquare;
@@ -218,7 +218,7 @@ public class TwistyJing extends TwistyObject
 
   private int mCurrState;
   private int mIndexExcluded;
-  private final ScrambleStateGraph[] mStates;
+  private final ScrambleState[] mStates;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -229,9 +229,9 @@ public class TwistyJing extends TwistyObject
 
     int[] tmp = {0,-1,0, 0,1,0, 1,-1,0, 1,1,0 };
 
-    mStates = new ScrambleStateGraph[]
+    mStates = new ScrambleState[]
       {
-      new ScrambleStateGraph( new int[][] {tmp,tmp,tmp,tmp} )
+      new ScrambleState( new int[][] {tmp,tmp,tmp,tmp} )
       };
     }
 
diff --git a/src/main/java/org/distorted/objects/TwistyObject.java b/src/main/java/org/distorted/objects/TwistyObject.java
index 446c74af..c74bda85 100644
--- a/src/main/java/org/distorted/objects/TwistyObject.java
+++ b/src/main/java/org/distorted/objects/TwistyObject.java
@@ -453,6 +453,7 @@ public abstract class TwistyObject extends DistortedNode
     {
     if( mSolvedFunctionIndex==0 ) return isSolved0();
     if( mSolvedFunctionIndex==1 ) return isSolved1();
+    if( mSolvedFunctionIndex==2 ) return isSolved2();
 
     return false;
     }
@@ -555,6 +556,41 @@ public abstract class TwistyObject extends DistortedNode
     return false;
     }
 
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Dino6 uses this. It is solved if and only if:
+//
+// All four 'X' cubits (i.e. those whose longest edge goes along the X axis) are rotated
+// by the same quaternion qX, similarly all four 'Y' cubits by the same qY and all four 'Z'
+// by the same qZ, and then either:
+//
+// a) qX = qY = qZ
+// b) qY = qX*Q2 and qZ = qX*Q8  (i.e. swap of WHITE and YELLOW faces)
+// c) qX = qY*Q2 and qZ = qY*Q10 (i.e. swap of BLUE and GREEN faces)
+// d) qX = qZ*Q8 and qY = qZ*Q10 (i.e. swap of RED and BROWN faces)
+//
+// BUT: cases b), c) and d) are really the same - it's all just a mirror image of the original.
+//
+// X cubits: 0, 2, 8, 10
+// Y cubits: 1, 3, 9, 11
+// Z cubits: 4, 5, 6, 7
+
+  public boolean isSolved2()
+    {
+    int qX = CUBITS[0].mQuatIndex;
+    int qY = CUBITS[1].mQuatIndex;
+    int qZ = CUBITS[4].mQuatIndex;
+
+    if( CUBITS[2].mQuatIndex != qX || CUBITS[8].mQuatIndex != qX || CUBITS[10].mQuatIndex != qX ||
+        CUBITS[3].mQuatIndex != qY || CUBITS[9].mQuatIndex != qY || CUBITS[11].mQuatIndex != qY ||
+        CUBITS[5].mQuatIndex != qZ || CUBITS[6].mQuatIndex != qZ || CUBITS[ 7].mQuatIndex != qZ  )
+      {
+      return false;
+      }
+
+    return ( qX==qY && qX==qZ ) || ( qY==mulQuat(qX,2) && qZ==mulQuat(qX,8) );
+
+    }
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
   public void setObjectRatio(float sizeChange)
diff --git a/src/main/java/org/distorted/objects/TwistyRex.java b/src/main/java/org/distorted/objects/TwistyRex.java
index 76101fdb..668b4074 100644
--- a/src/main/java/org/distorted/objects/TwistyRex.java
+++ b/src/main/java/org/distorted/objects/TwistyRex.java
@@ -23,7 +23,7 @@ import android.content.res.Resources;
 
 import org.distorted.helpers.ObjectShape;
 import org.distorted.helpers.ObjectSticker;
-import org.distorted.helpers.ScrambleStateGraph;
+import org.distorted.helpers.ScrambleState;
 import org.distorted.library.main.DistortedEffects;
 import org.distorted.library.main.DistortedTexture;
 import org.distorted.library.mesh.MeshSquare;
@@ -155,7 +155,7 @@ public class TwistyRex extends TwistyObject
 
   private int mCurrState;
   private int mIndexExcluded;
-  private final ScrambleStateGraph[] mStates;
+  private final ScrambleState[] mStates;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -166,9 +166,9 @@ public class TwistyRex extends TwistyObject
 
     int[] tmp = {0,-1,0, 0,1,0, 2,-1,0, 2,1,0 };
 
-    mStates = new ScrambleStateGraph[]
+    mStates = new ScrambleState[]
       {
-      new ScrambleStateGraph( new int[][] {tmp,tmp,tmp,tmp} )
+      new ScrambleState( new int[][] {tmp,tmp,tmp,tmp} )
       };
     }
 
diff --git a/src/main/java/org/distorted/objects/TwistySkewb.java b/src/main/java/org/distorted/objects/TwistySkewb.java
index 9bcdb908..adb05f40 100644
--- a/src/main/java/org/distorted/objects/TwistySkewb.java
+++ b/src/main/java/org/distorted/objects/TwistySkewb.java
@@ -23,7 +23,7 @@ import android.content.res.Resources;
 
 import org.distorted.helpers.ObjectShape;
 import org.distorted.helpers.ObjectSticker;
-import org.distorted.helpers.ScrambleStateGraph;
+import org.distorted.helpers.ScrambleState;
 import org.distorted.library.main.DistortedEffects;
 import org.distorted.library.main.DistortedTexture;
 import org.distorted.library.mesh.MeshSquare;
@@ -192,7 +192,7 @@ public class TwistySkewb extends TwistyObject
 
   private int mCurrState;
   private int mIndexExcluded;
-  private final ScrambleStateGraph[] mStates;
+  private final ScrambleState[] mStates;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -203,9 +203,9 @@ public class TwistySkewb extends TwistyObject
 
     int[] tmp = {0,-1,0, 0,1,0, size-1,-1,0, size-1,1,0 };
 
-    mStates = new ScrambleStateGraph[]
+    mStates = new ScrambleState[]
       {
-      new ScrambleStateGraph( new int[][] {tmp,tmp,tmp,tmp} )
+      new ScrambleState( new int[][] {tmp,tmp,tmp,tmp} )
       };
     }
 
diff --git a/src/main/java/org/distorted/objects/TwistyUltimate.java b/src/main/java/org/distorted/objects/TwistyUltimate.java
index 51df5987..e69c7953 100644
--- a/src/main/java/org/distorted/objects/TwistyUltimate.java
+++ b/src/main/java/org/distorted/objects/TwistyUltimate.java
@@ -23,7 +23,7 @@ import android.content.res.Resources;
 
 import org.distorted.helpers.ObjectShape;
 import org.distorted.helpers.ObjectSticker;
-import org.distorted.helpers.ScrambleStateGraph;
+import org.distorted.helpers.ScrambleState;
 import org.distorted.library.main.DistortedEffects;
 import org.distorted.library.main.DistortedTexture;
 import org.distorted.library.mesh.MeshSquare;
@@ -235,7 +235,7 @@ class TwistyUltimate extends TwistyObject
 
   private int mCurrState;
   private int mIndexExcluded;
-  private final ScrambleStateGraph[] mStates;
+  private final ScrambleState[] mStates;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -246,9 +246,9 @@ class TwistyUltimate extends TwistyObject
 
     int[] tmp = {0,-1,0, 0,1,0, 1,-1,0, 1,1,0 };
 
-    mStates = new ScrambleStateGraph[]
+    mStates = new ScrambleState[]
       {
-      new ScrambleStateGraph( new int[][] {tmp,tmp,tmp,tmp} )
+      new ScrambleState( new int[][] {tmp,tmp,tmp,tmp} )
       };
     }
 
