Adding utilities to calculate distances