binary tree code along with code to test functionality