Moving to an overlap function approach
Slight cleanup of the general algorithm