Changed BubbleSort code along with algorithm