adding group.h, fixing bugs