generalize Cond, add CompSum, BalSum