Calculating distance from multiple fields