add tag function, not finished.