Some clenaup and fixes
Merge pull request #2 from vicb/code

Some clenaup and fixes

....

I will gladly take you up on your offer to update the docs.