crash course to udf's.
copy the whole udf (with description to the endfunction) in to your script file.
leave it like that. don't alter it.

then, where you tried to use the ingroup, use computeringroup() instead.
_________________________
!

download KiXnet