Much better scroll calculation