finished version_sort