Restored the standalone 'quote' and 'ranges' calculation.