Merged in Justin R's code (Logging in, group membership)