added variable for the average function