use a class for solver