added basic distance approximation