using std sort instead of custom sort