need to rewrite the tag analyse function