What Gargoyle means is exactly how I wrote my code.
Only instead of using my GetComps function using fnLDAPQuery.
Both Gargoyle's and my suggestion provide the same output since you would have to use the function 4 times.