make calculatePendingRanges asynchronous
Add missing files