add calcDistanceFromHead method