Nested loop assignment