overlay improved according to peter ferrie's answer