customized heatmap script

see wiki for detail