Define functions for menu and commandline args