Thanks to the following for their help:

Ben Thomasson (found bug in example)
Hannes Klas (suggested additional interface)
