Working solver, new heuristic