Some housekeeping, changed from using os.Args to using flags
More housekeeping