Minor modifications to function module: now distributes factor in exponent.