added command line options, removed stdout logging, renamed diff()