Added command line arguments

Also made a few cosmetic changes for cleaner-looking code.