some work on dealing with overlays properly