refactored the slider javascript