Improving functionality of slider