Refactored board_to_string(), replacing one line with two. This was enabled by explicitly declaring the 'out' variable in the helper function to be a local variable.