Changed root to WeakRef, added documentation