added way to query more than 10 elements of distance matrix than at a time