Added code for Trees. Used Delegates.