Calculate distance working