created functions to test validity of board.
fixed the row count function