beginnings of root function