single iteration over the array
working bubble sort