bug fixes and new command line options
outp format changes, bug fix