updated G-algo:check groups