Adding changes to find root node..