code is ready to go for publication
final update for publication
Merge pull request #2 from markwilkinson/master

Final tweaks for publication