v10 - final working copy.

This is the one we used for the paper.