scrolling, refactor away globals