Added TreePlugin code