fix #19 and some cleanup
Merge pull request #23 from lmk123/issue-19

fix #19 and some cleanup