now works in command line mode