Added bounds functionality and further optimised heatmap.