updating ml solver to solve residual problem