working on #12 and #9
Merge pull request #44 from ahebert/master

working on #12 and #9