Completed bubble sort