+ // lower_bound finds the next element that is
+ // less than or *equal to* the current value!
+ //it4 = distmultimap.lower_bound((*it4).first);
+
+ // David Feng's fix
+ std::multimap<double, File *>::const_iterator itPrev = it4;
+ while (itPrev->first == it4->first)
+ --itPrev;
+ it4 = itPrev;
+