create groups with mode