Improved the rule for g