Overlay logic added