implemented requested functionality in scrollBuffer