Calculate heatmap set implementation. Updated function arguments.