merge pull request, closes #21 and #14