Moved the slider code to a separate file