successfully implemented scrolling function