convert RunningAverage to template class
replace floats with ints where possible