Main classes added. Solver implemented.