Improved slider value calculation