added distance query