New algorithm to reallocate locations for heatmap