added the tagging facility using descend function