Add overlap-handling code