added the solver logic.