optimized issubtree solution