refactored board from two-dimensional to one-dimensional