Add bubble sort function that acts on a copy