Added brackets to sort code