heatMap optimazation