started work on command line option parsing
setup some basic logging
setup actual logging
added some comments, and cleaned up code a bit