improved script to handle issue with additive overlays