refreshed with version from JasonJ.
Also removing the older def for memberOf