Improving efficiency of bubblesort.