Function board_print fully refactored.