refactoring Solver
added remaining time