Bubble sort seems to be working now.