adding gapply