Improved commandline version