performing bubble sort