Improve solveIn method