this is how I handle groups. you should be able to tweak this method for your needs
let me know if you have any questions.