Altered scrolling code to add hashing/history states + minor fixes