Refactored display_heatmap method.