Completed bubblesort()