Improved edge scrolling

Edge scrolling is smoother and handles better now.