Fixing distanace mapping