added usage instructions.
added getoptions calls to fetch data.  some error checking still needed.
commented out untested code for non-commandline version.