Sorting algo added in python