Naive binary tree implementation