function for checking tree-structured CRF added