Working nested recursive looping

Signed-off-by: Adrian-Tudor Panescu <adrian.tudor.panescu@cern.ch>