Changed the sorting functions and added half of a bubble sort