Completed getNextMove() method. Possibly revise