How to create and assign groups