adding already worked on sorting alg