adjusted rotate thing, now takes scrolling into account