added tree and fixed one bug