fixed board generation function - tests are passing now