Cleaned up the scrolling code