Incremental distance tracking fixes #456

Messy implementation.
Needs tidying up.
Merge pull request #457 from dreamteam69/master

Incremental distance tracking fixes #456