Self Generating Sorting Algorithm