figure out the groups, does not keep consistent objects