second attempt at distance