Refactored to make changing board size easier