merging the slider code