Locality restrictions added. Merge simplified.