Replaced every instance of params.dz, and changed the rangesearch to actually have the right criterion for finding overlap.