added error handling. included <iostream> in Solver.h