replaced some code in the _init function with the new updateSlider function