Replace copyto with minimum in U calculation.