implemented bubble sort algorithm