Is this how this computation is supposed to happen?  Seems like you need to loop first to find surfaces that will be in group.  Then loop to find total area.  Then loop to set each surface's fraction.  This looks wrong to me.