fixes #20 and #21
Merge pull request #24 from wilmoore/issue-20

fixes #20 and #21