Function getIntervalSum() added