sorting of bubbles corrected