Improved board generation using backtracking