cleaned up propensity function generation