added variable average