fix generator. TODO: add more groups, store groups