added more summate statements to several functions