recursively searches through nested loops and opens and closes workgroup loops, no replication