refactor to support command line
Merge pull request #1 from walterbender/master

refactor to support command line