Added rules for sums and functions.