adding more codes related to tree