add functions for command line handling