changed method getValidMoves() to static