first version of Solver.java