added better version of bubble sort