update average method