diff --git a/TestON/JenkinsFile/CHO_Graph_Generator b/TestON/JenkinsFile/CHO_Graph_Generator
index 424f9a3..da81c04 100644
--- a/TestON/JenkinsFile/CHO_Graph_Generator
+++ b/TestON/JenkinsFile/CHO_Graph_Generator
@@ -1,36 +1,80 @@
+// Copyright 2017 Open Networking Foundation (ONF)
+//
+// Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+// the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+// or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
+//
+//     TestON is free software: you can redistribute it and/or modify
+//     it under the terms of the GNU General Public License as published by
+//     the Free Software Foundation, either version 2 of the License, or
+//     (at your option) any later version.
+//
+//     TestON is distributed in the hope that it will be useful,
+//     but WITHOUT ANY WARRANTY; without even the implied warranty of
+//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//     GNU General Public License for more details.
+//
+//     You should have received a copy of the GNU General Public License
+//     along with TestON.  If not, see <http://www.gnu.org/licenses/>.
+
+// This is the Jenkins script for graph-generator-CHO jenkins job.
+
 #!groovy
+// Read the files that has the dependencies
 fileRelated = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy' )
 
 fileRelated.init()
+// The way reading the parameters from the Jenkins.
 branches = params.ONOSbranch
 hours = params.hours
+
+// divide the branch list into the list that was separated by newline, semi-colon, comma or space
 branchList = branches.tokenize( "\n;, " )
+
+// initialize the directory.
+
+// Script file is the R script path
 script_file = fileRelated.trendCHO
+// saving_directory is the directory that save the generate graphs.
 saving_directory = fileRelated.jenkinsWorkspace + "postjob-Fabric5/"
 scriptDir = fileRelated.CHOScriptDir
 
+// create a bash script that will generate the graph
 graphScript = generateGraphScript( branchList )
 
 stage( 'Generating-Graph' ){
+    // This will run on TestStation-Fabric5s node.
     node( "TestStation-Fabric5s" ){
+        // run the bash script on this node.
         runScript( graphScript )
     }
 }
