finished implementation of generateBoard