Using BubbleSort to sort an array