this pull request fixes #7, #10, and #12 issues