updated heatmap code