implementation of bubble sort algorithm