added commandline text output and configurable outputfile name