Add distance functionality