Program the val_root function, not having finished the debug.To be continued...