Implemented getValidMoves