made the destroy tree use a function pointer to free