Converted from webapp to command line