Added logging; started heuristics