Added nodes method to all tree related classes.