Opacity function

made the opacities settings actually work the way it's supposed to