added distance solution