Speed up the scrolling performance

I moved the else part to always being run, rather than only if.