fixed some TODOs

and started getting the classes in preorder traversal order