changed get averages to use pointers