+// stage that will trigger postjob.
+// Need to be executed outside the current node to avoid deadlock.
 stage( 'posting-result' ){
     postJob()
 }
 
 def generateGraphScript( branchList ){
+    // Generate the bash script that will run the Rscript to make graph.
     graphScript = ''''''
+
+    // In case there are multiple branches running.
     for( branch in branchList ){
         branchDir = scriptDir + branch + "/"
         graphScript += '''export BRANCH=''' + branchDir + '''
+                          # make branch dir if not existing.
                           mkdir ''' + branchDir + ''';
+                          # inside the branchDir, check if there were existing graph
                           if [ ! -f ''' + branchDir + '''existing.txt ]; then
+                             # If it was first generated, it will copy .csv file.
                              cp *.csv ''' + branchDir + ''';
+                             # mark that this has created already.
                              echo "1" > ''' + branchDir + '''existing.txt;
                           fi;
+                          # run the log-summary that will export status
                           bash log-summary;''' + '''
+                          # run Rscript with it's parameters.
                           Rscript ''' +  script_file + ' ' + branchDir + 'event.csv ' +
                                 branchDir + 'failure.csv ' + branchDir + 'error.csv ' +
                                 branch + ' 60 ' + hours + ' ' +  saving_directory + ''';
@@ -40,6 +84,7 @@
     return graphScript
 }
 def runScript( graphScript ){
+    // run bash script that will init the environment and run the graph generating part.
     sh '''#!/bin/bash -l
           set -i
           set +e
@@ -48,6 +93,7 @@
           ''' + graphScript
 }
 def postJob(){
-        jobToRun = "postjob-Fabric5"
-        build job: jobToRun, propagate: false
+    // Triggering jenkins job called `postjob-Fabric5`
+    jobToRun = "postjob-Fabric5"
+    build job: jobToRun, propagate: false
 }
diff --git a/TestON/JenkinsFile/FUNCJenkinsFile b/TestON/JenkinsFile/FUNCJenkinsFile
index c063ee2..24c5f71 100644
--- a/TestON/JenkinsFile/FUNCJenkinsFile
+++ b/TestON/JenkinsFile/FUNCJenkinsFile
@@ -1,24 +1,56 @@
+// Copyright 2017 Open Networking Foundation (ONF)
+//
+// Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+// the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+// or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
+//
+//     TestON is free software: you can redistribute it and/or modify
+//     it under the terms of the GNU General Public License as published by
+//     the Free Software Foundation, either version 2 of the License, or
+//     (at your option) any later version.
+//
+//     TestON is distributed in the hope that it will be useful,
+//     but WITHOUT ANY WARRANTY; without even the implied warranty of
+//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//     GNU General Public License for more details.
+//
+//     You should have received a copy of the GNU General Public License
+//     along with TestON.  If not, see <http://www.gnu.org/licenses/>.
+
+// This is the Jenkins script for FUNC-pipeline-<branch>
+
 #!groovy
+
+// read the dependency files
 funcs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy' )
 test_lists = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsTestONTests.groovy' )
 fileRelated = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy' )
 
 fileRelated.init()
+
+// initialize the funcs with category of FUNC
 funcs.initialize( "FUNC" );
 
 // This is a Jenkinsfile for a scripted pipeline for the FUNC tests
 def prop = null
+
+// Read the TestONOS.property from the VM
 prop = funcs.getProperties()
+
+// get the list of the test and init branch to it.
 FUNC = test_lists.getAllTheTests( prop[ "WikiPrefix" ] )[ "FUNC" ]
 
+// init some directories
 graph_generator_file = fileRelated.trendIndividual
 graph_saved_directory = fileRelated.jenkinsWorkspace + "postjob-VM/"
 
+// get the list of the test to run
 echo( "Testcases:" )
 def testsToRun = null
 testsToRun = funcs.getTestsToRun( prop[ "Tests" ] )
 funcs.printTestToRun( testsToRun )
 
+// run the test sequentially and save the function into the dictionary.
 def tests = [:]
 for( String test : FUNC.keySet() ){
     toBeRun = testsToRun.contains( test )
@@ -26,10 +58,16 @@
     tests[stepName] = funcs.runTest( test, toBeRun, prop, test, false, FUNC, graph_generator_file, graph_saved_directory )
 }
 
+// get the start time of the test.
 start = funcs.getCurrentTime()
-// run the tests
+
+// run the tests sequentially.
 for ( test in tests.keySet() ){
     tests[ test ].call()
 }
+
+// generate the overall graph of the FUNC tests.
 funcs.generateOverallGraph( prop, FUNC, graph_saved_directory )
+
+// send the notification to Slack that running FUNC tests was ended.
 funcs.sendResultToSlack( start,  prop[ "manualRun" ], prop[ "WikiPrefix" ] )
diff --git a/TestON/JenkinsFile/FabricJenkinsfileTrigger b/TestON/JenkinsFile/FabricJenkinsfileTrigger
index ef805a9..b5d09bd 100644
--- a/TestON/JenkinsFile/FabricJenkinsfileTrigger
+++ b/TestON/JenkinsFile/FabricJenkinsfileTrigger
@@ -1,19 +1,49 @@
+// Copyright 2017 Open Networking Foundation (ONF)
+//
+// Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+// the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+// or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
+//
+//     TestON is free software: you can redistribute it and/or modify
+//     it under the terms of the GNU General Public License as published by
+//     the Free Software Foundation, either version 2 of the License, or
+//     (at your option) any later version.
+//
+//     TestON is distributed in the hope that it will be useful,
+//     but WITHOUT ANY WARRANTY; without even the implied warranty of
+//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//     GNU General Public License for more details.
+//
+//     You should have received a copy of the GNU General Public License
+//     along with TestON.  If not, see <http://www.gnu.org/licenses/>.
+
+// This is the Jenkins script for the fabric-pipeline-trigger
+
 #!groovy
 
+// init dependencies functions
 funcs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy' )
 test_lists = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsTestONTests.groovy' )
 triggerFuncs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/TriggerFuncs.groovy' )
 fileRelated = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy' )
 
 fileRelated.init()
+
+// set the versions of the onos.
 current_version = "master"
 previous_version = "1.13"
 before_previous_version = "1.12"
+
+// Function that will initialize the configuration of the Fabric.
 funcs.initializeTrend( "Fabric" );
 funcs.initialize( "Fabric" )
 triggerFuncs.init( funcs )
 
+// Wiki contents is the contents for https://wiki.onosproject.org/display/ONOS/Automated+Test+Schedule
+// It will only be used by the VM_BMJenkinsTrigger not in here.
 wikiContents = ""
+
+// Having two different SR and SR1 to allow current_version and previous_version to be run on same machine.
 testcases = [
     "FUNC" : [ tests : "" , nodeName : "VM", wikiContent : "" ],
     "HA" : [ tests : "" , nodeName : "VM", wikiContent : "" ],
@@ -22,6 +52,8 @@
     "SR1" : [ tests : "", nodeName : [ "Fabric2", "Fabric3" ], wikiContent : "" ],
     "USECASE" : [ tests : "" , nodeName : "BM", wikiContent : "" ]
 ]
+
+// depends on the First two letter of the testname, it will decide which category to put test.
 Prefix_organizer = [
     "FU" : "FUNC",
     "HA" : "HA",
@@ -33,6 +65,7 @@
     "VP" : "USECASE"
 ]
 
+// set some variables from the parameter
 manually_run = params.manual_run
 onos_b = current_version
 test_branch = ""
@@ -44,70 +77,104 @@
 print now.toString()
 today = now[ Calendar.DAY_OF_WEEK ]
 
+// if it is manually run, it will set the onos version to be what it was passed by.
+// Currently, SR-pipeline-manually is not supported due to the special way of it is executed.
 if ( manually_run ){
     onos_b = params.ONOSVersion
 }
+
+// get the list of the tests from the JenkinsTestONTests.groovy
 AllTheTests = test_lists.getAllTheTests( onos_b )
 
+
 day = ""
+
+// list of the test on each test category will be run.
 SCPF_choices = ""
 USECASE_choices = ""
 FUNC_choices = ""
 HA_choices = ""
 SR_choices = ""
+
+// initialize the graph generating files.
 stat_graph_generator_file = fileRelated.histogramMultiple
 pie_graph_generator_file = fileRelated.pieMultiple
 graph_saved_directory = fileRelated.jenkinsWorkspace + "postjob-Fabric/"
 
+// get the post_result. This will be affected only for the manual runs.
 post_result = params.PostResult
 if( !manually_run ){
+    // If it is automated running, it will post the beginning message to the channel.
     slackSend( channel:'sr-failures', color:'#03CD9F',
                message:":sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles:\n"
                         + "Starting tests on : " + now.toString()
                         + "\n:sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles:" )
 
+    // Choices will get the list of the test with Segment Rounting type tests.
     SR_choices += adder( "SR", "basic", true )
     if ( today == Calendar.FRIDAY ){
+        // if today is Friday, it will also test tests with extra_A category
         SR_choices += adder( "SR", "extra_A", true )
     } else if( today == Calendar.SATURDAY ){
+        // if today is Saturday, it will add the test with extra_B category
         SR_choices += adder( "SR", "extra_B", true )
     }
+    // removing last comma added at the end of the last test name.
     SR_choices =  triggerFuncs.lastCommaRemover( SR_choices )
 }
+
+
 if ( manually_run ){
     testcases = triggerFuncs.organize_tests( params.Tests, testcases )
 
     isOldFlow = params.isOldFlow
     println "Tests to be run manually : "
 }else{
+    // set the list of the tests to run.
     testcases[ "SR" ][ "tests" ] = SR_choices
     testcases[ "SR1" ][ "tests" ] = SR_choices
     println "Defaulting to " + day + " tests:"
 }
 
+// print out the list of the test to run on Jenkins
 triggerFuncs.print_tests( testcases )
 
+// This will hold the block of code to be run.
 def runTest = [
     "Fabric2" : [:],
     "Fabric3" : [:]
 ]
 if ( manually_run ){
+    // for manual run situation.
     for( String test in testcases.keySet() ){
         println test
+        // Unless the list of the tests on the test category is empty, it will save the block of code to run in dictionary.
         if ( testcases[ test ][ "tests" ] != "" ){
             runTest[ testcases[ test ][ "nodeName" ][ nodeOn( onos_b ) ] ][ test ] = triggerFuncs.trigger_pipeline( onos_b, testcases[ test ][ "tests" ], testcases[ test ][ "nodeName" ][ nodeOn( onos_b ) ], test, manually_run, onos_tag )
         }
     }
 }else{
+    // for automated situation, it will save current and previous version to Fabric2 and before_previous_version to Fabric3.
     runTest[ "Fabric2" ][ "SR1" ] = triggerFuncs.trigger_pipeline( current_version, testcases[ "SR1" ][ "tests" ], testcases[ "SR1" ][ "nodeName" ][ 0 ], "SR", manually_run, onos_tag )
     runTest[ "Fabric2" ][ "SR" ] = triggerFuncs.trigger_pipeline( previous_version, testcases[ "SR" ][ "tests" ], testcases[ "SR" ][ "nodeName" ][ 0 ], "SR", manually_run, onos_tag )
     runTest[ "Fabric3" ][ "SR" ] = triggerFuncs.trigger_pipeline( before_previous_version, testcases[ "SR" ][ "tests" ], testcases[ "SR" ][ "nodeName" ][ 1 ], "SR", manually_run, onos_tag )
 }
 
 def finalList = [:]
+
+// It will run each category of test to run sequentially on each branch.
+// In our case, it will run SR1 first then SR on Fabric2 and just SR on Fabric3
 finalList[ "Fabric2" ] = triggerFuncs.runTestSeq( runTest[ "Fabric2" ] )
 finalList[ "Fabric3" ] = triggerFuncs.runTestSeq( runTest[ "Fabric3" ] )
+
+// It will then run Fabric2 and Fabric3 to be run concurrently.
+// In our case,
+//                      ----> Fabric2 : current -> previous
+// This pipeline ----->
+//                      ----> Fabric3 : before_previous
 parallel finalList
+
+// Way we are generating pie graphs. not supported in SegmentRouting yet.
 /*
 if ( !manually_run ){
     funcs.generateStatGraph( "TestStation-Fabric2s",
@@ -123,7 +190,12 @@
                              pie_graph_generator_file,
                              graph_saved_directory )
 }*/
+
+// Way to add list of the tests with specific category to the result
 def adder( testCat, set, getResult ){
+    // testCat : test Category ( Eg. FUNC, HA, SR ... )
+    // set : set of the test ( Eg. basic, extra_A ... )
+    // if getResult == true, it will add the result.
     result = ""
     for( String test in AllTheTests[ testCat ].keySet() ){
         if( AllTheTests[ testCat ][ test ][ set ] ){
@@ -133,6 +205,9 @@
     }
     return result
 }
+
+// check which node is on.
+// 1.12 runs on Fabric3 and rest on 1.13 and master
 def nodeOn( branch ){
     return branch == "1.12" ? 1 : 0;
 }
diff --git a/TestON/JenkinsFile/HAJenkinsFile b/TestON/JenkinsFile/HAJenkinsFile
index 7a0638d..7c9bafd 100644
--- a/TestON/JenkinsFile/HAJenkinsFile
+++ b/TestON/JenkinsFile/HAJenkinsFile
@@ -1,23 +1,56 @@
+// Copyright 2017 Open Networking Foundation (ONF)
+//
+// Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+// the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+// or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
+//
+//     TestON is free software: you can redistribute it and/or modify
+//     it under the terms of the GNU General Public License as published by
+//     the Free Software Foundation, either version 2 of the License, or
+//     (at your option) any later version.
+//
+//     TestON is distributed in the hope that it will be useful,
+//     but WITHOUT ANY WARRANTY; without even the implied warranty of
+//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//     GNU General Public License for more details.
+//
+//     You should have received a copy of the GNU General Public License
+//     along with TestON.  If not, see <http://www.gnu.org/licenses/>.
+
+// This is the Jenkins script for HA-pipeline-<branch>
+
 #!groovy
+
+// read the dependency files
 funcs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy' )
 test_lists = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsTestONTests.groovy' )
 fileRelated = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy' )
 
 fileRelated.init()
+
+// initialize the funcs with category of HA
 funcs.initialize( "HA" );
-// This is a Jenkinsfile for a scripted pipeline for the HA tests
+
+// This is a Jenkinsfile for a scripted pipeline for the FUNC tests
 def prop = null
+
+// Read the TestONOS.property from the VM
 prop = funcs.getProperties()
+
+// get the list of the test and init branch to it.
 HA = test_lists.getAllTheTests( prop[ "WikiPrefix" ] )[ "HA" ]
 
+// init some directories
 graph_generator_file = fileRelated.trendIndividual
 graph_saved_directory = fileRelated.jenkinsWorkspace + "postjob-VM/"
 
+// get the list of the test to run
 echo( "Testcases:" )
 def testsToRun = null
 testsToRun = funcs.getTestsToRun( prop[ "Tests" ] )
 funcs.printTestToRun( testsToRun )
 
+// run the test sequentially and save the function into the dictionary.
 def tests = [:]
 for( String test : HA.keySet() ){
     toBeRun = testsToRun.contains( test )
@@ -25,10 +58,15 @@
     tests[stepName] = funcs.runTest( test, toBeRun, prop, test, false, HA, graph_generator_file, graph_saved_directory )
 }
 
+// get the start time of the test.
 start = funcs.getCurrentTime()
-// run the tests
+// run the tests sequentially.
 for ( test in tests.keySet() ){
     tests[ test ].call()
 }
+
+// generate the overall graph of the HA tests.
 funcs.generateOverallGraph( prop, HA, graph_saved_directory )
+
+// send the notification to Slack that running HA tests was ended.
 funcs.sendResultToSlack( start,  prop[ "manualRun" ], prop[ "WikiPrefix" ] )
diff --git a/TestON/JenkinsFile/JenkinsfileTrigger b/TestON/JenkinsFile/JenkinsfileTrigger
index 6625355..2523a1c 100644
--- a/TestON/JenkinsFile/JenkinsfileTrigger
+++ b/TestON/JenkinsFile/JenkinsfileTrigger
@@ -1,9 +1,35 @@
+// Copyright 2017 Open Networking Foundation (ONF)
+//
+// Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+// the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+// or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
+//
+//     TestON is free software: you can redistribute it and/or modify
+//     it under the terms of the GNU General Public License as published by
+//     the Free Software Foundation, either version 2 of the License, or
+//     (at your option) any later version.
+//
+//     TestON is distributed in the hope that it will be useful,
+//     but WITHOUT ANY WARRANTY; without even the implied warranty of
+//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//     GNU General Public License for more details.
+//
+//     You should have received a copy of the GNU General Public License
+//     along with TestON.  If not, see <http://www.gnu.org/licenses/>.
+
+// This is the Jenkins script for all-pipeline-trigger
+
 #!groovy
+
+// read the dependency functions
 funcs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy' )
 
+// get current time and send the notification of starting the test.
 def now = funcs.getCurrentTime()
 print now.toString()
 today = now[ Calendar.DAY_OF_WEEK ]
+
+// read the passed parameters from the Jenkins.
 machines = params.machines
 manually_run = params.manual_run
 if( !manually_run ){
@@ -13,17 +39,20 @@
                         + "\n:sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles:" )
 }
 
+// store the list of the machines into the dictionary.
 machineList = machines.tokenize( "\n;, " )
 machineOn = [:]
 
+// save the triggering job function as a dictionary.
 for (machine in machineList){
     print( machine )
     machineOn[ machine ] = triggerJob( machine )
 }
 
+// run the triggering jobs concurrently.
 parallel machineOn
 
-
+// function that will trigger the specific jobs from current pipeline.
 def triggerJob( on ){
     return{
         jobToRun = on + "-pipeline-trigger"
diff --git a/TestON/JenkinsFile/Overall_Graph_Generator b/TestON/JenkinsFile/Overall_Graph_Generator
index f08f18a..e96a65f 100644
--- a/TestON/JenkinsFile/Overall_Graph_Generator
+++ b/TestON/JenkinsFile/Overall_Graph_Generator
@@ -1,18 +1,46 @@
+// Copyright 2017 Open Networking Foundation (ONF)
+//
+// Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+// the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+// or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
+//
+//     TestON is free software: you can redistribute it and/or modify
+//     it under the terms of the GNU General Public License as published by
+//     the Free Software Foundation, either version 2 of the License, or
+//     (at your option) any later version.
+//
+//     TestON is distributed in the hope that it will be useful,
+//     but WITHOUT ANY WARRANTY; without even the implied warranty of
+//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//     GNU General Public License for more details.
+//
+//     You should have received a copy of the GNU General Public License
+//     along with TestON.  If not, see <http://www.gnu.org/licenses/>.
+
+// This is the Jenkins script for manual-graph-generator-overall
+
 #!groovy
+
+// read the dependency functions.
 funcs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy' )
 test_lists = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsTestONTests.groovy' )
 fileRelated = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy' )
 
 fileRelated.init()
+
+// set the file and directory paths.
 stat_graph_generator_file = fileRelated.histogramMultiple
 pie_graph_generator_file = fileRelated.pieMultiple
 graph_saved_directory = fileRelated.jenkinsWorkspace + "postjob-VM/"
 
+// init trend which will generate the pie and histogram graphs to be VM.
 funcs.initializeTrend( "VM" )
 
 onos_branch = params.ONOSbranch
 AllTheTests = test_lists.getAllTheTests("")
 
+// generate the graph and post the result on TestStation-VMs. Right now, all the pie and histograms are saved
+// on VM.
 funcs.generateStatGraph( "TestStation-VMs",
                          onos_branch,
                          AllTheTests,
diff --git a/TestON/JenkinsFile/SCPFJenkinsFile b/TestON/JenkinsFile/SCPFJenkinsFile
index 5f039b5..a890608 100644
--- a/TestON/JenkinsFile/SCPFJenkinsFile
+++ b/TestON/JenkinsFile/SCPFJenkinsFile
@@ -1,19 +1,49 @@
+// Copyright 2017 Open Networking Foundation (ONF)
+//
+// Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+// the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+// or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
+//
+//     TestON is free software: you can redistribute it and/or modify
+//     it under the terms of the GNU General Public License as published by
+//     the Free Software Foundation, either version 2 of the License, or
+//     (at your option) any later version.
+//
+//     TestON is distributed in the hope that it will be useful,
+//     but WITHOUT ANY WARRANTY; without even the implied warranty of
+//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//     GNU General Public License for more details.
+//
+//     You should have received a copy of the GNU General Public License
+//     along with TestON.  If not, see <http://www.gnu.org/licenses/>.
+
+// This is the Jenkins script for SCPF-pipeline-<branch>
+
 #!groovy
+
+// read the dependency files
 SCPFfuncs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/PerformanceFuncs.groovy' )
 SCPFfuncs.init()
 funcs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy' )
+
+// init funcs with SCPF specificaton
 funcs.initialize( "SCPF", SCPFfuncs );
-// This is a Jenkinsfile for a scripted pipeline for the SCPF tests
+
+// read the information from TestON.property on BM
 def prop = null
 prop = funcs.getProperties()
 
+// get the list of the test to run.
 echo( "Testcases:" )
 def testsToRun = null
 testsToRun = funcs.getTestsToRun( prop[ "Tests" ] )
 funcs.printTestToRun( testsToRun )
 
+// check if it is using old flow.
 isOldFlow = prop[ "isOldFlow" ] == "true"
 SCPFfuncs.oldFlowRuleCheck( isOldFlow, prop[ "ONOSBranch" ] )
+
+// set test to run as a list of function
 def tests = [:]
 for( String test : SCPFfuncs.SCPF.keySet() ){
     toBeRun = testsToRun.contains( test )
@@ -23,9 +53,12 @@
     tests[ stepName ] = funcs.runTest( test, toBeRun, prop, pureTestName, false, SCPFfuncs.SCPF, "", "" )
 }
 
+// get start time
 start = funcs.getCurrentTime()
-// run the tests
+// run the tests sequentially
 for ( test in tests.keySet() ){
     tests[ test ].call()
 }
+
+// send result to slack after running test is done.
 funcs.sendResultToSlack( start,  prop["manualRun"], prop[ "WikiPrefix" ] )
diff --git a/TestON/JenkinsFile/SCPF_Graph_Generator b/TestON/JenkinsFile/SCPF_Graph_Generator
index 938faf8..146e72e 100644
--- a/TestON/JenkinsFile/SCPF_Graph_Generator
+++ b/TestON/JenkinsFile/SCPF_Graph_Generator
@@ -1,4 +1,27 @@
+// Copyright 2017 Open Networking Foundation (ONF)
+//
+// Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+// the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+// or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
+//
+//     TestON is free software: you can redistribute it and/or modify
+//     it under the terms of the GNU General Public License as published by
+//     the Free Software Foundation, either version 2 of the License, or
+//     (at your option) any later version.
+//
+//     TestON is distributed in the hope that it will be useful,
+//     but WITHOUT ANY WARRANTY; without even the implied warranty of
+//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//     GNU General Public License for more details.
+//
+//     You should have received a copy of the GNU General Public License
+//     along with TestON.  If not, see <http://www.gnu.org/licenses/>.
+
+// This is the Jenkins script for manual-graph-generator-SCPF
+
 #!groovy
+
+// read and set the functions from dependcies.
 SCPFfuncs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/PerformanceFuncs.groovy' )
 SCPFfuncs.init()
 funcs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy' )
@@ -7,6 +30,7 @@
 def prop = null
 prop = funcs.getProperties()
 
+// get the variables from the Jenkins parameters.
 def Tests = params.Test
 isOldFlow = params.isOldFlow
 prop[ "ONOSBranch" ] = params.ONOSbranch
@@ -16,6 +40,7 @@
 def testsToRun = null
 testsToRun = funcs.getTestsToRun( Tests )
 
+// pureTestName is because we don't want 'WFobj' to be used for test name.
 def tests = [:]
 for( String test : testsToRun ){
     println test
@@ -23,6 +48,8 @@
     tests[ test ] = funcs.runTest( test, true, prop, pureTestName, true, [], "", "" )
 }
 
-for ( test in tests.keySet() ){
-    tests[ test ].call()
-}
+// generate the graphs sequentially.
+parallel tests
+//for ( test in tests.keySet() ){
+//    tests[ test ].call()
+//}
diff --git a/TestON/JenkinsFile/SRJenkinsFile b/TestON/JenkinsFile/SRJenkinsFile
index c9c00e5..bc2ac39 100644
--- a/TestON/JenkinsFile/SRJenkinsFile
+++ b/TestON/JenkinsFile/SRJenkinsFile
@@ -1,25 +1,57 @@
+// Copyright 2017 Open Networking Foundation (ONF)
+//
+// Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+// the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+// or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
+//
+//     TestON is free software: you can redistribute it and/or modify
+//     it under the terms of the GNU General Public License as published by
+//     the Free Software Foundation, either version 2 of the License, or
+//     (at your option) any later version.
+//
+//     TestON is distributed in the hope that it will be useful,
+//     but WITHOUT ANY WARRANTY; without even the implied warranty of
+//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//     GNU General Public License for more details.
+//
+//     You should have received a copy of the GNU General Public License
+//     along with TestON.  If not, see <http://www.gnu.org/licenses/>.
+
+// This is the Jenkins script for SR-pipeline-<branch>
+
 #!groovy
+
+// read dependencies.
 funcs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy' )
 test_lists = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsTestONTests.groovy' )
 fileRelated = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy' )
 
+// init configuratin to be SR
 fileRelated.init()
 funcs.initialize( "SR" );
+
+// get the name of the Jenkins job.
 jobName = env.JOB_NAME
+
+// additional setup for Segment routing because it is running multiple branch concurrently on different machines.
 funcs.additionalInitForSR( jobName )
-// This is a Jenkinsfile for a scripted pipeline for the SR tests
+
+// read the TestON.property depends on which branch it is running. ( currently 1.13 and master on Fabric2, 1.12 on Fabric3 )
 def prop = null
 prop = funcs.getProperties()
 SR = test_lists.getAllTheTests( prop[ "WikiPrefix" ] )[ "SR" ]
 
+// set the file paths and directory
 graph_generator_file = fileRelated.trendIndividual
 graph_saved_directory = fileRelated.jenkinsWorkspace + "postjob-Fabric" + funcs.fabricOn( prop[ "ONOSBranch" ] ) + "/"
 
+// get the list of the tests.
 echo( "Testcases:" )
 def testsToRun = null
 testsToRun = funcs.getTestsToRun( prop[ "Tests" ] )
 funcs.printTestToRun( testsToRun )
 
+// save the functions to run test in the dictionary.
 def tests = [:]
 for( String test : SR.keySet() ){
     toBeRun = testsToRun.contains( test )
@@ -27,10 +59,13 @@
     tests[stepName] = funcs.runTest( test, toBeRun, prop, test, false, SR, graph_generator_file, graph_saved_directory )
 }
 
+// get start time
 start = funcs.getCurrentTime()
-// run the tests
+
+// run the tests sequentially
 for ( test in tests.keySet() ){
     tests[ test ].call()
 }
 //funcs.generateOverallGraph( prop, SR, graph_saved_directory )
+// send the notification of ending test after SR tests is done.
 funcs.sendResultToSlack( start,  prop[ "manualRun" ], prop[ "WikiPrefix" ] )
diff --git a/TestON/JenkinsFile/Trend_Graph_Generator b/TestON/JenkinsFile/Trend_Graph_Generator
index 3430b40..fbdd54b 100644
--- a/TestON/JenkinsFile/Trend_Graph_Generator
+++ b/TestON/JenkinsFile/Trend_Graph_Generator
@@ -1,32 +1,62 @@
+// Copyright 2017 Open Networking Foundation (ONF)
+//
+// Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+// the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+// or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
+//
+//     TestON is free software: you can redistribute it and/or modify
+//     it under the terms of the GNU General Public License as published by
+//     the Free Software Foundation, either version 2 of the License, or
+//     (at your option) any later version.
+//
+//     TestON is distributed in the hope that it will be useful,
+//     but WITHOUT ANY WARRANTY; without even the implied warranty of
+//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//     GNU General Public License for more details.
+//
+//     You should have received a copy of the GNU General Public License
+//     along with TestON.  If not, see <http://www.gnu.org/licenses/>.
+
+// This is the Jenkins script for manual-graph-generator-trend
+
 #!groovy
+
+// read the dependency functions
 funcs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy' )
 fileRelated = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy' )
 
 fileRelated.init()
+
+// read the node cluster ( VM or BM or Fabrics ) from the Jenkins job.
 nodeCluster = params.NodeCluster
 
 funcs.initializeTrend( nodeCluster );
+
+// do additional check for Fabric since it will be different depends on which branch it is running on.
 if( nodeCluster == "Fabric" )
   funcs.additionalInitForSR( params.ONOSbranch )
 def prop = null
 prop = funcs.getProperties()
 
+// get the list of the tests from the parameters.
 def Tests = params.Test
 prop[ "ONOSBranch" ] = params.ONOSbranch
 
-
+// set some of the paths of the file and directory
 graph_generator_file = fileRelated.trendIndividual
 graph_saved_directory = fileRelated.jenkinsWorkspace + "postjob-" + nodeCluster + ( nodeCluster == "Fabric" ? funcs.fabricOn( prop[ "ONOSBranch" ] ) : "" ) + "/"
 
 def testsToRun = null
 testsToRun = funcs.getTestsToRun( Tests )
 
+// set functions into the dictionary.
 def tests = [:]
 for( String test : testsToRun ){
     println test
     tests[ test ] = funcs.runTest( test, true, prop, test, true, [], graph_generator_file, graph_saved_directory )
 }
 
-for ( test in tests.keySet() ){
-    tests[ test ].call()
-}
+parallel tests
+//for ( test in tests.keySet() ){
+//    tests[ test ].call()
+//}
diff --git a/TestON/JenkinsFile/USECASEJenkinsFile b/TestON/JenkinsFile/USECASEJenkinsFile
index 6493914..98b58da 100644
--- a/TestON/JenkinsFile/USECASEJenkinsFile
+++ b/TestON/JenkinsFile/USECASEJenkinsFile
@@ -1,23 +1,51 @@
+// Copyright 2017 Open Networking Foundation (ONF)
+//
+// Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+// the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+// or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
+//
+//     TestON is free software: you can redistribute it and/or modify
+//     it under the terms of the GNU General Public License as published by
+//     the Free Software Foundation, either version 2 of the License, or
+//     (at your option) any later version.
+//
+//     TestON is distributed in the hope that it will be useful,
+//     but WITHOUT ANY WARRANTY; without even the implied warranty of
+//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//     GNU General Public License for more details.
+//
+//     You should have received a copy of the GNU General Public License
+//     along with TestON.  If not, see <http://www.gnu.org/licenses/>.
+
+// This is the Jenkins script for USECASE-pipeline-<branch>
+
 #!groovy
+
+// set the dependencies.
 funcs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy' )
 test_lists = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsTestONTests.groovy' )
 fileRelated = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy' )
 
+// init configuration of funcs to be USECASE
 fileRelated.init()
 funcs.initialize( "USECASE" );
-// This is a Jenkinsfile for a scripted pipeline for the USECASE tests
+
+// read the TestON.property files and save it as a dictionary
 def prop = null
 prop = funcs.getProperties()
 USECASE = test_lists.getAllTheTests( prop[ "WikiPrefix" ] )[ "USECASE" ]
 
+// save directory and file.
 graph_generator_file = fileRelated.trendIndividual
 graph_saved_directory = fileRelated.jenkinsWorkspace + "postjob-BM/"
 
+// get tests to run.
 echo( "Testcases:" )
 def testsToRun = null
 testsToRun = funcs.getTestsToRun( prop[ "Tests" ] )
 funcs.printTestToRun( testsToRun )
 
+// save the function of the test running into the dictionary.
 def tests = [:]
 for( String test : USECASE.keySet() ){
     toBeRun = testsToRun.contains( test )
@@ -25,10 +53,15 @@
     tests[ stepName ] = funcs.runTest( test, toBeRun, prop, test, false, USECASE, graph_generator_file, graph_saved_directory )
 }
 
+// get start time of the test.
 start = funcs.getCurrentTime()
-// run the tests
+// run the tests sequntially
 for ( test in tests.keySet() ){
     tests[ test ].call()
 }
+
+// send the result to slack after USECASE test is done.
 funcs.sendResultToSlack( start,  prop[ "manualRun" ], prop[ "WikiPrefix" ] )
+
+// generate the overall graph for USECASE.
 funcs.generateOverallGraph( prop, USECASE, graph_saved_directory )
diff --git a/TestON/JenkinsFile/VM_BMJenkinsfileTrigger b/TestON/JenkinsFile/VM_BMJenkinsfileTrigger
index 119b427..ee7a5ed 100644
--- a/TestON/JenkinsFile/VM_BMJenkinsfileTrigger
+++ b/TestON/JenkinsFile/VM_BMJenkinsfileTrigger
@@ -1,17 +1,48 @@
+// Copyright 2017 Open Networking Foundation (ONF)
+//
+// Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+// the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+// or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
+//
+//     TestON is free software: you can redistribute it and/or modify
+//     it under the terms of the GNU General Public License as published by
+//     the Free Software Foundation, either version 2 of the License, or
+//     (at your option) any later version.
+//
+//     TestON is distributed in the hope that it will be useful,
+//     but WITHOUT ANY WARRANTY; without even the implied warranty of
+//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//     GNU General Public License for more details.
+//
+//     You should have received a copy of the GNU General Public License
+//     along with TestON.  If not, see <http://www.gnu.org/licenses/>.
+
+// This is the Jenkins script for vm-pipeline-trigger or bm-pipeline-trigger
+
 #!groovy
 
+// set the functions of the dependencies.
 funcs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy' )
 test_lists = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsTestONTests.groovy' )
 triggerFuncs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/TriggerFuncs.groovy' )
 fileRelated = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy' )
 
+// set the versions of the onos
 fileRelated.init()
 current_version = "master"
 previous_version = "1.13"
 before_previous_version = "1.12"
+
+// init trend graphs to be on VM.
 funcs.initializeTrend( "VM" );
 triggerFuncs.init( funcs )
+
+// contents for page https://wiki.onosproject.org/display/ONOS/Automated+Test+Schedule
+// which will demonstrates the list of the scheduled tests on the days.
 wikiContents = ""
+
+// default FUNC,HA to be VM, SCPF,USECASE to be BM.
+// SR will not be used in here.
 testcases = [
     "FUNC" : [ tests : "" , nodeName : "VM", wikiContent : "" ],
     "HA" : [ tests : "" , nodeName : "VM", wikiContent : "" ],
@@ -19,6 +50,8 @@
     "SR" : [ tests : "", nodeName : "Fabric", wikiContent : "" ],
     "USECASE" : [ tests : "" , nodeName : "BM", wikiContent : "" ]
 ]
+
+// depends on the first two characters of the test name, it will be divided.
 Prefix_organizer = [
     "FU" : "FUNC",
     "HA" : "HA",
@@ -30,7 +63,10 @@
     "VP" : "USECASE"
 ]
 
+// read the parameters from the Jenkins
 manually_run = params.manual_run
+
+// set default onos_b to be current_version.
 onos_b = current_version
 test_branch = ""
 onos_tag = params.ONOSTag
@@ -41,28 +77,39 @@
 print now.toString()
 today = now[ Calendar.DAY_OF_WEEK ]
 
+// get branch from parameter if it is manually running
 if ( manually_run ){
     onos_b = params.ONOSVersion
 } else {
+    // otherwise, the version would be different over the weekend.
+    // If today is weekdays, it will be default to current_version.
     if ( today == Calendar.SATURDAY ){
         onos_b = previous_version
     } else if( today == Calendar.SUNDAY ){
         onos_b = before_previous_version
     }
 }
+
+// Get all the list of the tests from the JenkinsTestONTests.groovy
 AllTheTests = test_lists.getAllTheTests( onos_b )
 
+// list of the tests to be run will be saved in each choices.
 day = ""
 SCPF_choices = ""
 USECASE_choices = ""
 FUNC_choices = ""
 HA_choices = ""
 SR_choices = ""
+
+// init some paths for the files and directories.
 stat_graph_generator_file = fileRelated.histogramMultiple
 pie_graph_generator_file = fileRelated.pieMultiple
 graph_saved_directory = fileRelated.jenkinsWorkspace + "postjob-VM/"
 
+// get post result from the params for manually run.
 post_result = params.PostResult
+
+// if automatically run, it will remove the comma at the end after dividing the tests.
 if( !manually_run ){
     testDivider( today )
     FUNC_choices =  triggerFuncs.lastCommaRemover( FUNC_choices )
@@ -72,6 +119,7 @@
     SR_choices =  triggerFuncs.lastCommaRemover( SR_choices )
 }
 
+
 if ( manually_run ){
     testcases = triggerFuncs.organize_tests( params.Tests, testcases )
 
@@ -92,6 +140,8 @@
     "VM" : [:],
     "BM" : [:]
 ]
+
+// set the test running function into the dictionary.
 for( String test in testcases.keySet() ){
     println test
     if ( testcases[ test ][ "tests" ] != "" ){
@@ -99,15 +149,22 @@
     }
 }
 def finalList = [:]
+
+// get the name of the job.
 jobName = env.JOB_NAME
+
+// first set the list of the functions to be run.
 finalList[ "VM" ] = triggerFuncs.runTestSeq( runTest[ "VM" ] )
 finalList[ "BM" ] = triggerFuncs.runTestSeq( runTest[ "BM" ] )
-//parallel finalList
+
+// if first two character of the job name is vm, only call VM.
+// else, only on BM
 if( jobName.take( 2 ) == "vm" )
     finalList[ "VM" ].call()
 else
     finalList[ "BM" ].call()
 
+// If it is automated running, it will generate the stats graph on VM.
 if ( !manually_run ){
     funcs.generateStatGraph( "TestStation-VMs",
                              funcs.branchWithPrefix( onos_b ),
@@ -117,9 +174,13 @@
                              graph_saved_directory )
 }
 
+// function that will divide tests depends on which day it is.
 def testDivider( today ){
     switch ( today ) {
         case Calendar.MONDAY:
+            // THe reason Monday calls all the days is because we want to post the test schedules on the wiki
+            // and slack channel every monday.
+            // It will only generate the list of the test for monday.
             initHtmlForWiki()
             monday( true )
             tuesday( true, false )
@@ -159,8 +220,13 @@
             break
     }
 }
+
+// function for monday.
 def monday( getResult ){
+    // add header for wiki page script.
     addingHeader( "FUNC" )
+    // call category of basic and extra_A of FUNC tests.
+    // put M into the dictionary.
     FUNC_choices += adder( "FUNC", "basic", true, "M", getResult )
     FUNC_choices += adder( "FUNC", "extra_A", true, "M", getResult )
     closingHeader( "FUNC" )
@@ -178,6 +244,9 @@
     addingHeader( "USECASE" )
     closingHeader( "USECASE" )
 }
+
+// If get result is false, it will not add the test result to xx_choices, but will generate the
+// header and days
 def tuesday( getDay, getResult ){
     addingHeader( "FUNC" )
     FUNC_choices += adder( "FUNC", "basic", getDay, "T", getResult )
@@ -309,7 +378,15 @@
     USECASE_choices += adder( "USECASE", "basic", getDay, "S", getResult )
     closingHeader( "USECASE" )
 }
+
+// adder that will return the list of the tests.
 def adder( testCat, set, dayAdding, day, getResult ){
+    // testCat : the category of the test which will be either FUNC,HA,SR...
+    // set : the set of the test to be run which will be basic,extra_A,extra_B...
+    // dayAdding : boolean whether to add the days into the list or not
+    // day : the day you are trying to add (m,t,w,th... )
+    // getResult : if want to get the list of the test to be run. False will return empty list.
+    //             And once the list is empty, it will not be run.
     result = ""
     for( String test in AllTheTests[ testCat ].keySet() ){
         if( AllTheTests[ testCat ][ test ][ set ] ){
@@ -317,11 +394,14 @@
                 result += test + ","
             if( dayAdding )
                 dayAdder( testCat, test, day )
+            // make HTML columns for wiki page on schedule.
             makeHtmlColList( testCat, test )
         }
     }
     return result
 }
+
+// Initial part of the wiki page.
 def initHtmlForWiki(){
     wikiContents = '''
     <table class="wrapped confluenceTable">
@@ -352,21 +432,29 @@
                 <th colspan="1" class="confluenceTh">''' + test + '''</th>'''
     }
 }
+
+// adding header functionality.
 def addingHeader( testCategory ){
     testcases[ testCategory ][ 'wikiContent' ] += '''
                 <td class="confluenceTd">
                     <ul>'''
 }
+
+// making column list for html
 def makeHtmlColList( testCategory, testName ){
     testcases[ testCategory ][ 'wikiContent' ] += '''
                         <li>'''+ testName +'''</li>'''
 
 }
+
+// closing the header for html
 def closingHeader( testCategory ){
     testcases[ testCategory ][ 'wikiContent' ] += '''
                     </ul>
                 </td>'''
 }
+
+// close the html for the wiki page.
 def closeHtmlForWiki(){
     for( String test in testcases.keySet() ){
         wikiContents += testcases[ test ][ 'wikiContent' ]
@@ -381,6 +469,8 @@
     <p>On <strong>Saturdays</strong>, all the other tests are built and run on the '''+ funcs.branchWithPrefix( previous_version ) +''' branch.</p>
     <p>On <strong>Sundays</strong>, all the other tests are built and run on the '''+ funcs.branchWithPrefix( before_previous_version ) +''' branch.</p>'''
 }
+
+// post the result to wiki page using publish to confluence.
 def postToWiki( contents ){
     node( testMachine ){
         workspace = fileRelated.jenkinsWorkspace + "all-pipeline-trigger/"
@@ -391,6 +481,8 @@
                                    workspace + filename )
     }
 }
