Implementation of binary search tree