Added 2 more functions to find root path of dirs