Changed the implementation of searching in a binary tree