implementing simple bubblesort