So did you see the devil? Any error somewhere? The code I posted is not optimal, it is part of a much larger project I had two years ago, with many other sorting algorithms being tested, hence double function calls which are not really needed here. But, asides from that, do you see anything wrong in what I am saying?