script to provide smooth scrolling