Updated heatmap code