sepereated the tree and created arraylist of arraylist for topLevelLists.