implemented BubbleSort