added root() function