various improvements to multi-range calculations