Updated the quick sort algo's partition logic