Intermediate commit. Fixing issues with accuracy and distance