Incremental distance tracking fixes #456

Messy implementation.
Needs tidying up.