Updated overlap.func.R