Scrolling Algorithm Improvement

Made the scrolling algorithm much better (although still not very good).