Improved Bubble Sorting Algorithm with Optional Parameters