Yes, I'm using your code. like i said it works, but $2 only has the role name, not the group name. ideally I'd like $2 to have the group name and $3 to have the role name.
I updated the original post. The string gets messed up when you post it with < code > tags.