Added skipping of the first parameter when calculating distance because it's id.