Fixed syntax and logic errors in board.js