implement attributes: uniq, sort, ref.  (step 1, record them)