migrated rete from loop to iter