added summation for non-constants