modified draw function in board.js