Fix for issue #16

Here is a cleaned up pull request for issue #16