To test substrees