Completed the imperative cock-tail sort part