Jack's bubble sort solution