added distance stuff