aren't you creating a global here? I don't see the var definition for `opacity`