moved functions to Board.java