Cleaned up this file, added help and command line parameters to make it more usable.