Added stable sorting and made our lives easier