Updated BubbleSort with correct order.