fixup! nested loop implementation