Changed distance method for Android