bubble sort test and refactor