more performance version of BubbleSort