handled a few border cases for nxnxn rubiks cube