If I see this correctly, this call to my_foreman() results in n^3 passes over 'n' global_catlog entries. This is because my_foreman() recursively compares each global_catalog entry to every other entry (n^2). Is that correct? If so, do we need to iterate that many times over global_catalog?