Merged entity heuristics stuff into the existing Compound code