more robust method for circular dependence