set up tree var and if else statement