slider function extracted to be called per slider
check for principle