Add docstring to solve_heuristic, fix error