updated sort algorightms