turned slider into a function &

so i made the slider a function then called it. I also added commentary
to the slider.