changed util function in heatmap