added indices based matching -- need to complete it. also added optimization to return if the distance is smaller than 0.01