Added method for adding/editing groups.