Solver class cleaned and commented