Changed the binary tree method