Fixed getValidMoves()

Fixed the getValidMoves() functions as well as removing some debug print
statements.