Added depth criteria and worked on node class