How to implement the Bubble Sort algorithm?