added optimized Bubble Sort code