rewrote final draft of build_menu function and debugged completely