adding run-main
fixed bug in run-main
fixed second bug in run main
Merge pull request #1 from rolloff/master

adding run-main