Add comments and most the functionality for fragment.root analysis with in program.

Add comments and most the functionality for fragment.root analysis with in program.