insert cards in order into groups by scanning the DOM