fixed summing bug