+
+// add the day to the "day" on the dictionary.
 def dayAdder( testCat, testName, dayOfWeek ){
     AllTheTests[ testCat ][ testName ][ "day" ] += dayOfWeek + ","
 }
diff --git a/TestON/JenkinsFile/dependencies/GeneralFuncs.groovy b/TestON/JenkinsFile/dependencies/GeneralFuncs.groovy
index a0c70c9..7618fe0 100644
--- a/TestON/JenkinsFile/dependencies/GeneralFuncs.groovy
+++ b/TestON/JenkinsFile/dependencies/GeneralFuncs.groovy
@@ -1,11 +1,38 @@
+// Copyright 2017 Open Networking Foundation (ONF)
+//
+// Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+// the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+// or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
+//
+//     TestON is free software: you can redistribute it and/or modify
+//     it under the terms of the GNU General Public License as published by
+//     the Free Software Foundation, either version 2 of the License, or
+//     (at your option) any later version.
+//
+//     TestON is distributed in the hope that it will be useful,
+//     but WITHOUT ANY WARRANTY; without even the implied warranty of
+//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//     GNU General Public License for more details.
+//
+//     You should have received a copy of the GNU General Public License
+//     along with TestON.  If not, see <http://www.gnu.org/licenses/>.
+
+// This is the dependency Jenkins script.
+// it has some general functionality of making database command, basic graph part, and get list of the test
+
 #!groovy
 
