Restored distance function i main activity temporarily