Optimized iterations and made groups work.