Wrote functions sort_menu & new_array, refactored.