Modified code to allow for multiple layers to be controlled by the slider.