Added distance function to web app