Merged the original pull request #36 changes into the code, cleaned up the whitespace.