head,tail,uniq done