fixed bubble sort and initialization