scrolling much smoother and better calculation for it