Add variance to grades_average function