added directive for selecting users
putting things into anonymous functions for namespacing purposes