updated cap_solve: