add optimized bubble_sort_opt method