Implemented autoscroll functionality.