sort with main
sort done with test