a bubble sort function in swift