added adhoc outer loop solve