Made a few changes to decreas the overhead of the search heuristic. Also added some graph functions for experiments.