tiering works

in previous version, cgn got filled with groupid[n-1], which were
compared with [n=0] later on. Thus, broken shit. now fixed.