added find deepest node method