Added commandline argument parsing, thanks to stackoverflow. Currently untested.