add comment on tail function