added support for trees (lists of lists) data structures.