Use one level of loop as suggest by P.Wheeler