Implemented cocktail_sort