final optimisation

I never liked how the sorted array needed to be reversed at the
end and just thought of a way to get rid of it. Now I can delete my branch :).