Update board.java to solve a bug and add comments