added implementation for updating the board algorithm