adds NodeMap
cleans up postorder code