Made algorithm class to keep track of time of last scroll to prevent scrolling immediately after previous scroll