Added the slider functionality