Simplified scroll calculation
Merge branch 'modal'