Added a couple command-line switches and cleaned up code.