switch to std::stable_sort in the hope it syncs (I am unsure if std::sort does)