add code for overlaps (not correctly weighted)