added distance.c