Kara does not like chaos. That is why he decides to sort the rows of cloverleafs in his world. One way way to do this is to apply the BubbleSort algorithm.
BubbleSort works as shown in the picture below. Starting from the top of the world, two "rows" of cloverleafs are compared. If the lower row is shorter, the two rows have to be swapped. If at least two rows have been swapped, the algorithm has to start over again after reaching the bottom. If no swap was necessary during a walk from top to bottom, all rows are in sorted order, and Kara stops.