expansion calculations and loop sizing