added clean-up actions to average.cpp