I added the requested changes nearly verbatim, some whitespace changes, sorry
Merge pull request #27 from MiguelABarbosa/mike

I added the requested changes nearly verbatim, some whitespace changes, ...