refactored both bubble sorts