fixed code to display heat maps