reworking fundamental group to be an actual group (KGn broken for now)