Implementing heatmaps with arrays