Write a function that takes in an array of integers and returns a sorted version of that array using the Bubble Sort algorithm.
Bubble Sort works by repeatedly stepping through the list, comparing adjacent elements and swapping them if they are in the wrong order. The pass through the list is repeated until the list is sorted.