bug fixed

test case 05 passed!

Sorting function rewrite