testing for buildTree function