I would like to create a nested loop where the nesting depth is also determined by a loop. For example I have an array of integers