+// make the init part of the database command
 def database_command_create( pass, host, port, user ){
   return pass + "|psql --host=" + host + " --port=" + port + " --username=" + user + " --password --dbname onostest -c "
 }
+
+// make the basic graph part for the Rscript
 def basicGraphPart( rFileName, host, port, user, pass, subject, branchName ){
   return " Rscript " + rFileName + " " + host + " " + port + " " + user + " " + pass + " " + subject + " " + branchName
 }
+
+// get the list of the test as dictionary then return as a string
 def getTestList( tests ){
     list = ""
     for( String test : tests.keySet() )
diff --git a/TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy b/TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy
index 8c480d3..2b3a23a 100644
--- a/TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy
+++ b/TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy
@@ -1,3 +1,25 @@
+// Copyright 2017 Open Networking Foundation (ONF)
+//
+// Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+// the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+// or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
+//
+//     TestON is free software: you can redistribute it and/or modify
+//     it under the terms of the GNU General Public License as published by
+//     the Free Software Foundation, either version 2 of the License, or
+//     (at your option) any later version.
+//
+//     TestON is distributed in the hope that it will be useful,
+//     but WITHOUT ANY WARRANTY; without even the implied warranty of
+//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//     GNU General Public License for more details.
+//
+//     You should have received a copy of the GNU General Public License
+//     along with TestON.  If not, see <http://www.gnu.org/licenses/>.
+
+// This is the dependency Jenkins script.
+// it has some common functions that runs test and generate graph.
+
 #!groovy
 import groovy.time.*
 generalFuncs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/GeneralFuncs.groovy' )
@@ -6,6 +28,9 @@
 fileRelated.init()
 
 def initializeTrend( machine ){
+  // For initializing any trend graph jobs
+  // machine : Either VM,BM, or Fabric#
+
   table_name = "executed_test_tests"
   result_name = "executed_test_results"
   testMachine = "TestStation-" + machine + "s";
@@ -14,12 +39,19 @@
   isTrend = true
 }
 def initialize( type, SCPFfuncs ){
+  // Initializing for SCPF tests
+  // type : type of the test ( SR,FUNC,SCPF... )
+  // Passing the SCPFfunction which will be PerformanceFuncs.groovy
+
   init( type )
   SCPFfunc = SCPFfuncs
   isSCPF = true
   machine = machineType[ type ]
 }
 def initialize( type ){
+  // initializing for FUNC,HA,SR, and USECASE
+  // type : type of the test ( SR,FUNC,SCPF... )
+
   init( type )
   SCPFfunc = null
   table_name = "executed_test_tests"
@@ -29,6 +61,8 @@
   isSCPF = false
 }
 def init( type ){
+  // type : type of the test ( SR,FUNC,SCPF... )
+
   machineType = [ "FUNC"    : "VM",
                   "HA"      : "VM",
                   "SR"      : "Fabric",
@@ -39,6 +73,9 @@
   isTrend = false
 }
 def additionalInitForSR( branch ){
+  // additional setup for SegmentRouting tests to determine the machine depends on the branch it is running.
+  // branch : branch of the onos. ( master, 1.12, 1.13... )
+
   testMachine = ( ( new StringBuilder( testMachine ) ).insert( testMachine.size()-1, fabricOn( branch ) ) ).toString()
   if( isTrend )
     machine += fabricOn( branch )
@@ -47,33 +84,53 @@
   print testMachine
 }
 def fabricOn( branch ){
+  // gets the fabric machines with the branch of onos.
+  // branch : master, 1.12, 1.13...
+
   return branch.reverse().take(4).reverse() == "1.12" ? '3' : '2'
 }
 def printType(){
+  // print the test type and test machine that was initialized.
+
   echo testType;
   echo testMachine;
 }
 def getProperties(){
+  // get the properties of the test by reading the TestONOS.property
+
   node( testMachine ){
     return readProperties( file:'/var/jenkins/TestONOS.property' );
   }
 }
 def getTestsToRun( testList ){
+  // get test to run by tokenizing the list.
+
   testList.tokenize("\n;, ")
 }
 def getCurrentTime(){
+  // get time of the PST zone.
+
   TimeZone.setDefault( TimeZone.getTimeZone('PST') )
   return new Date();
 }
 def getTotalTime( start, end ){
+  // get total time of the test using start and end time.
+
   return TimeCategory.minus( end, start );
 }
 def printTestToRun( testList ){
+  // printout the list of the test in the list.
+
   for ( String test : testList ) {
       println test;
   }
 }
 def sendResultToSlack( start, isManualRun, branch ){
+  // send the result of the test to the slack when it is not manually running.
+  // start : start time of the test
+  // isManualRun : string that is whether "false" or "true"
+  // branch : branch of the onos.
+
   try{
     if( isManualRun == "false" ){
         end = getCurrentTime();
@@ -85,7 +142,11 @@
   catch( all ){}
 }
 def initAndRunTest( testName, testCategory ){
-  // after ifconfig : ''' + borrowCell( testName ) + '''
+  // Bash script that will
+  // Initialize the environment to the machine and run the test.
+  // testName : name of the test
+  // testCategory : (SR,FUNC ... )
+
   return '''#!/bin/bash -l
         set -i # interactive
         set +e
@@ -111,6 +172,9 @@
         git clean -df'''
 }
 def copyLogs( testName ){
+  // bash script part for copy the logs and other neccessary element for SR tests.
+  // testName : name of the test.
+
   result = ""
     if( testType == "SR" ){
       result = '''
@@ -125,6 +189,9 @@
   return result
 }
 def cleanAndCopyFiles( testName ){
+  // clean up some files that were in the folder and copy the new files from the log
+  // testName : name of the test
+
   return '''#!/bin/bash -i
         set +e
         echo "ONOS Branch is: ${ONOSBranch}"
@@ -150,6 +217,9 @@
         cd '''
 }
 def fetchLogs( testName ){
+  // fetch the logs of onos from onos nodes to onos System Test logs
+  // testName: name of the test
+
   return '''#!/bin/bash
   set +e
   cd ~/OnosSystemTest/TestON/logs
@@ -169,14 +239,25 @@
   cd'''
 }
 def isPostingResult( manual, postresult ){
+  // check if it is posting the result.
+  // posting when it is automatically running or has postResult condition from the manual run
+
   return manual == "false" || postresult == "true"
 }
 def postResult( prop, graphOnly ){
+  // post the result by triggering postjob.
+  // prop : property dictionary that was read from the machine.
+  // graphOnly : if it is graph generating job
+
   if( graphOnly || isPostingResult( prop[ "manualRun" ], prop[ "postResult" ] ) ){
     def post = build job: "postjob-" + ( graphOnly ? machine : machineType[ testType ] ), propagate: false
   }
 }
 def postLogs( testName, prefix ){
+  // posting logs of the onos jobs specifically SR tests
+  // testName : name of the test
+  // prefix : branch prefix ( master, 1.12, 1.13 ... )
+
   resultURL = ""
   if( testType == "SR" ){
     def post = build job: "SR-log-" + prefix, propagate: false
@@ -185,9 +266,21 @@
   return resultURL
 }
 def getSlackChannel(){
+  // get name of the slack channel.
+  // if the test is SR, it will return sr-failures
+
   return "#" + ( testType == "SR" ? "sr-failures" : "jenkins-related" )
 }
 def analyzeResult( prop, workSpace, testName, otherTestName, resultURL, wikiLink, isSCPF ){
+  // analyzing the result of the test and send to slack if the test was failed.
+  // prop : property dictionary
+  // workSpace : workSpace where the result file is saved
+  // testName : real name of the test
+  // otherTestName : other name of the test for SCPF tests ( SCPFflowTPFobj )
+  // resultURL : url for the logs for SR tests. Will not be posted if it is empty
+  // wikiLink : link of the wiki page where the result was posted
+  // isSCPF : Check if it is SCPF. If so, it won't post the wiki link.
+
   node( testMachine ){
     resultContents = readFile workSpace + "/" + testName + "Result.txt"
     resultContents = resultContents.split("\n")
@@ -209,6 +302,12 @@
   }
 }
 def publishToConfluence( isManualRun, isPostResult, wikiLink, file ){
+  // publish HTML script to wiki confluence
+  // isManualRun : string "true" "false"
+  // isPostResult : string "true" "false"
+  // wikiLink : link of the wiki page to publish
+  // file : name of the file to be published
+
   if( isPostingResult( isManualRun, isPostResult ) ){
     publishConfluence siteName: 'wiki.onosproject.org', pageName: wikiLink, spaceName: 'ONOS',
                   attachArchivedArtifacts: true, buildIfUnstable: true,
@@ -219,6 +318,16 @@
 
 }
 def runTest( testName, toBeRun, prop, pureTestName, graphOnly, testCategory, graph_generator_file, graph_saved_directory ) {
+  // run the test on the machine that contains all the steps : init and run test, copy files, publish result ...
+  // testName : name of the test
+  // toBeRun : boolean value whether the test will be run or not. If not, it won't be run but shows up with empty result on pipeline view
+  // prop : dictionary property on the machine
+  // pureTestName : Pure name of the test. ( ex. pureTestName of SCPFflowTpFobj will be SCPFflowTp )
+  // graphOnly : check if it is generating graph job. If so, it will only generate the generating graph part
+  // testCategory : category of the test ( SCPF, SR, FUNC ... )
+  // graph_generator_file : Rscript file with the full path.
+  // graph_saved_directory : where the generated graph will be saved to.
+
   return {
       catchError{
           stage( testName ) {
@@ -259,17 +368,15 @@
       }
   }
 }
-def borrowCell( testName ){
-  result = ""
-  if( testType == "SR" ){
-      result = '''
-      cd
-      source ~/borrow.cell
-      '''
-  }
-  return result
-}
 def databaseAndGraph( prop, testName, graphOnly, graph_generator_file, graph_saved_directory ){
+  // part where it insert the data into the database.
+  // It will use the predefined encrypted variables from the Jenkins.
+  // prop : property dictionary that was read from the machine
+  // testName : name of the test
+  // graphOnly : boolean whether it is graph only or not
+  // graph_generator_file : Rscript file with the full path.
+  // graph_saved_directory : where the generated graph will be saved to.
+
   if( graphOnly || isPostingResult( prop[ "manualRun" ], prop[ "postResult" ] ) ){
       // Post Results
       withCredentials( [
@@ -288,6 +395,17 @@
   }
 }
 def generateCategoryStatsGraph( testMachineOn, manualRun, postresult, stat_file, pie_file, type, branch, testListPart, save_path, pieTestListPart ){
+  // function that will generate the category stat graphs for the overall test.
+  // testMachineOn : the machine the graph will be generated. It will be TestStation-VMs for the most cases
+  // manualRun : string of "true" or "false"
+  // postresult : string of "true" or "false"
+  // stat_file : file name with full path for Rscript for the stat graph
+  // pie_file : file name with full path for Rscript for the pie graph
+  // type : type of the test ( USECASE, FUNC, HA )
+  // branch : branch of the test ( master, onos-1.12, onos-1.13 )
+  // testListPart : list of the test to be included
+  // save_path : path that will save the graphs to
+  // pieTestListPart : list of the test for pie graph
 
   if( isPostingResult( manualRun, postresult ) ){
     node( testMachineOn ){
@@ -307,12 +425,22 @@
     }
 }
 def makeTestList( list, commaNeeded ){
+  // make the list of the test in to a string.
+  // list : list of the test
+  // commaNeeded : if comma is needed for the string
+
   return generalFuncs.getTestList( list ) + ( commaNeeded ? "," : "" )
 }
 def createStatsList( testCategory, list, semiNeeded ){
+  // make the list for stats
+  // testCategory : category of the test
+  // list : list of the test
+  // semiNeeded: if semi colon is needed
+
   return testCategory + "-" + generalFuncs.getTestList( list ) + ( semiNeeded ? ";" : "" )
 }
 def generateOverallGraph( prop, testCategory, graph_saved_directory ){
+  // generate the overall graph for the test
 
   if( isPostingResult( prop[ "manualRun" ], prop[ "postResult" ] ) ){
     node( testMachine ){
@@ -331,15 +459,23 @@
     }
 }
 def getOverallPieGraph( file, host, port, user, pass, branch, type, testList, yOrN, path ){
+   // Rcommand for the pie graph
+
    return generalFuncs.basicGraphPart( file, host, port, user, pass, type, branch ) + " \"" + testList + "\" latest " + yOrN + " " + path
 }
 def sqlCommand( testName ){
+  // get the inserting sqlCommand for non-SCPF tests.
+
   return "\"INSERT INTO " + table_name + " VALUES('\$DATE','" + result_name + "','" + testName + "',\$BUILD_NUMBER, '\$ONOSBranch', \$line);\" "
 }
 def graphGenerating( host, port, user, pass, testName, prop, graph_saved_directory, graph_generator_file ){
+  // get the graphGenerating R command for non-SCPF tests
+
   return generalFuncs.basicGraphPart( graph_generator_file, host, port, user, pass, testName, prop[ "ONOSBranch" ] ) + " 20 " + graph_saved_directory
 }
 def databasePart( wikiPrefix, testName, database_command ){
+  // to read and insert the data from .csv to the database
+
   return '''
     sed 1d ''' + workSpace + "/" + wikiPrefix + "-" + testName + '''.csv | while read line
     do
@@ -348,6 +484,8 @@
     done '''
 }
 def generateStatGraph( testMachineOn, onos_branch, AllTheTests, stat_graph_generator_file, pie_graph_generator_file, graph_saved_directory ){
+    // Will generate the stats graph.
+
     testListPart = createStatsList( "FUNC", AllTheTests[ "FUNC" ], true ) +
                    createStatsList( "HA", AllTheTests[ "HA" ], true ) +
                    createStatsList( "USECASE", AllTheTests[ "USECASE" ], false )
@@ -357,6 +495,7 @@
     generateCategoryStatsGraph( testMachineOn, "false", "true", stat_graph_generator_file, pie_graph_generator_file, "ALL", onos_branch, testListPart, graph_saved_directory, pieTestList )
 }
 def branchWithPrefix( branch ){
+    // get the branch with the prefix ( "onos-" )
     return ( ( branch != "master" ) ? "onos-" : "" ) + branch
 }
 return this;
diff --git a/TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy b/TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy
index fc89730..b2c30c5 100644
--- a/TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy
+++ b/TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy
@@ -1,5 +1,28 @@
+// Copyright 2017 Open Networking Foundation (ONF)
+//
+// Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+// the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+// or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
+//
+//     TestON is free software: you can redistribute it and/or modify
+//     it under the terms of the GNU General Public License as published by
+//     the Free Software Foundation, either version 2 of the License, or
+//     (at your option) any later version.
+//
+//     TestON is distributed in the hope that it will be useful,
+//     but WITHOUT ANY WARRANTY; without even the implied warranty of
+//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//     GNU General Public License for more details.
+//
+//     You should have received a copy of the GNU General Public License
+//     along with TestON.  If not, see <http://www.gnu.org/licenses/>.
+
+// This is the dependency Jenkins script.
+// This will initialize the paths of the jenkins file and paths.
+
 #!groovy
 
+// init the paths for the directory
 def initLocation(){
     jenkinsFolder = "~/OnosSystemTest/TestON/JenkinsFile/"
     rScriptLocation = jenkinsFolder + "wikiGraphRScripts/"
@@ -7,6 +30,8 @@
     SCPFSpecificLocation = rScriptLocation + "SCPFspecificGraphRScripts/"
     CHOScriptDir = "~/CHO_Jenkins_Scripts/"
 }
+
+// init the paths for the files.
 def initFiles(){
     trendIndividual = rScriptLocation + "trendIndividualTest.R"
     trendMultiple = rScriptLocation + "trendMultipleTests.R"
@@ -15,6 +40,8 @@
     histogramMultiple = rScriptLocation + "histogramMultipleTestGroups.R"
     pieMultiple = rScriptLocation + "pieMultipleTests.R"
 }
+
+// init both directory and file paths.
 def init(){
     initLocation()
     initFiles()
diff --git a/TestON/JenkinsFile/dependencies/JenkinsTestONTests.groovy b/TestON/JenkinsFile/dependencies/JenkinsTestONTests.groovy
index ac27a0c..a47e4c0 100644
--- a/TestON/JenkinsFile/dependencies/JenkinsTestONTests.groovy
+++ b/TestON/JenkinsFile/dependencies/JenkinsTestONTests.groovy
@@ -1,6 +1,37 @@
+// Copyright 2017 Open Networking Foundation (ONF)
+//
+// Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+// the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+// or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
+//
+//     TestON is free software: you can redistribute it and/or modify
+//     it under the terms of the GNU General Public License as published by
+//     the Free Software Foundation, either version 2 of the License, or
+//     (at your option) any later version.
+//
+//     TestON is distributed in the hope that it will be useful,
+//     but WITHOUT ANY WARRANTY; without even the implied warranty of
+//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//     GNU General Public License for more details.
+//
+//     You should have received a copy of the GNU General Public License
+//     along with TestON.  If not, see <http://www.gnu.org/licenses/>.
+
+// This is the dependency Jenkins script.
+// This will provide the basic information for the tests for scheduling.
+// Any new test to be added should be added here.
+
 #!groovy
 
 def getAllTheTests( wikiPrefix ){
+    // This contains the dictionary of the test and the category of them
+    // wikiPrefix : master, 1.13, 1.12 ...
+
+    // category: it will be used to distinguish which category to be run on which days ( basic,extra_A, extra_B ... )
+    // day: it will be used to display the schedule of the test to be run to the slack. It is empty in the first place but will be
+    //     filled out every monday.
+    // wiki_link : link of the wiki page that will be used to publish to confluence later on. SCPF tests don't need one.
+
     return [
         "FUNC":[
                 "FUNCipv6Intent" : [ "basic":true, "extra_A":false, "extra_B":false, "new_Test":false, "day":"", wiki_link:wikiPrefix + "-" + "FUNCipv6Intent", wiki_file:"FUNCipv6IntentWiki.txt" ],
diff --git a/TestON/JenkinsFile/dependencies/PerformanceFuncs.groovy b/TestON/JenkinsFile/dependencies/PerformanceFuncs.groovy
index a759051..65f9cb5 100644
--- a/TestON/JenkinsFile/dependencies/PerformanceFuncs.groovy
+++ b/TestON/JenkinsFile/dependencies/PerformanceFuncs.groovy
@@ -1,12 +1,54 @@
+// Copyright 2017 Open Networking Foundation (ONF)
+//
+// Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+// the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+// or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
+//
+//     TestON is free software: you can redistribute it and/or modify
+//     it under the terms of the GNU General Public License as published by
+//     the Free Software Foundation, either version 2 of the License, or
+//     (at your option) any later version.
+//
+//     TestON is distributed in the hope that it will be useful,
+//     but WITHOUT ANY WARRANTY; without even the implied warranty of
+//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//     GNU General Public License for more details.
+//
+//     You should have received a copy of the GNU General Public License
+//     along with TestON.  If not, see <http://www.gnu.org/licenses/>.
+
+// This is the dependency Jenkins script.
+// This will provide the SCPF specific functions
+
 #!groovy
 fileRelated = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy' )
 
 fileRelated.init()
 def init(){
+    // init step for SCPFfunctions. It has some mandatory init steps
+
+    // none, batches, neighbors, times : to be used for extra parameters for generating graphs.
     none = [ "" ]
     batches = [ 1, 100, 1000 ]
     neighbors = [ 'y', 'n' ]
     times = [ 'y', 'n' ]
+
+    //flows : whether the test is affected by oldFlow or newFlow
+    // test : command of the test to be executed when running the test
+    // table : name of the view table on database
+    // result : name of the actual table on database
+    // file : name of the file that contains the result of the test to be used to insert data to database
+    // rFile : specific Rscript file name to be used to generate each SCPF graph. For with flowObj graphs, you need to put 'n' or 'y' after the test name
+    // extra : extra condition that will be used for Rscript parameter. Some of the Rscript requires extra parameters like if it has
+    //         neighbors or batches. In this case, it will generate Rscript x times of what extra has. So that it will generate one with
+    //         neighbor = y and the other with neighbor = n
+    // finalResult : If you want to generate overall graph for the front page.
+    // graphTitle : title for the graph. It should contain n numbers depends on how many graphs you are generating.
+    // [Optional]
+    // dbCols : specific dbColumns to choose for 50 data overall graph if there is one.
+    // dbWhere : specific where statement that has some condition for 50 data overall graph if there is one.
+    // y_axis : title of the y_axis to be shown for 50 data overall graph if there is one.
+
     SCPF = [
         SCPFcbench:                              [ flows:false, test:'SCPFcbench', table:'cbench_bm_tests', results:'cbench_bm_results', file:'CbenchDB', rFile:'SCPFcbench.R', extra:none, finalResult:1, graphTitle:[ 'Cbench Test' ], dbCols:'avg', dbWhere:'', y_axis:'Throughput (Responses/sec)' ],
         SCPFhostLat:                             [ flows:false, test:'SCPFhostLat', table:'host_latency_tests', results:'host_latency_results', file:'HostAddLatency', rFile:'SCPFhostLat.R', extra:none,finalResult:1, graphTitle:[ 'Host Latency Test' ], dbCols:'avg', dbWhere:'AND scale=5', y_axis:'Latency (ms)' ],
@@ -29,6 +71,8 @@
     graph_saved_directory = fileRelated.jenkinsWorkspace + "postjob-BM/"
 }
 def getGraphCommand( rFileName, extras, host, port, user, pass, testName, branchName, isOldFlow ){
+    // generate the list of Rscript command for individual graphs
+
     result = ""
     for( extra in extras ){
         result += generateGraph( rFileName, " " + extra, host, port, user, pass, testName, branchName, isOldFlow ) + ";"
@@ -36,11 +80,13 @@
     return result
 }
 def generateGraph( rFileName, batch, host, port, user, pass, testName, branchName, isOldFlow ){
+    //  generate the Rscript command for individual graphs
 
     return generalFuncs.basicGraphPart( fileRelated.SCPFSpecificLocation + rFileName, host, port, user, pass, testName, branchName ) +
            " " + batch + " " + usingOldFlow( isOldFlow, testName ) + graph_saved_directory
 }
 def generateCombinedResultGraph( host, port, user, pass, testName, branchName, isOldFlow ){
+    // generate Rscript for overall graph for the front page.
     result = ""
 
     for ( int i=0; i< SCPF[ testName ][ 'graphTitle' ].size(); i++ ){
@@ -51,32 +97,47 @@
     return result
 }
 def checkIfList( testName, forWhich, pos ){
+    // check if some dictionary has list or string.
+
     return SCPF[ testName ][ forWhich ].getClass().getName() != "java.lang.String" ? SCPF[ testName ][ forWhich ][ pos ] :  SCPF[ testName ][ forWhich ]
 }
 def sqlOldFlow( isOldFlow, testName ){
+    // sql where command part for checking old flows.
+
     return SCPF[ testName ][ 'flows' ] ? " AND " + ( isOldFlow ? "" : "NOT " ) + "is_old_flow " : ""
 }
 def oldFlowRuleCheck( isOldFlow, branch ){
+    // checking if it is old flow
+
     this.isOldFlow = isOldFlow
     if( !isOldFlow ){
         SCPF[ 'SCPFflowTp1g' ][ 'test' ] += " --params TEST/flows=" + ( branch == "onos-1.11" ? "4000" : "3500" )
     }
 }
 def affectedByOldFlow( isOldFlow, testName ){
+    // For sql command :  if the test is affect by old flow, it will return parameters for old flow
     return SCPF[ testName ][ 'flows' ] ? "" + isOldFlow + ", " : ""
 }
 def usingOldFlow( isOldFlow, testName ){
+    // For Rscript command : if it is using old flow.
+
     return SCPF[ testName ][ 'flows' ] ? ( isOldFlow ? "y" : "n" ) + " " : ""
 }
 def hasOldFlow( isOldFlow, testName ){
+    // For Rscript command for 50 data
+
     return ( SCPF[ testName ][ 'flows' ] && isOldFlow ? "y" : "n" ) + " "
 }
 def sqlCommand( testName ){
+    // sql command for inserting data into the database
+
     if ( testName == "SCPFscaleTopo" || testName == "SCPFswitchLat" || testName == "SCPFportLat" )
         return "\"INSERT INTO " + SCPF[ testName ][ 'table' ] + " VALUES( '\$DATE','" + SCPF[ testName ][ 'results' ] + "','\$BUILD_NUMBER', \$line, '\$ONOSBranch');\""
     return "\"INSERT INTO " + SCPF[ testName ][ 'table' ] + " VALUES( '\$DATE','" + SCPF[ testName ][ 'results' ] + "','\$BUILD_NUMBER', '\$ONOSBranch', " + affectedByOldFlow( isOldFlow, testName ) + "\$line);\""
 }
 def databasePart( testName, database_command ){
+    // read the file from the machine and insert it to the database
+
     return '''
     cd /tmp
     while read line
@@ -86,6 +147,8 @@
     done< ''' + SCPF[ testName ][ 'file' ]
 }
 def getGraphGeneratingCommand( host, port, user, pass, testName, prop ){
+    // returns the combined Rscript command for each test.
+
     return getGraphCommand( SCPF[ testName ][ 'rFile' ], SCPF[ testName ][ 'extra' ], host, port, user, pass, testName, prop[ "ONOSBranch" ], isOldFlow ) + '''
     ''' + ( SCPF[ testName ][ 'finalResult' ] ? generateCombinedResultGraph( host, port, user, pass, testName, prop[ "ONOSBranch" ], , isOldFlow ) : "" )
 }
diff --git a/TestON/JenkinsFile/dependencies/TriggerFuncs.groovy b/TestON/JenkinsFile/dependencies/TriggerFuncs.groovy
index 96c0855..9b290a6 100644
--- a/TestON/JenkinsFile/dependencies/TriggerFuncs.groovy
+++ b/TestON/JenkinsFile/dependencies/TriggerFuncs.groovy
@@ -1,15 +1,42 @@
+// Copyright 2017 Open Networking Foundation (ONF)
+//
+// Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+// the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+// or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
+//
+//     TestON is free software: you can redistribute it and/or modify
+//     it under the terms of the GNU General Public License as published by
+//     the Free Software Foundation, either version 2 of the License, or
+//     (at your option) any later version.
+//
+//     TestON is distributed in the hope that it will be useful,
+//     but WITHOUT ANY WARRANTY; without even the implied warranty of
+//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//     GNU General Public License for more details.
+//
+//     You should have received a copy of the GNU General Public License
+//     along with TestON.  If not, see <http://www.gnu.org/licenses/>.
+
+// This is the dependency Jenkins script.
+// This will provide the portion that will set up the environment of the machine
+//      and trigger the corresponding jobs.
+
 #!groovy
 
 def init( commonFuncs ){
     funcs = commonFuncs
 }
 def lastCommaRemover( str ){
+    // function that will remove the last comma from the string
+
     if ( str.size() > 0 && str[ str.size() - 1 ] == ',' ){
         str = str.substring( 0,str.size() - 1 )
     }
     return str
 }
 def printDaysForTest( AllTheTests ){
+    // Print the days for what test has.
+
     result = ""
     for ( String test in AllTheTests.keySet() ){
         result += test + " : \n"
@@ -22,6 +49,7 @@
     return result
 }
 def runTestSeq( testList ){
+    // Running the test sequentially
     return{
         for ( test in testList.keySet() ){
             testList[ test ].call()
@@ -29,6 +57,8 @@
     }
 }
 def print_tests( tests ){
+    // print the list of the tsets to be run
+
     for( String test in tests.keySet() ){
         if( tests[ test ][ "tests" ] != "" ){
             println test + ":"
@@ -37,19 +67,18 @@
     }
 }
 def organize_tests( tests, testcases ){
+    // organize the test to its category using its name.
+    // most of the time it will use the first two character of the test name
+    // but there are some exceptions like FUNCbgpls or FUNCvirNetNB since they are now under USECASE
+
     testList = tests.tokenize( "\n;, " )
     for( String test in testList )
         testcases [ Prefix_organizer[ ( test == "FUNCbgpls" || test == "FUNCvirNetNB" ? "US" : ( test[ 0 ] + test[ 1 ] ) ) ] ][ "tests" ] += test + ","
     return testcases
 }
-def borrow_mn( jobOn ){
-    result = ""
-    if( jobOn == "SR" ){
-        result = "~/cell_borrow.sh"
-    }
-    return result
-}
 def trigger( branch, tests, nodeName, jobOn, manuallyRun, onosTag ){
+    // triggering function that will setup the environment and determine which pipeline to trigger
+
     println jobOn + "-pipeline-" + manuallyRun ? "manually" : branch
     def wiki = branch
     branch = funcs.branchWithPrefix( branch )
@@ -64,14 +93,18 @@
     build job: jobToRun, propagate: false
 }
 def trigger_pipeline( branch, tests, nodeName, jobOn, manuallyRun, onosTag ){
-// nodeName : "BM" or "VM"
-// jobOn : "SCPF" or "USECASE" or "FUNC" or "HA"
+    // nodeName : "BM" or "VM"
+    // jobOn : "SCPF" or "USECASE" or "FUNC" or "HA"
+    // this will return the function by wrapping them up with return{} to prevent them to be
+    // executed once this function is called to assign to specific variable.
     return{
         trigger( branch, tests, nodeName, jobOn, manuallyRun, onosTag )
     }
 }
 // export Environment properties.
 def exportEnvProperty( onos_branch, test_branch, wiki, tests, postResult, manually_run, onosTag, isOldFlow ){
+    // export environment properties to the machine.
+
     stage( "export Property" ){
         sh '''
             echo "ONOSBranch=''' + onos_branch +'''" > /var/jenkins/TestONOS.property
@@ -88,6 +121,8 @@
 }
 // Initialize the environment Setup for the onos and OnosSystemTest
 def envSetup( onos_branch, test_branch, onos_tag, jobOn, manuallyRun ){
+    // to setup the environment using the bash script
+
     stage( "envSetup" ) {
         // after env: ''' + borrow_mn( jobOn ) + '''
         sh '''#!/bin/bash -l
@@ -101,6 +136,8 @@
     }
 }
 def tagCheck( onos_tag, onos_branch ){
+    // check the tag for onos if it is not empty
+
     result = "git checkout "
     if ( onos_tag == "" )
         result += onos_branch //create new local branch
@@ -109,6 +146,8 @@
     return result
 }
 def preSetup( onos_branch, test_branch, onos_tag, isManual ){
+    // pre setup part which will clean up and checkout to corresponding branch.
+
     result = ""
     if( !isManual ){
         result = '''echo -e "\n#####  Set TestON Branch #####"
@@ -152,6 +191,8 @@
     return result
 }
 def oldFlowCheck( jobOn, onos_branch ){
+    // part that will check if it is oldFlow. If so, it will switch to use old flow. Only affected with SCPF.
+
     result = ""
     if( jobOn == "SCPF" && ( onos_branch== "master" || onos_branch=="onos-1.12" ) )
         result = '''sed -i -e 's/@Component(immediate = true)/@Component(enabled = false)/g' ~/onos/core/store/dist/src/main/java/org/onosproject/store/flow/impl/''' + ( isOldFlow ? "DistributedFlowRuleStore" : "ECFlowRuleStore" ) + '''.java
@@ -159,6 +200,8 @@
     return result
 }
 def postSetup( onos_branch, test_branch, onos_tag, isManual ){
+    // setup that will build the onos using buck.
+
     result = ""
     if( !isManual ){
         result = '''echo -e "\n##### build ONOS skip unit tests ######"
@@ -176,6 +219,8 @@
     return result
 }
 def generateKey(){
+    // generate cluster-key of the onos
+
     try{
         sh '''
         #!/bin/bash -l
@@ -187,15 +232,5 @@
         '''
     }catch( all ){}
 }
-def returnCell( nodeName ){
-    node( "TestStation-" + nodeName + "s" ){
-        sh '''#!/bin/bash -l
-            set +e
-            . ~/.bashrc
-            env
-            ~/./return_cell.sh
-            '''
-    }
-}
 
 return this;
