This is still a mess, and very far from working, need to figure out the nested iterator...