pulling in PR #1, cleaned up a little, closes #1