beginnings of function to check avg and max (#7)