fix reverse iterator in simset, replace qsort with std::sort