adds history averaging to hello world example