Updated Code for Slider