added stacking heuristics