add check if cube is in grid