I may be wrong, but I don't see `virtualHeight`, `viewportHeight`, or `scrollbarHeight` changing, so you could pull lines 118 and 119 to the outer scope. This would make positioning a little faster. But I may be missing something about why they're being recalculated here (wouldn't be the first time) :)