move heatmap to separate js file