Creating Algorithms for the Sort Method