initial implementation of binary tree