moved isValidMoves etc. to the board class