Nested loops finally work.