Deleted a bunch of unused stuff, added comments to the main routine, and updated the commandline arguments.