updated for use with the command line