I thought it worked like that: take 2 numbers from array (i and i+1), if i<i+1 replace them (so they should be in order: i+1 and then i). but the method shows numbers without any order :(