added logic for Board.java