exercise on Trees