Bubble sort an array