fixed heatmap code