turned heatmap into a callable function