added basic pagination to history