fixed issue #1 and small bugs so it can run
undid extra changes
Merge pull request #16 from cmchang/master

fixed issue #1 and small bugs so it can run