Rewritten ut1red function. Not tested.