whoops
Some optimizations
Take output file from cmdline