Implemented tree testing