updated avgR.c
updated avgR.c