Add function to build a binary tree