implemented Solver class, tested it