updated summation
added worksWhen, which tests if an expression runs at all.