Code Cleanup and fixed some tricky scrolling bugs