changed a little bit in solveCube