improved the heuristic power. remains to optimize params and clean up code.