Maybe `main_menu()' can be redone somehow - make the state machine a little nicer - use a state table for deciding what is next and what to offer, etc. A checklist might be useful... Will folks please point me at relevant code, papers, textbooks, etc. to help me learn to understand how to solve this type of problem? Hand me the posthole-digger and I'll start fencing it off.