Fast Sorting Algorithm Python If Statements