Add support for abitrary trees