corrected bug in overlay

the overlay method wasn't iterating on the correct range.