add more functions and make root references work.