get monthly averages function