improved bubblesort