iteration with multiple foreach's