Implemented Bubblesort optimisation to ignore elements after the last swap of the previous pass.