added some stuff to handle scrolling