slider logic