added averaging
added utils.cc