about summary refs log tree commit diff
path: root/sourcecodes
diff options
context:
space:
mode:
authorziejd22017-09-14 15:39:41 -0500
committerziejd22017-09-14 15:57:50 -0500
commitc4f926438dcb8abe805e910399940f79ff643c4b (patch)
tree3146d05ada5cf4b48d9bdd16c1baa498e8df7192 /sourcecodes
parent57ebf49403b75dcf8482d174b59f7fd2a961d98e (diff)
downloadBNW-c4f926438dcb8abe805e910399940f79ff643c4b.tar.gz
Add files via upload
Diffstat (limited to 'sourcecodes')
-rw-r--r--sourcecodes/BNW_overview.pngbin0 -> 64748 bytes
-rw-r--r--sourcecodes/BNW_workflow_1.htm645
-rw-r--r--sourcecodes/BNW_workflow_2.htm731
-rw-r--r--sourcecodes/BNW_workflow_net1.htm385
-rw-r--r--sourcecodes/BNW_workflow_sci.htm389
-rw-r--r--sourcecodes/BNW_workflow_test_files/8node_best_structure.jpgbin0 -> 72920 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/8node_file_upload.jpgbin0 -> 84140 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/8node_geno1_2.jpgbin0 -> 75146 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/8node_global_settings.jpgbin0 -> 24453 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/8node_matrix.jpgbin0 -> 107678 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/8node_model_avg_struct.jpgbin0 -> 71078 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/8node_trait2_15.jpgbin0 -> 68817 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/colorschememapping.xml2
-rw-r--r--sourcecodes/BNW_workflow_test_files/filelist.xml32
-rw-r--r--sourcecodes/BNW_workflow_test_files/image003.jpgbin0 -> 25024 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/image003.pngbin0 -> 409885 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/image004.jpgbin0 -> 10468 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/image005.pngbin0 -> 328209 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/image006.jpgbin0 -> 31035 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/image007.pngbin0 -> 343122 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/image008.jpgbin0 -> 57052 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/image009.pngbin0 -> 356293 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/image010.jpgbin0 -> 39597 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/image011.pngbin0 -> 352085 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/image012.jpgbin0 -> 39439 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/image013.pngbin0 -> 353574 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/image014.jpgbin0 -> 42653 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/image015.pngbin0 -> 293825 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/image016.jpgbin0 -> 57313 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/image017.pngbin0 -> 265027 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/image018.jpgbin0 -> 16843 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/image019.pngbin0 -> 268785 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/image020.jpgbin0 -> 19598 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/image021.pngbin0 -> 382470 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/image022.jpgbin0 -> 19696 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/image023.pngbin0 -> 378421 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/image024.jpgbin0 -> 16730 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/image025.pngbin0 -> 374160 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/image026.jpgbin0 -> 15680 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/image033.pngbin0 -> 485570 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/image039.jpgbin0 -> 15726 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/image2_1.jpgbin0 -> 39600 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/image2_2.jpgbin0 -> 39297 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/image2_3.jpgbin0 -> 41304 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/image2_4.jpgbin0 -> 45307 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/image2_5.jpgbin0 -> 51969 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/image2_6.jpgbin0 -> 56987 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/sci_5node_network1.jpgbin0 -> 78402 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/sci_5node_part1.jpgbin0 -> 22188 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/sci_5node_part2.jpgbin0 -> 27195 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/sci_5node_part3.jpgbin0 -> 44105 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/sci_5node_upload.jpgbin0 -> 46463 bytes
-rw-r--r--sourcecodes/BNW_workflow_test_files/themedata.thmxbin0 -> 3081 bytes
-rw-r--r--sourcecodes/add_evd.php204
-rw-r--r--sourcecodes/add_evd_example.php204
-rw-r--r--sourcecodes/add_inv.php262
-rw-r--r--sourcecodes/add_inv_example.php251
-rw-r--r--sourcecodes/bn_file_load_gom.php401
-rw-r--r--sourcecodes/build.sh9
-rw-r--r--sourcecodes/clear.php20
-rw-r--r--sourcecodes/clear_example.php20
-rw-r--r--sourcecodes/create_tiers_gom.php1034
-rw-r--r--sourcecodes/data/Backupfiles/evidencemodifiedbin0 -> 452271 bytes
-rw-r--r--sourcecodes/data/Backupfiles/initialstructurebin0 -> 452404 bytes
-rw-r--r--sourcecodes/data/Backupfiles/newinterventionbin0 -> 452401 bytes
-rw-r--r--sourcecodes/data/Backupfiles/temp_evidence_file36
-rw-r--r--sourcecodes/data/Backupfiles/temp_intervention_file36
-rw-r--r--sourcecodes/data/Backupfiles/temp_shell_file_initial_structure36
-rw-r--r--sourcecodes/data/evidencemodifiedbin0 -> 452271 bytes
-rw-r--r--sourcecodes/data/example1/Bqxban.txt1
-rw-r--r--sourcecodes/data/example1/Bqxcontinuous_input.txt203
-rw-r--r--sourcecodes/data/example1/Bqxgraphviz.txt12
-rw-r--r--sourcecodes/data/example1/Bqxk.txt1
-rw-r--r--sourcecodes/data/example1/Bqxmap.txt8
-rw-r--r--sourcecodes/data/example1/Bqxmapdata.txt1
-rw-r--r--sourcecodes/data/example1/Bqxname.txt1
-rw-r--r--sourcecodes/data/example1/Bqxnet_figure.txt652
-rw-r--r--sourcecodes/data/example1/Bqxnlevels.txt4
-rw-r--r--sourcecodes/data/example1/Bqxnnode.txt1
-rw-r--r--sourcecodes/data/example1/Bqxnrows.txt1
-rw-r--r--sourcecodes/data/example1/Bqxparent.txt1
-rw-r--r--sourcecodes/data/example1/Bqxrun_initialstructure.sh38
-rw-r--r--sourcecodes/data/example1/Bqxstructure_input.txt9
-rw-r--r--sourcecodes/data/example1/Bqxstructure_input_temp.txt9
-rw-r--r--sourcecodes/data/example1/Bqxstructure_old.txt7
-rw-r--r--sourcecodes/data/example1/Bqxthr.txt1
-rw-r--r--sourcecodes/data/example1/Bqxtier.txt1
-rw-r--r--sourcecodes/data/example1/Bqxtype.txt2
-rw-r--r--sourcecodes/data/example1/Bqxwhite.txt1
-rw-r--r--sourcecodes/data/example1/standardized_data.txt201
-rw-r--r--sourcecodes/data/example2/hQGban.txt1
-rw-r--r--sourcecodes/data/example2/hQGcontinuous_input.txt203
-rw-r--r--sourcecodes/data/example2/hQGgraphviz.txt11
-rw-r--r--sourcecodes/data/example2/hQGk.txt1
-rw-r--r--sourcecodes/data/example2/hQGmap.txt8
-rw-r--r--sourcecodes/data/example2/hQGmapdata.txt1
-rw-r--r--sourcecodes/data/example2/hQGname.txt1
-rw-r--r--sourcecodes/data/example2/hQGnet_figure.txt652
-rw-r--r--sourcecodes/data/example2/hQGnlevels.txt4
-rw-r--r--sourcecodes/data/example2/hQGnnode.txt1
-rw-r--r--sourcecodes/data/example2/hQGnrows.txt1
-rw-r--r--sourcecodes/data/example2/hQGparent.txt1
-rw-r--r--sourcecodes/data/example2/hQGrun_initialstructure.sh38
-rw-r--r--sourcecodes/data/example2/hQGstructure_input.txt9
-rw-r--r--sourcecodes/data/example2/hQGstructure_input_temp.txt9
-rw-r--r--sourcecodes/data/example2/hQGstructure_old.txt7
-rw-r--r--sourcecodes/data/example2/hQGthr.txt1
-rw-r--r--sourcecodes/data/example2/hQGtier.txt1
-rw-r--r--sourcecodes/data/example2/hQGtype.txt2
-rw-r--r--sourcecodes/data/example2/hQGwhite.txt1
-rw-r--r--sourcecodes/data/example2/standardized_data.txt201
-rw-r--r--sourcecodes/data/example_chl/bWRcontinuous_input.txt44
-rw-r--r--sourcecodes/data/example_chl/bWRgraphviz.txt11
-rw-r--r--sourcecodes/data/example_chl/bWRmap.txt5
-rw-r--r--sourcecodes/data/example_chl/bWRmapdata.txt1
-rw-r--r--sourcecodes/data/example_chl/bWRname.txt1
-rw-r--r--sourcecodes/data/example_chl/bWRnet_figure.txt433
-rw-r--r--sourcecodes/data/example_chl/bWRnet_figure_new.txt433
-rw-r--r--sourcecodes/data/example_chl/bWRnlevels.txt2
-rw-r--r--sourcecodes/data/example_chl/bWRnnode.txt1
-rw-r--r--sourcecodes/data/example_chl/bWRrun_evidencemodified.sh38
-rw-r--r--sourcecodes/data/example_chl/bWRrun_initialstructure.sh38
-rw-r--r--sourcecodes/data/example_chl/bWRstructure_input.txt7
-rw-r--r--sourcecodes/data/example_chl/bWRstructure_old.txt5
-rw-r--r--sourcecodes/data/example_chl/bWRtype.txt2
-rw-r--r--sourcecodes/data/example_chl/bWRvar.txt1
-rw-r--r--sourcecodes/data/example_chl/bWRvardata.txt1
-rw-r--r--sourcecodes/data/example_chl/bWRvarname.txt1
-rw-r--r--sourcecodes/data/example_chr2_spleen/cuLban.txt51
-rw-r--r--sourcecodes/data/example_chr2_spleen/cuLcontinuous_input.txt76
-rw-r--r--sourcecodes/data/example_chr2_spleen/cuLgraphviz.txt32
-rw-r--r--sourcecodes/data/example_chr2_spleen/cuLk.txt1
-rw-r--r--sourcecodes/data/example_chr2_spleen/cuLmap.txt14
-rw-r--r--sourcecodes/data/example_chr2_spleen/cuLmapdata.txt1
-rw-r--r--sourcecodes/data/example_chr2_spleen/cuLname.txt1
-rw-r--r--sourcecodes/data/example_chr2_spleen/cuLnet_figure.txt1387
-rw-r--r--sourcecodes/data/example_chr2_spleen/cuLnet_figure_new.txt1288
-rw-r--r--sourcecodes/data/example_chr2_spleen/cuLnlevels.txt2
-rw-r--r--sourcecodes/data/example_chr2_spleen/cuLnnode.txt1
-rw-r--r--sourcecodes/data/example_chr2_spleen/cuLnrows.txt1
-rw-r--r--sourcecodes/data/example_chr2_spleen/cuLparent.txt1
-rw-r--r--sourcecodes/data/example_chr2_spleen/cuLrun_evidencemodified.sh38
-rw-r--r--sourcecodes/data/example_chr2_spleen/cuLrun_initialstructure.sh38
-rw-r--r--sourcecodes/data/example_chr2_spleen/cuLstructure_input.txt15
-rw-r--r--sourcecodes/data/example_chr2_spleen/cuLstructure_input_temp.txt15
-rw-r--r--sourcecodes/data/example_chr2_spleen/cuLstructure_old.txt14
-rw-r--r--sourcecodes/data/example_chr2_spleen/cuLthr.txt1
-rw-r--r--sourcecodes/data/example_chr2_spleen/cuLtier.txt1
-rw-r--r--sourcecodes/data/example_chr2_spleen/cuLtype.txt2
-rw-r--r--sourcecodes/data/example_chr2_spleen/cuLwhite.txt1
-rw-r--r--sourcecodes/data/example_sci/LluOyOgrviz_name_file.txt6
-rw-r--r--sourcecodes/data/example_sci/Lluban.txt15
-rw-r--r--sourcecodes/data/example_sci/Llucontinuous_input.txt503
-rw-r--r--sourcecodes/data/example_sci/Llugraphviz.txt10
-rw-r--r--sourcecodes/data/example_sci/Lluk.txt1
-rw-r--r--sourcecodes/data/example_sci/Llumap.txt5
-rw-r--r--sourcecodes/data/example_sci/Llumapdata.txt1
-rw-r--r--sourcecodes/data/example_sci/Lluname.txt1
-rw-r--r--sourcecodes/data/example_sci/Llunet_figure.txt433
-rw-r--r--sourcecodes/data/example_sci/Llunet_figure_new.txt433
-rw-r--r--sourcecodes/data/example_sci/Llunlevels.txt2
-rw-r--r--sourcecodes/data/example_sci/Llunnode.txt1
-rw-r--r--sourcecodes/data/example_sci/Llunrows.txt1
-rw-r--r--sourcecodes/data/example_sci/Lluparent.txt1
-rw-r--r--sourcecodes/data/example_sci/Llurun_evidencemodified.sh38
-rw-r--r--sourcecodes/data/example_sci/Llurun_initialstructure.sh38
-rw-r--r--sourcecodes/data/example_sci/Llustructure_input.txt6
-rw-r--r--sourcecodes/data/example_sci/Llustructure_input_temp.txt6
-rw-r--r--sourcecodes/data/example_sci/Llustructure_old.txt5
-rw-r--r--sourcecodes/data/example_sci/Lluthr.txt1
-rw-r--r--sourcecodes/data/example_sci/Llutier.txt1
-rw-r--r--sourcecodes/data/example_sci/Llutype.txt2
-rw-r--r--sourcecodes/data/example_sci/Lluvar.txt1
-rw-r--r--sourcecodes/data/example_sci/Lluvardata.txt1
-rw-r--r--sourcecodes/data/example_sci/Lluvarname.txt1
-rw-r--r--sourcecodes/data/example_sci/Lluwhite.txt1
-rw-r--r--sourcecodes/data/example_sci_bk/Lluban.txt15
-rw-r--r--sourcecodes/data/example_sci_bk/Llucontinuous_input.txt503
-rw-r--r--sourcecodes/data/example_sci_bk/Llugraphviz.txt10
-rw-r--r--sourcecodes/data/example_sci_bk/Lluk.txt1
-rw-r--r--sourcecodes/data/example_sci_bk/Llumap.txt5
-rw-r--r--sourcecodes/data/example_sci_bk/Llumapdata.txt1
-rw-r--r--sourcecodes/data/example_sci_bk/Lluname.txt1
-rw-r--r--sourcecodes/data/example_sci_bk/Llunet_figure.txt433
-rw-r--r--sourcecodes/data/example_sci_bk/Llunet_figure_new.txt433
-rw-r--r--sourcecodes/data/example_sci_bk/Llunlevels.txt2
-rw-r--r--sourcecodes/data/example_sci_bk/Llunnode.txt1
-rw-r--r--sourcecodes/data/example_sci_bk/Llunrows.txt1
-rw-r--r--sourcecodes/data/example_sci_bk/Lluparent.txt1
-rw-r--r--sourcecodes/data/example_sci_bk/Llurun_evidencemodified.sh38
-rw-r--r--sourcecodes/data/example_sci_bk/Llurun_initialstructure.sh38
-rw-r--r--sourcecodes/data/example_sci_bk/Llustructure_input.txt6
-rw-r--r--sourcecodes/data/example_sci_bk/Llustructure_input_temp.txt6
-rw-r--r--sourcecodes/data/example_sci_bk/Llustructure_old.txt5
-rw-r--r--sourcecodes/data/example_sci_bk/Lluthr.txt1
-rw-r--r--sourcecodes/data/example_sci_bk/Llutier.txt1
-rw-r--r--sourcecodes/data/example_sci_bk/Llutype.txt2
-rw-r--r--sourcecodes/data/example_sci_bk/Lluvar.txt1
-rw-r--r--sourcecodes/data/example_sci_bk/Lluvardata.txt1
-rw-r--r--sourcecodes/data/example_sci_bk/Lluvarname.txt1
-rw-r--r--sourcecodes/data/example_sci_bk/Lluwhite.txt1
-rw-r--r--sourcecodes/data/example_time_series/TEbban.txt73
-rw-r--r--sourcecodes/data/example_time_series/TEbcontinuous_input.txt503
-rw-r--r--sourcecodes/data/example_time_series/TEbgraphviz.txt11
-rw-r--r--sourcecodes/data/example_time_series/TEbk.txt1
-rw-r--r--sourcecodes/data/example_time_series/TEbmap.txt10
-rw-r--r--sourcecodes/data/example_time_series/TEbmapdata.txt1
-rw-r--r--sourcecodes/data/example_time_series/TEbname.txt1
-rw-r--r--sourcecodes/data/example_time_series/TEbnet_figure.txt963
-rw-r--r--sourcecodes/data/example_time_series/TEbnet_figure_new.txt864
-rw-r--r--sourcecodes/data/example_time_series/TEbnlevels.txt2
-rw-r--r--sourcecodes/data/example_time_series/TEbnnode.txt1
-rw-r--r--sourcecodes/data/example_time_series/TEbnrows.txt1
-rw-r--r--sourcecodes/data/example_time_series/TEbparent.txt1
-rw-r--r--sourcecodes/data/example_time_series/TEbrun_evidencemodified.sh38
-rw-r--r--sourcecodes/data/example_time_series/TEbrun_initialstructure.sh38
-rw-r--r--sourcecodes/data/example_time_series/TEbstructure_input.txt11
-rw-r--r--sourcecodes/data/example_time_series/TEbstructure_input_temp.txt11
-rw-r--r--sourcecodes/data/example_time_series/TEbstructure_old.txt6
-rw-r--r--sourcecodes/data/example_time_series/TEbthr.txt1
-rw-r--r--sourcecodes/data/example_time_series/TEbtier.txt1
-rw-r--r--sourcecodes/data/example_time_series/TEbtype.txt2
-rw-r--r--sourcecodes/data/example_time_series/TEbvar.txt1
-rw-r--r--sourcecodes/data/example_time_series/TEbvardata.txt1
-rw-r--r--sourcecodes/data/example_time_series/TEbvarname.txt1
-rw-r--r--sourcecodes/data/example_time_series/TEbwhite.txt1
-rw-r--r--sourcecodes/data/examplecar/OVIban.txt1
-rw-r--r--sourcecodes/data/examplecar/OVIcontinuous_input.txt1004
-rw-r--r--sourcecodes/data/examplecar/OVIgraphviz.txt70
-rw-r--r--sourcecodes/data/examplecar/OVIk.txt1
-rw-r--r--sourcecodes/data/examplecar/OVImap.txt19
-rw-r--r--sourcecodes/data/examplecar/OVImapdata.txt1
-rw-r--r--sourcecodes/data/examplecar/OVIname.txt1
-rw-r--r--sourcecodes/data/examplecar/OVInet_figure.txt237
-rw-r--r--sourcecodes/data/examplecar/OVInet_figure_new.txt138
-rw-r--r--sourcecodes/data/examplecar/OVInnode.txt1
-rw-r--r--sourcecodes/data/examplecar/OVInrows.txt1
-rw-r--r--sourcecodes/data/examplecar/OVIparent.txt1
-rw-r--r--sourcecodes/data/examplecar/OVIrun_evidencemodified.sh38
-rw-r--r--sourcecodes/data/examplecar/OVIrun_initialstructure.sh38
-rw-r--r--sourcecodes/data/examplecar/OVIstructure_input.txt20
-rw-r--r--sourcecodes/data/examplecar/OVIstructure_input_temp.txt20
-rw-r--r--sourcecodes/data/examplecar/OVIstructure_old.txt19
-rw-r--r--sourcecodes/data/examplecar/OVIthr.txt1
-rw-r--r--sourcecodes/data/examplecar/OVItype.txt2
-rw-r--r--sourcecodes/data/examplecar/OVIvar.txt1
-rw-r--r--sourcecodes/data/examplecar/OVIvardata.txt1
-rw-r--r--sourcecodes/data/examplecar/OVIvarname.txt1
-rw-r--r--sourcecodes/data/examplecar/OVIwhite.txt1
-rw-r--r--sourcecodes/data/examplecar15node/MtXcontinuous_input.txt1005
-rw-r--r--sourcecodes/data/examplecar15node/MtXgraphviz.txt20
-rw-r--r--sourcecodes/data/examplecar15node/MtXmap.txt15
-rw-r--r--sourcecodes/data/examplecar15node/MtXmapdata.txt1
-rw-r--r--sourcecodes/data/examplecar15node/MtXname.txt1
-rw-r--r--sourcecodes/data/examplecar15node/MtXnet_figure.txt114
-rw-r--r--sourcecodes/data/examplecar15node/MtXnnode.txt1
-rw-r--r--sourcecodes/data/examplecar15node/MtXrun_initialstructure.sh38
-rw-r--r--sourcecodes/data/examplecar15node/MtXstructure_input.txt17
-rw-r--r--sourcecodes/data/examplecar15node/MtXstructure_old.txt15
-rw-r--r--sourcecodes/data/examplecar15node/MtXtype.txt2
-rw-r--r--sourcecodes/data/examplecar15node/eIAcontinuous_input.txt1003
-rw-r--r--sourcecodes/data/examplecar15node/eIAgraphviz.txt20
-rw-r--r--sourcecodes/data/examplecar15node/eIAmap.txt15
-rw-r--r--sourcecodes/data/examplecar15node/eIAmapdata.txt1
-rw-r--r--sourcecodes/data/examplecar15node/eIAname.txt1
-rw-r--r--sourcecodes/data/examplecar15node/eIAnet_figure.txt114
-rw-r--r--sourcecodes/data/examplecar15node/eIAnlevels.txt15
-rw-r--r--sourcecodes/data/examplecar15node/eIAnnode.txt1
-rw-r--r--sourcecodes/data/examplecar15node/eIAstructure_input.txt17
-rw-r--r--sourcecodes/data/examplecar15node/eIAstructure_old.txt15
-rw-r--r--sourcecodes/data/examplecar15node/eIAtype.txt2
-rw-r--r--sourcecodes/data/examplezoo/fSfban.txt261
-rw-r--r--sourcecodes/data/examplezoo/fSfcontinuous_input.txt104
-rw-r--r--sourcecodes/data/examplezoo/fSfgraphviz.txt61
-rw-r--r--sourcecodes/data/examplezoo/fSfk.txt1
-rw-r--r--sourcecodes/data/examplezoo/fSfmap.txt17
-rw-r--r--sourcecodes/data/examplezoo/fSfmapdata.txt1
-rw-r--r--sourcecodes/data/examplezoo/fSfname.txt1
-rw-r--r--sourcecodes/data/examplezoo/fSfnet_figure.txt130
-rw-r--r--sourcecodes/data/examplezoo/fSfnnode.txt1
-rw-r--r--sourcecodes/data/examplezoo/fSfnrows.txt1
-rw-r--r--sourcecodes/data/examplezoo/fSfparent.txt1
-rw-r--r--sourcecodes/data/examplezoo/fSfrun_initialstructure.sh38
-rw-r--r--sourcecodes/data/examplezoo/fSfstructure_input.txt18
-rw-r--r--sourcecodes/data/examplezoo/fSfstructure_input_temp.txt18
-rw-r--r--sourcecodes/data/examplezoo/fSfstructure_old.txt16
-rw-r--r--sourcecodes/data/examplezoo/fSfthr.txt1
-rw-r--r--sourcecodes/data/examplezoo/fSftier.txt1
-rw-r--r--sourcecodes/data/examplezoo/fSftype.txt2
-rw-r--r--sourcecodes/data/examplezoo/fSfwhite.txt1
-rw-r--r--sourcecodes/data/examplezoo/standardized_data.txt102
-rw-r--r--sourcecodes/data/initialstructurebin0 -> 452404 bytes
-rw-r--r--sourcecodes/data/newinterventionbin0 -> 452401 bytes
-rw-r--r--sourcecodes/data/standardized_data.txt201
-rw-r--r--sourcecodes/data/temp_evidence_file36
-rw-r--r--sourcecodes/data/temp_intervention_file36
-rw-r--r--sourcecodes/data/temp_shell_file_initial_structure36
-rw-r--r--sourcecodes/example.php31
-rw-r--r--sourcecodes/example_datasets/example_data_8nodes.txt201
-rw-r--r--sourcecodes/example_datasets/example_structure_matrix_8nodes.txt9
-rw-r--r--sourcecodes/example_datasets/sci_5node_input_data.txt101
-rw-r--r--sourcecodes/example_datasets/sci_5node_input_data2.txt501
-rw-r--r--sourcecodes/example_datasets/spleen_chr2_example_data.txt74
-rw-r--r--sourcecodes/example_datasets/spleen_chr2_example_data.txt~76
-rw-r--r--sourcecodes/example_datasets/time_series_example.txt501
-rw-r--r--sourcecodes/examplefilecopy.sh11
-rw-r--r--sourcecodes/examples/cardiagnosis.php83
-rw-r--r--sourcecodes/examples/chl_example.php32
-rw-r--r--sourcecodes/examples/my_new_style.css155
-rw-r--r--sourcecodes/examples/spleen_immune_example.php33
-rw-r--r--sourcecodes/examples/synthetic_example2.php32
-rw-r--r--sourcecodes/examples/synthetic_example3.php34
-rw-r--r--sourcecodes/execute_bn_gom.php98
-rw-r--r--sourcecodes/executionprogress.php76
-rw-r--r--sourcecodes/faq.php161
-rw-r--r--sourcecodes/filecopy.sh11
-rw-r--r--sourcecodes/getting_started.php33
-rw-r--r--sourcecodes/graphviz_structure.php97
-rw-r--r--sourcecodes/header_batchsearch.inc242
-rw-r--r--sourcecodes/header_new.inc22
-rw-r--r--sourcecodes/help.php241
-rw-r--r--sourcecodes/home.php179
-rw-r--r--sourcecodes/home_upload.php34
-rw-r--r--sourcecodes/index.html6
-rw-r--r--sourcecodes/js-graph-it.css24
-rw-r--r--sourcecodes/js-graph-it.js1802
-rw-r--r--sourcecodes/k-best/index.html6
-rw-r--r--sourcecodes/k-best/src/Arguments.h195
-rw-r--r--sourcecodes/k-best/src/Engine.h2278
-rw-r--r--sourcecodes/k-best/src/GenerateGraphs.sh7
-rw-r--r--sourcecodes/k-best/src/Model.h1002
-rw-r--r--sourcecodes/k-best/src/UpdateHR.h1652
-rw-r--r--sourcecodes/k-best/src/UpdateHR2.h511
-rw-r--r--sourcecodes/k-best/src/arcToNet.cc233
-rw-r--r--sourcecodes/k-best/src/arcs2dot.c60
-rw-r--r--sourcecodes/k-best/src/buildk.sh23
-rw-r--r--sourcecodes/k-best/src/buildk_poster.sh9
-rw-r--r--sourcecodes/k-best/src/cfg.h9
-rw-r--r--sourcecodes/k-best/src/clean.sh6
-rw-r--r--sourcecodes/k-best/src/comp_pHat_D.cc213
-rw-r--r--sourcecodes/k-best/src/data.sh27
-rw-r--r--sourcecodes/k-best/src/data2net.sh35
-rw-r--r--sourcecodes/k-best/src/data2netk.sh55
-rw-r--r--sourcecodes/k-best/src/data2netk_poster.sh56
-rw-r--r--sourcecodes/k-best/src/data2netk_poster.sh.bk56
-rw-r--r--sourcecodes/k-best/src/datak.sh23
-rw-r--r--sourcecodes/k-best/src/drawgraph.sh8
-rw-r--r--sourcecodes/k-best/src/files.c59
-rw-r--r--sourcecodes/k-best/src/files.h12
-rw-r--r--sourcecodes/k-best/src/files.obin0 -> 3728 bytes
-rw-r--r--sourcecodes/k-best/src/get_best_net.c63
-rw-r--r--sourcecodes/k-best/src/get_best_order.c54
-rw-r--r--sourcecodes/k-best/src/get_best_parents.c114
-rw-r--r--sourcecodes/k-best/src/get_best_sinks.c78
-rw-r--r--sourcecodes/k-best/src/get_kbest_netsbin0 -> 122641 bytes
-rw-r--r--sourcecodes/k-best/src/get_kbest_nets.cc1552
-rw-r--r--sourcecodes/k-best/src/get_kbest_parentsbin0 -> 25198 bytes
-rw-r--r--sourcecodes/k-best/src/get_kbest_parents.cc249
-rw-r--r--sourcecodes/k-best/src/get_local_scores.h15
-rw-r--r--sourcecodes/k-best/src/graph.sh13
-rw-r--r--sourcecodes/k-best/src/ilogi.c37
-rw-r--r--sourcecodes/k-best/src/ilogi.h9
-rw-r--r--sourcecodes/k-best/src/ls_BDe.c163
-rw-r--r--sourcecodes/k-best/src/ls_BDe.h12
-rw-r--r--sourcecodes/k-best/src/ls_LOO.c152
-rw-r--r--sourcecodes/k-best/src/ls_LOO.h10
-rw-r--r--sourcecodes/k-best/src/ls_NML.c77
-rw-r--r--sourcecodes/k-best/src/ls_NML.h12
-rw-r--r--sourcecodes/k-best/src/ls_XIC.c82
-rw-r--r--sourcecodes/k-best/src/ls_XIC.h13
-rw-r--r--sourcecodes/k-best/src/main.cc51
-rw-r--r--sourcecodes/k-best/src/net2parents.c50
-rw-r--r--sourcecodes/k-best/src/parents2arcs.c37
-rw-r--r--sourcecodes/k-best/src/reg.c320
-rw-r--r--sourcecodes/k-best/src/reg.h7
-rw-r--r--sourcecodes/k-best/src/score_net.c39
-rw-r--r--sourcecodes/k-best/src/score_nets.c54
-rw-r--r--sourcecodes/k-best/src/varpar.c19
-rw-r--r--sourcecodes/k-best/src/varpar.h9
-rw-r--r--sourcecodes/k-best/src/varpar.obin0 -> 1360 bytes
-rw-r--r--sourcecodes/k-best/src/xtab.h80
-rw-r--r--sourcecodes/k_only_table.txt19
-rw-r--r--sourcecodes/layout.php121
-rw-r--r--sourcecodes/layout_example.php121
-rw-r--r--sourcecodes/localscore/Applic.h291
-rw-r--r--sourcecodes/localscore/Arith.h87
-rw-r--r--sourcecodes/localscore/BLAS.h382
-rw-r--r--sourcecodes/localscore/Boolean.h37
-rw-r--r--sourcecodes/localscore/Callbacks.h116
-rw-r--r--sourcecodes/localscore/Complex.h38
-rw-r--r--sourcecodes/localscore/Constants.h44
-rw-r--r--sourcecodes/localscore/Error.h46
-rw-r--r--sourcecodes/localscore/GetX11Image.h36
-rw-r--r--sourcecodes/localscore/GraphicsDevice.h863
-rw-r--r--sourcecodes/localscore/GraphicsEngine.h514
-rw-r--r--sourcecodes/localscore/Lapack.h3072
-rw-r--r--sourcecodes/localscore/Linpack.h89
-rw-r--r--sourcecodes/localscore/MathThreads.h39
-rw-r--r--sourcecodes/localscore/Memory.h49
-rw-r--r--sourcecodes/localscore/Parse.h47
-rw-r--r--sourcecodes/localscore/Print.h50
-rw-r--r--sourcecodes/localscore/PrtUtil.h71
-rw-r--r--sourcecodes/localscore/QuartzDevice.h235
-rw-r--r--sourcecodes/localscore/R-ftp-http.h65
-rw-r--r--sourcecodes/localscore/R.h65
-rw-r--r--sourcecodes/localscore/RConverters.h131
-rw-r--r--sourcecodes/localscore/RS.h96
-rw-r--r--sourcecodes/localscore/RStartup.h107
-rw-r--r--sourcecodes/localscore/Random.h75
-rw-r--r--sourcecodes/localscore/Rconfig.h20
-rw-r--r--sourcecodes/localscore/Rdynload.h129
-rw-r--r--sourcecodes/localscore/Riconv.h46
-rw-r--r--sourcecodes/localscore/Rmath.h657
-rw-r--r--sourcecodes/localscore/Utils.h115
-rw-r--r--sourcecodes/localscore/Visibility.h39
-rw-r--r--sourcecodes/localscore/eventloop.h97
-rw-r--r--sourcecodes/localscore/index.html6
-rw-r--r--sourcecodes/localscore/libRmath.sobin0 -> 204360 bytes
-rw-r--r--sourcecodes/localscore/libextern.h48
-rw-r--r--sourcecodes/localscore/matrix.h42
-rw-r--r--sourcecodes/localscore/modified_matrix.c252
-rw-r--r--sourcecodes/localscore/modified_postc.c171
-rw-r--r--sourcecodes/localscore/network_score.c1441
-rw-r--r--sourcecodes/localscore/network_score_old.c1438
-rw-r--r--sourcecodes/localscore/postc0.c81
-rw-r--r--sourcecodes/localscore/rlocale.h118
-rw-r--r--sourcecodes/localscore/stats_package.h71
-rw-r--r--sourcecodes/localscore/stats_stubs.h68
-rw-r--r--sourcecodes/mat_structure.php78
-rw-r--r--sourcecodes/matrix.php187
-rw-r--r--sourcecodes/maxparent_table.txt19
-rw-r--r--sourcecodes/my_new_style.css155
-rw-r--r--sourcecodes/net_structure.php137
-rw-r--r--sourcecodes/network_layout_evd.php667
-rw-r--r--sourcecodes/network_layout_evd_2.php961
-rw-r--r--sourcecodes/network_layout_evd_2_example.php953
-rw-r--r--sourcecodes/network_layout_evd_example.php651
-rw-r--r--sourcecodes/network_layout_inv.php664
-rw-r--r--sourcecodes/network_layout_inv_2.php1160
-rw-r--r--sourcecodes/network_layout_inv_2_example.php1154
-rw-r--r--sourcecodes/network_layout_inv_example.php657
-rw-r--r--sourcecodes/network_scorebin0 -> 44680 bytes
-rw-r--r--sourcecodes/print_structure/index.html6
-rw-r--r--sourcecodes/print_structure/structure.c97
-rw-r--r--sourcecodes/restructuremap.php42
-rw-r--r--sourcecodes/run.sh20
-rw-r--r--sourcecodes/runmat.sh7
-rw-r--r--sourcecodes/runmat_evd.sh4
-rw-r--r--sourcecodes/runmat_inv.sh4
-rw-r--r--sourcecodes/runtime_check.php63
-rw-r--r--sourcecodes/sf-homepage.css157
-rw-r--r--sourcecodes/structurebin0 -> 9519 bytes
-rw-r--r--sourcecodes/structuremap.php81
-rw-r--r--sourcecodes/tier_description_processing_gom.php216
-rw-r--r--sourcecodes/upload_structure_file.php315
-rw-r--r--sourcecodes/workflow.php51
456 files changed, 56769 insertions, 0 deletions
diff --git a/sourcecodes/BNW_overview.png b/sourcecodes/BNW_overview.png
new file mode 100644
index 00000000..67276d2a
--- /dev/null
+++ b/sourcecodes/BNW_overview.png
Binary files differdiff --git a/sourcecodes/BNW_workflow_1.htm b/sourcecodes/BNW_workflow_1.htm
new file mode 100644
index 00000000..603ad8d8
--- /dev/null
+++ b/sourcecodes/BNW_workflow_1.htm
@@ -0,0 +1,645 @@
+<html xmlns:v="urn:schemas-microsoft-com:vml"
+xmlns:o="urn:schemas-microsoft-com:office:office"
+xmlns:w="urn:schemas-microsoft-com:office:word"
+xmlns:m="http://schemas.microsoft.com/office/2004/12/omml"
+xmlns="http://www.w3.org/TR/REC-html40">
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<meta name=ProgId content=Word.Document>
+<meta name=Generator content="Microsoft Word 12">
+<meta name=Originator content="Microsoft Word 12">
+<link rel=File-List href="BNW_workflow_test_files/filelist.xml">
+<link rel=Edit-Time-Data href="BNW_workflow_test_files/editdata.mso">
+<link rel=themeData href="BNW_workflow_test_files/themedata.thmx">
+<link rel=colorSchemeMapping
+href="BNW_workflow_test_files/colorschememapping.xml">
+<style>
+<!--
+ /* Font Definitions */
+ @font-face
+	{font-family:"Cambria Math";
+	panose-1:2 4 5 3 5 4 6 3 2 4;
+	mso-font-charset:1;
+	mso-generic-font-family:roman;
+	mso-font-format:other;
+	mso-font-pitch:variable;
+	mso-font-signature:0 0 0 0 0 0;}
+@font-face
+	{font-family:Calibri;
+	panose-1:2 15 5 2 2 2 4 3 2 4;
+	mso-font-charset:0;
+	mso-generic-font-family:swiss;
+	mso-font-pitch:variable;
+	mso-font-signature:-1610611985 1073750139 0 0 159 0;}
+@font-face
+	{font-family:Tahoma;
+	panose-1:2 11 6 4 3 5 4 4 2 4;
+	mso-font-charset:0;
+	mso-generic-font-family:swiss;
+	mso-font-pitch:variable;
+	mso-font-signature:-520081665 -1073717157 41 0 66047 0;}
+ /* Style Definitions */
+ p.MsoNormal, li.MsoNormal, div.MsoNormal
+	{mso-style-unhide:no;
+	mso-style-qformat:yes;
+	mso-style-parent:"";
+	margin-top:0in;
+	margin-right:0in;
+	margin-bottom:10.0pt;
+	margin-left:0in;
+	line-height:115%;
+	mso-pagination:widow-orphan;
+	font-size:11.0pt;
+	font-family:"Calibri","sans-serif";
+	mso-ascii-font-family:Calibri;
+	mso-ascii-theme-font:minor-latin;
+	mso-fareast-font-family:Calibri;
+	mso-fareast-theme-font:minor-latin;
+	mso-hansi-font-family:Calibri;
+	mso-hansi-theme-font:minor-latin;
+	mso-bidi-font-family:"Times New Roman";
+	mso-bidi-theme-font:minor-bidi;}
+p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
+	{mso-style-noshow:yes;
+	mso-style-priority:99;
+	mso-style-link:"Balloon Text Char";
+	margin:0in;
+	margin-bottom:.0001pt;
+	mso-pagination:widow-orphan;
+	font-size:8.0pt;
+	font-family:"Tahoma","sans-serif";
+	mso-fareast-font-family:Calibri;
+	mso-fareast-theme-font:minor-latin;}
+p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
+	{mso-style-priority:34;
+	mso-style-unhide:no;
+	mso-style-qformat:yes;
+	margin-top:0in;
+	margin-right:0in;
+	margin-bottom:10.0pt;
+	margin-left:.5in;
+	mso-add-space:auto;
+	line-height:115%;
+	mso-pagination:widow-orphan;
+	font-size:11.0pt;
+	font-family:"Calibri","sans-serif";
+	mso-ascii-font-family:Calibri;
+	mso-ascii-theme-font:minor-latin;
+	mso-fareast-font-family:Calibri;
+	mso-fareast-theme-font:minor-latin;
+	mso-hansi-font-family:Calibri;
+	mso-hansi-theme-font:minor-latin;
+	mso-bidi-font-family:"Times New Roman";
+	mso-bidi-theme-font:minor-bidi;}
+p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst
+	{mso-style-priority:34;
+	mso-style-unhide:no;
+	mso-style-qformat:yes;
+	mso-style-type:export-only;
+	margin-top:0in;
+	margin-right:0in;
+	margin-bottom:0in;
+	margin-left:.5in;
+	margin-bottom:.0001pt;
+	mso-add-space:auto;
+	line-height:115%;
+	mso-pagination:widow-orphan;
+	font-size:11.0pt;
+	font-family:"Calibri","sans-serif";
+	mso-ascii-font-family:Calibri;
+	mso-ascii-theme-font:minor-latin;
+	mso-fareast-font-family:Calibri;
+	mso-fareast-theme-font:minor-latin;
+	mso-hansi-font-family:Calibri;
+	mso-hansi-theme-font:minor-latin;
+	mso-bidi-font-family:"Times New Roman";
+	mso-bidi-theme-font:minor-bidi;}
+p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle
+	{mso-style-priority:34;
+	mso-style-unhide:no;
+	mso-style-qformat:yes;
+	mso-style-type:export-only;
+	margin-top:0in;
+	margin-right:0in;
+	margin-bottom:0in;
+	margin-left:.5in;
+	margin-bottom:.0001pt;
+	mso-add-space:auto;
+	line-height:115%;
+	mso-pagination:widow-orphan;
+	font-size:11.0pt;
+	font-family:"Calibri","sans-serif";
+	mso-ascii-font-family:Calibri;
+	mso-ascii-theme-font:minor-latin;
+	mso-fareast-font-family:Calibri;
+	mso-fareast-theme-font:minor-latin;
+	mso-hansi-font-family:Calibri;
+	mso-hansi-theme-font:minor-latin;
+	mso-bidi-font-family:"Times New Roman";
+	mso-bidi-theme-font:minor-bidi;}
+p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast
+	{mso-style-priority:34;
+	mso-style-unhide:no;
+	mso-style-qformat:yes;
+	mso-style-type:export-only;
+	margin-top:0in;
+	margin-right:0in;
+	margin-bottom:10.0pt;
+	margin-left:.5in;
+	mso-add-space:auto;
+	line-height:115%;
+	mso-pagination:widow-orphan;
+	font-size:11.0pt;
+	font-family:"Calibri","sans-serif";
+	mso-ascii-font-family:Calibri;
+	mso-ascii-theme-font:minor-latin;
+	mso-fareast-font-family:Calibri;
+	mso-fareast-theme-font:minor-latin;
+	mso-hansi-font-family:Calibri;
+	mso-hansi-theme-font:minor-latin;
+	mso-bidi-font-family:"Times New Roman";
+	mso-bidi-theme-font:minor-bidi;}
+span.BalloonTextChar
+	{mso-style-name:"Balloon Text Char";
+	mso-style-noshow:yes;
+	mso-style-priority:99;
+	mso-style-unhide:no;
+	mso-style-locked:yes;
+	mso-style-link:"Balloon Text";
+	mso-ansi-font-size:8.0pt;
+	mso-bidi-font-size:8.0pt;
+	font-family:"Tahoma","sans-serif";
+	mso-ascii-font-family:Tahoma;
+	mso-hansi-font-family:Tahoma;
+	mso-bidi-font-family:Tahoma;}
+.MsoChpDefault
+	{mso-style-type:export-only;
+	mso-default-props:yes;
+	font-size:10.0pt;
+	mso-ansi-font-size:10.0pt;
+	mso-bidi-font-size:10.0pt;
+	mso-ascii-font-family:Calibri;
+	mso-ascii-theme-font:minor-latin;
+	mso-fareast-font-family:Calibri;
+	mso-fareast-theme-font:minor-latin;
+	mso-hansi-font-family:Calibri;
+	mso-hansi-theme-font:minor-latin;
+	mso-bidi-font-family:"Times New Roman";
+	mso-bidi-theme-font:minor-bidi;}
+@page WordSection1
+	{size:8.5in 11.0in;
+	margin:1.0in 1.0in 1.0in 1.0in;
+	mso-header-margin:.5in;
+	mso-footer-margin:.5in;
+	mso-paper-source:0;}
+div.WordSection1
+	{page:WordSection1;}
+ /* List Definitions */
+ @list l0
+	{mso-list-id:779757819;
+	mso-list-type:hybrid;
+	mso-list-template-ids:939584274 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
+@list l0:level1
+	{mso-level-text:"%1\)";
+	mso-level-tab-stop:none;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l0:level2
+	{mso-level-tab-stop:1.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l0:level3
+	{mso-level-tab-stop:1.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l0:level4
+	{mso-level-tab-stop:2.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l0:level5
+	{mso-level-tab-stop:2.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l0:level6
+	{mso-level-tab-stop:3.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l0:level7
+	{mso-level-tab-stop:3.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l0:level8
+	{mso-level-tab-stop:4.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l0:level9
+	{mso-level-tab-stop:4.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1
+	{mso-list-id:1813714603;
+	mso-list-type:hybrid;
+	mso-list-template-ids:939584274 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
+@list l1:level1
+	{mso-level-text:"%1\)";
+	mso-level-tab-stop:none;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level2
+	{mso-level-tab-stop:1.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level3
+	{mso-level-tab-stop:1.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level4
+	{mso-level-tab-stop:2.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level5
+	{mso-level-tab-stop:2.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level6
+	{mso-level-tab-stop:3.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level7
+	{mso-level-tab-stop:3.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level8
+	{mso-level-tab-stop:4.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level9
+	{mso-level-tab-stop:4.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+ol
+	{margin-bottom:0in;}
+ul
+	{margin-bottom:0in;}
+-->
+</style>
+<!--[if gte mso 10]>
+<style>
+ /* Style Definitions */
+ table.MsoNormalTable
+	{mso-style-name:"Table Normal";
+	mso-tstyle-rowband-size:0;
+	mso-tstyle-colband-size:0;
+	mso-style-noshow:yes;
+	mso-style-priority:99;
+	mso-style-qformat:yes;
+	mso-style-parent:"";
+	mso-padding-alt:0in 5.4pt 0in 5.4pt;
+	mso-para-margin:0in;
+	mso-para-margin-bottom:.0001pt;
+	mso-pagination:widow-orphan;
+	font-size:10.0pt;
+	font-family:"Calibri","sans-serif";
+	mso-ascii-font-family:Calibri;
+	mso-ascii-theme-font:minor-latin;
+	mso-hansi-font-family:Calibri;
+	mso-hansi-theme-font:minor-latin;}
+</style>
+<![endif]--><!--[if gte mso 9]><xml>
+ <o:shapedefaults v:ext="edit" spidmax="4098"/>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <o:shapelayout v:ext="edit">
+  <o:idmap v:ext="edit" data="1"/>
+ </o:shapelayout></xml><![endif]-->
+</head>
+
+<body lang=EN-US style='tab-interval:.5in'>
+
+<div class=WordSection1>
+
+<p class=MsoNormal style='margin-right:307.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif"'>This workflow will provide
+an overview of how to use BNW to:<o:p></o:p></span></p>
+
+<p class=MsoListParagraphCxSpFirst style='margin-right:307.5pt;mso-add-space:
+auto;text-indent:-.25in;mso-list:l1 level1 lfo2'><![if !supportLists]><span
+style='font-size:12.0pt;line-height:115%;font-family:"Arial","sans-serif";
+mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>1)<span
+style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span
+style='font-size:12.0pt;line-height:115%;font-family:"Arial","sans-serif"'>Select
+a structure learning method and upload data into BNW<o:p></o:p></span></p>
+
+<p class=MsoListParagraphCxSpMiddle style='margin-right:307.5pt;mso-add-space:
+auto;text-indent:-.25in;mso-list:l1 level1 lfo2'><![if !supportLists]><span
+style='font-size:12.0pt;line-height:115%;font-family:"Arial","sans-serif";
+mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>2)<span
+style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span
+style='font-size:12.0pt;line-height:115%;font-family:"Arial","sans-serif"'>Use
+the BNW structural restraint interface<o:p></o:p></span></p>
+
+<p class=MsoListParagraphCxSpLast style='margin-right:307.5pt;mso-add-space:
+auto;text-indent:-.25in;mso-list:l1 level1 lfo2'><![if !supportLists]><span
+style='font-size:12.0pt;line-height:115%;font-family:"Arial","sans-serif";
+mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>3)<span
+style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span
+style='font-size:12.0pt;line-height:115%;font-family:"Arial","sans-serif"'>Make
+predictions with the network structure<o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-top:0in;margin-right:307.5pt;margin-bottom:
+0in;margin-left:0in;margin-bottom:.0001pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif"'><o:p>&nbsp;</o:p></span></p>
+
+<p class=MsoNormal style='margin-right:307.5pt'><b style='mso-bidi-font-weight:
+normal'><span style='font-size:14.0pt;line-height:115%;font-family:"Arial","sans-serif"'>1.
+Select structure learning method and uploading data into BNW<o:p></o:p></span></b></p>
+
+<p class=MsoNormal style='margin-top:0in;margin-right:307.5pt;margin-bottom:
+0in;margin-left:0in;margin-bottom:.0001pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif"'>For this workflow, we are
+creating a network using a biological data set containing both continuous and
+discrete variables. The variables are a genotype (the discrete variable), three
+gene expression traits (Gene1, Gene2, Gene3), and a phenotype.<o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-top:0in;margin-right:307.5pt;margin-bottom:
+0in;margin-left:0in;margin-bottom:.0001pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif"'><o:p>&nbsp;</o:p></span></p>
+
+<p class=MsoNormal style='margin-top:0in;margin-right:307.5pt;margin-bottom:
+0in;margin-left:0in;margin-bottom:.0001pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif"'>We do not know the network
+structure for this dataset, so we will first use BNW to learn the structure. Selecting
+<u>Learn a network model from data</u> on the BNW home page presents a list of the
+three structure learning methods that are currently implemented in BNW. <o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-right:307.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'><!--[if gte vml 1]><v:shapetype
+ id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t"
+ path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f">
+ <v:stroke joinstyle="miter"/>
+ <v:formulas>
+  <v:f eqn="if lineDrawn pixelLineWidth 0"/>
+  <v:f eqn="sum @0 1 0"/>
+  <v:f eqn="sum 0 0 @1"/>
+  <v:f eqn="prod @2 1 2"/>
+  <v:f eqn="prod @3 21600 pixelWidth"/>
+  <v:f eqn="prod @3 21600 pixelHeight"/>
+  <v:f eqn="sum @0 0 1"/>
+  <v:f eqn="prod @6 1 2"/>
+  <v:f eqn="prod @7 21600 pixelWidth"/>
+  <v:f eqn="sum @8 21600 0"/>
+  <v:f eqn="prod @7 21600 pixelHeight"/>
+  <v:f eqn="sum @10 21600 0"/>
+ </v:formulas>
+ <v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/>
+ <o:lock v:ext="edit" aspectratio="t"/>
+</v:shapetype><v:shape id="Picture_x0020_2" o:spid="_x0000_i1037" type="#_x0000_t75"
+ style='width:300pt;height:117pt;visibility:visible;mso-wrap-style:square'>
+ <v:imagedata src="BNW_workflow_test_files/image003.jpg" o:title="" croptop="19333f"
+  cropbottom="34461f" cropleft="11633f" cropright="33260f"/>
+</v:shape><![endif]--><![if !vml]><img width=450 height=156
+src="BNW_workflow_test_files/image003.jpg" v:shapes="Picture_x0020_2"><![endif]></span><span
+style='font-size:12.0pt;line-height:115%;font-family:"Arial","sans-serif"'><o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-top:0in;margin-right:307.5pt;margin-bottom:
+0in;margin-left:0in;margin-bottom:.0001pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif"'>Because the network contains
+only 5 variables, we can use any of these structure learning methods. If more
+than 6 variables are present, using the global optimal search method would likely be necessary.
+We will use the exhaustive search with model averaging method in this workflow.
+More information about the structure learning methods can be found on the BNW
+help page.<o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-top:0in;margin-right:307.5pt;margin-bottom:
+0in;margin-left:0in;margin-bottom:.0001pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif"'><o:p>&nbsp;</o:p></span></p>
+
+<p class=MsoNormal style='margin-top:0in;margin-right:307.5pt;margin-bottom:
+0in;margin-left:0in;margin-bottom:.0001pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif"'>After selecting the
+Exhaustive Search button, we are prompted to upload a file containing the data.
+<o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-right:307.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'>
+<img width=700 height=225
+src="BNW_workflow_test_files/image006.jpg" v:shapes="Picture_x0020_5"><o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-top:0in;margin-right:307.5pt;margin-bottom:
+0in;margin-left:0in;margin-bottom:.0001pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'><br>The figure
+below shows BNW after we have uploaded the data file. The first line of the
+data contains the names of the variables included in the network, while the
+remaining lines are the variable values for individual samples. A description
+of how to format data files for use in BNW can be found on the BNW help page and can be accessed by the the <u>Data formatting guidelines</u> option in the left menu. Additionally, two additional options, <u>Select additional constraints</u> or <u>Perform Bayesian network modeling with no restraints</u>, appear in the left menu after loading the data file.<o:p></o:p></span></p><br>
+
+<p class=MsoNormal style='margin-right:307.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'>
+<![if !vml]><img width=675 height=225
+src="BNW_workflow_test_files/image008.jpg" v:shapes="Picture_x0020_8"><![endif]><o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-right:307.5pt'><b style='mso-bidi-font-weight:
+normal'><span style='font-size:14.0pt;line-height:115%;font-family:"Arial","sans-serif"'>2.
+Use the structural constraint interface<o:p></o:p></span></b></p>
+
+<p class=MsoNormal style='margin-top:0in;margin-right:307.5pt;margin-bottom:
+0in;margin-left:0in;margin-bottom:.0001pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'>Here, we will use the
+structural constraint interface to help identify biologically meaningful
+network structures. Specifically, we want to investigate how the genotype
+impacts gene expression which then impacts the phenotype.<o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-top:0in;margin-right:307.5pt;margin-bottom:
+0in;margin-left:0in;margin-bottom:.0001pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'><o:p>&nbsp;</o:p></span></p>
+
+<p class=MsoNormal style='margin-top:0in;margin-right:307.5pt;margin-bottom:
+0in;margin-left:0in;margin-bottom:.0001pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'>The first
+section of the structural constraint interface allows users to assign the variables
+(nodes) in the network to tiers. By default, three tiers are shown, but this
+can be changed by selecting a different number in the drop-down menu. The
+leftmost box of this section contains draggable boxes with the names of the
+variables in the network. <o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-right:307.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'>
+<![if !vml]><img width=750 height=300
+src="BNW_workflow_test_files/image010.jpg" v:shapes="Picture_x0020_14"><![endif]><o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-top:0in;margin-right:307.5pt;margin-bottom:
+0in;margin-left:0in;margin-bottom:.0001pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'>For this
+network, we want to assign Genotype to Tier1, the gene expression traits to
+Tier2, and the Phenotype to Tier3.<o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-right:307.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'>
+<![if !vml]><img width=750 height=300
+src="BNW_workflow_test_files/image012.jpg" v:shapes="Picture_x0020_17"><![endif]><o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-right:307.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'>The second
+section in the structural constraint interface allows users to specify the
+types of interactions that are allowed both between and within tiers. In this
+case, we will keep the default settings, which will allow there to be edges
+between nodes within a tier, prevent nodes in Tier1 from being the child of
+Tier2 and Tier3 nodes, and prevent nodes in Tier2 from being the child of Tier2
+nodes. <o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-right:307.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'><![if !vml]><img width=475 height=200
+src="BNW_workflow_test_files/image014.jpg" v:shapes="Picture_x0020_20"><![endif]><o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-right:307.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'>The final
+section of the structural constraint interface would allow for the
+specification of particular edges that should be banned from the network or
+required to be in the network. Users can identify these edges by dragging the
+nodes to appropriate boxes. In this case, we do not want to ban or require any
+specific edges. <o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-right:307.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'>
+<![if !vml]><img width=430 height=227
+src="BNW_workflow_test_files/image016.jpg" v:shapes="Picture_x0020_23"><![endif]><o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-right:307.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'>After
+entering the structural constraints, BNW will perform structure learning from
+the data after clicking <u>Perform Bayesin network modeling</u> on the left menu and
+present the structure of the network as shown below. Genotype, the discrete
+node, is shown as a bar chart with the bars showing the fraction of samples
+with each genotype in the data, while the other nodes are shown as lines with
+the Gaussian distributions that best fit the data.<o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-right:307.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'><!--[if gte vml 1]><v:shape
+ id="Picture_x0020_26" o:spid="_x0000_i1030" type="#_x0000_t75" style='width:367.5pt;
+ height:400.5pt;visibility:visible;mso-wrap-style:square'>
+ <v:imagedata src="BNW_workflow_test_files/image017.png" o:title="" croptop="11774f"
+  cropbottom="5139f" cropleft="15267f" cropright="16897f"/>
+</v:shape><![endif]--><![if !vml]><img width=490 height=534
+src="BNW_workflow_test_files/image018.jpg" v:shapes="Picture_x0020_26"><![endif]><o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-right:307.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'>To further
+investigate the structure of the network, users can select <u>Display Structure
+Matrix</u> in the left menu. This will bring up a popup windoe containing a table
+showing the confidence of each directed edge in the network after model
+averaging. For this network, all of the nodes included in the network were
+present in almost all high scoring networks, as the values of the edges are all
+near 1. BNW displays all edges with a confidence greater than 0.5 in the
+network structure. A second table in the window shows the structure matrix with
+a 1 for edges included in the structure and 0 for edges that are not included. These
+tables can be downloaded by clicking the download link.<o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-right:307.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'><!--[if gte vml 1]><v:shape
+ id="Picture_x0020_41" o:spid="_x0000_i1029" type="#_x0000_t75" style='width:358.5pt;
+ height:158.25pt;visibility:visible;mso-wrap-style:square'>
+ <v:imagedata src="BNW_workflow_test_files/image033.png" o:title="" croptop="19224f"
+  cropbottom="21354f" cropleft="10363f" cropright="12698f"/>
+</v:shape><![endif]--><![if !vml]><img width=478 height=211
+src="BNW_workflow_test_files/image020.jpg" v:shapes="Picture_x0020_41"><![endif]><o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-right:307.5pt'><b style='mso-bidi-font-weight:
+normal'><span style='font-size:14.0pt;line-height:115%;font-family:"Arial","sans-serif";
+mso-no-proof:yes'>3) </span></b><b style='mso-bidi-font-weight:normal'><span
+style='font-size:14.0pt;line-height:115%;font-family:"Arial","sans-serif"'>Make
+predictions with the network structure<o:p></o:p></span></b></p>
+
+<p class=MsoNormal style='margin-right:307.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif"'>BNW can be used to both
+predict the values of variables in a network given known evidence and to
+investigate how the network might change in response to interventions. Users
+can switch between evidence and intervention modes by selecting the proper
+button on the top of the page containing the network structure.<o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-right:307.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif"'>For example,
+suppose we want to use the model to make predictions for a new sample that was
+not in the original dataset. We know that this sample was from an individual
+with Genotype=2 and want to predict the values of the genes and phenotype for
+the individual. To enter this evidence in the network, we simply click on the
+Genotype node in the network and enter 2 in the popup window. <o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-right:307.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif"'>The figure below shows the
+changes in the network after entering this evidence.The node for which evidence was entered now contains a red outline and all of the nodes in the network now contain both blue and red lines. The blue lines show the original values of the distributions, while the red lines shown the predicted values given the
+evidence. In this case, knowing that the individual had Genotype=2 would cause
+us to predict that the expression of Gene1 and the value of the phenotype would
+be above average, while the expression of Gene2 and Gene3 would be decreases.
+The specific changes in the predicted values can be investigated by hovering
+over the nodes and observing the values at the peaks of the distribution.<o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-right:307.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'><!--[if gte vml 1]><v:shape
+ id="Picture_x0020_29" o:spid="_x0000_i1028" type="#_x0000_t75" style='width:352.5pt;
+ height:464.25pt;visibility:visible;mso-wrap-style:square'>
+ <v:imagedata src="BNW_workflow_test_files/image019.png" o:title="" croptop="5662f"
+  cropbottom="3557f" cropleft="15900f" cropright="17569f"/>
+</v:shape><![endif]--><![if !vml]><img width=470 height=619
+src="BNW_workflow_test_files/image022.jpg" v:shapes="Picture_x0020_29"><![endif]><o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-right:307.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'>Evidence
+can be entered in more than one node in the network. For example, the figure
+below shows predicted values for the network after entering evidence for both
+Genotype and Gene1.<o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-right:307.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'><!--[if gte vml 1]><v:shape
+ id="Picture_x0020_32" o:spid="_x0000_i1027" type="#_x0000_t75" style='width:291.75pt;
+ height:414pt;visibility:visible;mso-wrap-style:square'>
+ <v:imagedata src="BNW_workflow_test_files/image021.png" o:title="" croptop="9437f"
+  cropbottom="5850f" cropleft="16919f" cropright="22117f"/>
+</v:shape><![endif]--><![if !vml]><img width=389 height=552
+src="BNW_workflow_test_files/image024.jpg" v:shapes="Picture_x0020_32"><![endif]><o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-right:307.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'>To use the
+network to predict the results of intervention, select the proper button on the
+top of the window to enter intervention mode. While evidence simply changes the
+predicted values of the other nodes in the network, intervention has a larger
+effect, as it removes the dependence of the intervened network on its parents
+and changes the network structure. <o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-right:307.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'><!--[if gte vml 1]><v:shape
+ id="Picture_x0020_35" o:spid="_x0000_i1026" type="#_x0000_t75" style='width:295.5pt;
+ height:417.75pt;visibility:visible;mso-wrap-style:square'>
+ <v:imagedata src="BNW_workflow_test_files/image023.png" o:title="" croptop="9437f"
+  cropbottom="5375f" cropleft="16718f" cropright="21976f"/>
+</v:shape><![endif]--><![if !vml]><img width=394 height=557
+src="BNW_workflow_test_files/image026.jpg" v:shapes="Picture_x0020_35"><![endif]><o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-right:307.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'>The figure
+below shows the changes in the network in BNW after intervention on Gene1 that
+results Gene1 having a low value. The predictions of the network after this
+intervention could be compared with experiments that prevent Gene1 from being
+expressed. Intervention that decreases Gene1 is predicted to result in an increase
+in Gene2 and a decrease in the phenotype. Note that Genotype and Gene3, which
+are not descendents of Gene1, are not affected by the intervention.<o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-right:307.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'><!--[if gte vml 1]><v:shape
+ id="Picture_x0020_38" o:spid="_x0000_i1025" type="#_x0000_t75" style='width:297.75pt;
+ height:406.5pt;visibility:visible;mso-wrap-style:square'>
+ <v:imagedata src="BNW_workflow_test_files/image025.png" o:title="" croptop="9382f"
+  cropbottom="6755f" cropleft="16815f" cropright="21642f"/>
+</v:shape><![endif]--><![if !vml]><img width=397 height=542
+src="BNW_workflow_test_files/image039.jpg" v:shapes="Picture_x0020_38"><![endif]><o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-right:307.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'><o:p>&nbsp;</o:p></span></p>
+
+<p class=MsoNormal style='margin-right:307.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif"'><o:p>&nbsp;</o:p></span></p>
+
+</div>
+
+</body>
+
+</html>
diff --git a/sourcecodes/BNW_workflow_2.htm b/sourcecodes/BNW_workflow_2.htm
new file mode 100644
index 00000000..577a388e
--- /dev/null
+++ b/sourcecodes/BNW_workflow_2.htm
@@ -0,0 +1,731 @@
+<html xmlns:v="urn:schemas-microsoft-com:vml"
+xmlns:o="urn:schemas-microsoft-com:office:office"
+xmlns:w="urn:schemas-microsoft-com:office:word"
+xmlns:m="http://schemas.microsoft.com/office/2004/12/omml"
+xmlns="http://www.w3.org/TR/REC-html40">
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<meta name=ProgId content=Word.Document>
+<meta name=Generator content="Microsoft Word 12">
+<meta name=Originator content="Microsoft Word 12">
+<link rel=File-List href="BNW_workflow_test_files/filelist.xml">
+<link rel=Edit-Time-Data href="BNW_workflow_test_files/editdata.mso">
+<!--[if !mso]>
+<style>
+v\:* {behavior:url(#default#VML);}
+o\:* {behavior:url(#default#VML);}
+w\:* {behavior:url(#default#VML);}
+.shape {behavior:url(#default#VML);}
+</style>
+<![endif]--><!--[if gte mso 9]><xml>
+ <o:DocumentProperties>
+  <o:Author>Admin</o:Author>
+  <o:LastAuthor>Admin</o:LastAuthor>
+  <o:Revision>19</o:Revision>
+  <o:TotalTime>249</o:TotalTime>
+  <o:Created>2012-11-26T22:35:00Z</o:Created>
+  <o:LastSaved>2012-11-27T21:40:00Z</o:LastSaved>
+  <o:Pages>5</o:Pages>
+  <o:Words>1033</o:Words>
+  <o:Characters>5892</o:Characters>
+  <o:Company>The University of Memphis</o:Company>
+  <o:Lines>49</o:Lines>
+  <o:Paragraphs>13</o:Paragraphs>
+  <o:CharactersWithSpaces>6912</o:CharactersWithSpaces>
+  <o:Version>12.00</o:Version>
+ </o:DocumentProperties>
+</xml><![endif]-->
+<link rel=themeData href="BNW_workflow_test_files/themedata.thmx">
+<link rel=colorSchemeMapping
+href="BNW_workflow_test_files/colorschememapping.xml">
+<!--[if gte mso 9]><xml>
+ <w:WordDocument>
+  <w:SpellingState>Clean</w:SpellingState>
+  <w:GrammarState>Clean</w:GrammarState>
+  <w:TrackMoves>false</w:TrackMoves>
+  <w:TrackFormatting/>
+  <w:PunctuationKerning/>
+  <w:ValidateAgainstSchemas/>
+  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
+  <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
+  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
+  <w:DoNotPromoteQF/>
+  <w:LidThemeOther>EN-US</w:LidThemeOther>
+  <w:LidThemeAsian>X-NONE</w:LidThemeAsian>
+  <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
+  <w:Compatibility>
+   <w:BreakWrappedTables/>
+   <w:SnapToGridInCell/>
+   <w:WrapTextWithPunct/>
+   <w:UseAsianBreakRules/>
+   <w:DontGrowAutofit/>
+   <w:SplitPgBreakAndParaMark/>
+   <w:DontVertAlignCellWithSp/>
+   <w:DontBreakConstrainedForcedTables/>
+   <w:DontVertAlignInTxbx/>
+   <w:Word11KerningPairs/>
+   <w:CachedColBalance/>
+  </w:Compatibility>
+  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
+  <m:mathPr>
+   <m:mathFont m:val="Cambria Math"/>
+   <m:brkBin m:val="before"/>
+   <m:brkBinSub m:val="&#45;-"/>
+   <m:smallFrac m:val="off"/>
+   <m:dispDef/>
+   <m:lMargin m:val="0"/>
+   <m:rMargin m:val="0"/>
+   <m:defJc m:val="centerGroup"/>
+   <m:wrapIndent m:val="1440"/>
+   <m:intLim m:val="subSup"/>
+   <m:naryLim m:val="undOvr"/>
+  </m:mathPr></w:WordDocument>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
+  DefSemiHidden="true" DefQFormat="false" DefPriority="99"
+  LatentStyleCount="267">
+  <w:LsdException Locked="false" Priority="0" SemiHidden="false"
+   UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
+  <w:LsdException Locked="false" Priority="9" SemiHidden="false"
+   UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
+  <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
+  <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
+  <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
+  <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
+  <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
+  <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
+  <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
+  <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
+  <w:LsdException Locked="false" Priority="39" Name="toc 1"/>
+  <w:LsdException Locked="false" Priority="39" Name="toc 2"/>
+  <w:LsdException Locked="false" Priority="39" Name="toc 3"/>
+  <w:LsdException Locked="false" Priority="39" Name="toc 4"/>
+  <w:LsdException Locked="false" Priority="39" Name="toc 5"/>
+  <w:LsdException Locked="false" Priority="39" Name="toc 6"/>
+  <w:LsdException Locked="false" Priority="39" Name="toc 7"/>
+  <w:LsdException Locked="false" Priority="39" Name="toc 8"/>
+  <w:LsdException Locked="false" Priority="39" Name="toc 9"/>
+  <w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
+  <w:LsdException Locked="false" Priority="10" SemiHidden="false"
+   UnhideWhenUsed="false" QFormat="true" Name="Title"/>
+  <w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
+  <w:LsdException Locked="false" Priority="11" SemiHidden="false"
+   UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
+  <w:LsdException Locked="false" Priority="22" SemiHidden="false"
+   UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
+  <w:LsdException Locked="false" Priority="20" SemiHidden="false"
+   UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
+  <w:LsdException Locked="false" Priority="59" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Table Grid"/>
+  <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
+  <w:LsdException Locked="false" Priority="1" SemiHidden="false"
+   UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
+  <w:LsdException Locked="false" Priority="60" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Light Shading"/>
+  <w:LsdException Locked="false" Priority="61" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Light List"/>
+  <w:LsdException Locked="false" Priority="62" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Light Grid"/>
+  <w:LsdException Locked="false" Priority="63" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium Shading 1"/>
+  <w:LsdException Locked="false" Priority="64" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium Shading 2"/>
+  <w:LsdException Locked="false" Priority="65" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium List 1"/>
+  <w:LsdException Locked="false" Priority="66" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium List 2"/>
+  <w:LsdException Locked="false" Priority="67" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium Grid 1"/>
+  <w:LsdException Locked="false" Priority="68" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium Grid 2"/>
+  <w:LsdException Locked="false" Priority="69" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium Grid 3"/>
+  <w:LsdException Locked="false" Priority="70" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Dark List"/>
+  <w:LsdException Locked="false" Priority="71" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Colorful Shading"/>
+  <w:LsdException Locked="false" Priority="72" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Colorful List"/>
+  <w:LsdException Locked="false" Priority="73" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Colorful Grid"/>
+  <w:LsdException Locked="false" Priority="60" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
+  <w:LsdException Locked="false" Priority="61" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Light List Accent 1"/>
+  <w:LsdException Locked="false" Priority="62" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
+  <w:LsdException Locked="false" Priority="63" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
+  <w:LsdException Locked="false" Priority="64" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
+  <w:LsdException Locked="false" Priority="65" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
+  <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
+  <w:LsdException Locked="false" Priority="34" SemiHidden="false"
+   UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
+  <w:LsdException Locked="false" Priority="29" SemiHidden="false"
+   UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
+  <w:LsdException Locked="false" Priority="30" SemiHidden="false"
+   UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
+  <w:LsdException Locked="false" Priority="66" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
+  <w:LsdException Locked="false" Priority="67" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
+  <w:LsdException Locked="false" Priority="68" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
+  <w:LsdException Locked="false" Priority="69" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
+  <w:LsdException Locked="false" Priority="70" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Dark List Accent 1"/>
+  <w:LsdException Locked="false" Priority="71" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
+  <w:LsdException Locked="false" Priority="72" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
+  <w:LsdException Locked="false" Priority="73" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
+  <w:LsdException Locked="false" Priority="60" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
+  <w:LsdException Locked="false" Priority="61" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Light List Accent 2"/>
+  <w:LsdException Locked="false" Priority="62" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
+  <w:LsdException Locked="false" Priority="63" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
+  <w:LsdException Locked="false" Priority="64" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
+  <w:LsdException Locked="false" Priority="65" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
+  <w:LsdException Locked="false" Priority="66" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
+  <w:LsdException Locked="false" Priority="67" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
+  <w:LsdException Locked="false" Priority="68" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
+  <w:LsdException Locked="false" Priority="69" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
+  <w:LsdException Locked="false" Priority="70" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Dark List Accent 2"/>
+  <w:LsdException Locked="false" Priority="71" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
+  <w:LsdException Locked="false" Priority="72" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
+  <w:LsdException Locked="false" Priority="73" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
+  <w:LsdException Locked="false" Priority="60" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
+  <w:LsdException Locked="false" Priority="61" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Light List Accent 3"/>
+  <w:LsdException Locked="false" Priority="62" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
+  <w:LsdException Locked="false" Priority="63" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
+  <w:LsdException Locked="false" Priority="64" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
+  <w:LsdException Locked="false" Priority="65" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
+  <w:LsdException Locked="false" Priority="66" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
+  <w:LsdException Locked="false" Priority="67" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
+  <w:LsdException Locked="false" Priority="68" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
+  <w:LsdException Locked="false" Priority="69" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
+  <w:LsdException Locked="false" Priority="70" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Dark List Accent 3"/>
+  <w:LsdException Locked="false" Priority="71" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
+  <w:LsdException Locked="false" Priority="72" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
+  <w:LsdException Locked="false" Priority="73" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
+  <w:LsdException Locked="false" Priority="60" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
+  <w:LsdException Locked="false" Priority="61" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Light List Accent 4"/>
+  <w:LsdException Locked="false" Priority="62" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
+  <w:LsdException Locked="false" Priority="63" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
+  <w:LsdException Locked="false" Priority="64" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
+  <w:LsdException Locked="false" Priority="65" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
+  <w:LsdException Locked="false" Priority="66" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
+  <w:LsdException Locked="false" Priority="67" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
+  <w:LsdException Locked="false" Priority="68" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
+  <w:LsdException Locked="false" Priority="69" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
+  <w:LsdException Locked="false" Priority="70" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Dark List Accent 4"/>
+  <w:LsdException Locked="false" Priority="71" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
+  <w:LsdException Locked="false" Priority="72" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
+  <w:LsdException Locked="false" Priority="73" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
+  <w:LsdException Locked="false" Priority="60" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
+  <w:LsdException Locked="false" Priority="61" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Light List Accent 5"/>
+  <w:LsdException Locked="false" Priority="62" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
+  <w:LsdException Locked="false" Priority="63" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
+  <w:LsdException Locked="false" Priority="64" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
+  <w:LsdException Locked="false" Priority="65" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
+  <w:LsdException Locked="false" Priority="66" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
+  <w:LsdException Locked="false" Priority="67" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
+  <w:LsdException Locked="false" Priority="68" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
+  <w:LsdException Locked="false" Priority="69" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
+  <w:LsdException Locked="false" Priority="70" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Dark List Accent 5"/>
+  <w:LsdException Locked="false" Priority="71" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
+  <w:LsdException Locked="false" Priority="72" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
+  <w:LsdException Locked="false" Priority="73" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
+  <w:LsdException Locked="false" Priority="60" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
+  <w:LsdException Locked="false" Priority="61" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Light List Accent 6"/>
+  <w:LsdException Locked="false" Priority="62" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
+  <w:LsdException Locked="false" Priority="63" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
+  <w:LsdException Locked="false" Priority="64" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
+  <w:LsdException Locked="false" Priority="65" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
+  <w:LsdException Locked="false" Priority="66" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
+  <w:LsdException Locked="false" Priority="67" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
+  <w:LsdException Locked="false" Priority="68" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
+  <w:LsdException Locked="false" Priority="69" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
+  <w:LsdException Locked="false" Priority="70" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Dark List Accent 6"/>
+  <w:LsdException Locked="false" Priority="71" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
+  <w:LsdException Locked="false" Priority="72" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
+  <w:LsdException Locked="false" Priority="73" SemiHidden="false"
+   UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
+  <w:LsdException Locked="false" Priority="19" SemiHidden="false"
+   UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
+  <w:LsdException Locked="false" Priority="21" SemiHidden="false"
+   UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
+  <w:LsdException Locked="false" Priority="31" SemiHidden="false"
+   UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
+  <w:LsdException Locked="false" Priority="32" SemiHidden="false"
+   UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
+  <w:LsdException Locked="false" Priority="33" SemiHidden="false"
+   UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
+  <w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
+  <w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
+ </w:LatentStyles>
+</xml><![endif]-->
+<style>
+<!--
+ /* Font Definitions */
+ @font-face
+	{font-family:"Cambria Math";
+	panose-1:2 4 5 3 5 4 6 3 2 4;
+	mso-font-charset:1;
+	mso-generic-font-family:roman;
+	mso-font-format:other;
+	mso-font-pitch:variable;
+	mso-font-signature:0 0 0 0 0 0;}
+@font-face
+	{font-family:Calibri;
+	panose-1:2 15 5 2 2 2 4 3 2 4;
+	mso-font-charset:0;
+	mso-generic-font-family:swiss;
+	mso-font-pitch:variable;
+	mso-font-signature:-1610611985 1073750139 0 0 159 0;}
+@font-face
+	{font-family:Tahoma;
+	panose-1:2 11 6 4 3 5 4 4 2 4;
+	mso-font-charset:0;
+	mso-generic-font-family:swiss;
+	mso-font-pitch:variable;
+	mso-font-signature:-520081665 -1073717157 41 0 66047 0;}
+ /* Style Definitions */
+ p.MsoNormal, li.MsoNormal, div.MsoNormal
+	{mso-style-unhide:no;
+	mso-style-qformat:yes;
+	mso-style-parent:"";
+	margin-top:0in;
+	margin-right:0in;
+	margin-bottom:10.0pt;
+	margin-left:0in;
+	line-height:115%;
+	mso-pagination:widow-orphan;
+	font-size:11.0pt;
+	font-family:"Calibri","sans-serif";
+	mso-ascii-font-family:Calibri;
+	mso-ascii-theme-font:minor-latin;
+	mso-fareast-font-family:Calibri;
+	mso-fareast-theme-font:minor-latin;
+	mso-hansi-font-family:Calibri;
+	mso-hansi-theme-font:minor-latin;
+	mso-bidi-font-family:"Times New Roman";
+	mso-bidi-theme-font:minor-bidi;}
+p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
+	{mso-style-noshow:yes;
+	mso-style-priority:99;
+	mso-style-link:"Balloon Text Char";
+	margin:0in;
+	margin-bottom:.0001pt;
+	mso-pagination:widow-orphan;
+	font-size:8.0pt;
+	font-family:"Tahoma","sans-serif";
+	mso-fareast-font-family:Calibri;
+	mso-fareast-theme-font:minor-latin;}
+p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
+	{mso-style-priority:34;
+	mso-style-unhide:no;
+	mso-style-qformat:yes;
+	margin-top:0in;
+	margin-right:0in;
+	margin-bottom:10.0pt;
+	margin-left:.5in;
+	mso-add-space:auto;
+	line-height:115%;
+	mso-pagination:widow-orphan;
+	font-size:11.0pt;
+	font-family:"Calibri","sans-serif";
+	mso-ascii-font-family:Calibri;
+	mso-ascii-theme-font:minor-latin;
+	mso-fareast-font-family:Calibri;
+	mso-fareast-theme-font:minor-latin;
+	mso-hansi-font-family:Calibri;
+	mso-hansi-theme-font:minor-latin;
+	mso-bidi-font-family:"Times New Roman";
+	mso-bidi-theme-font:minor-bidi;}
+p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst
+	{mso-style-priority:34;
+	mso-style-unhide:no;
+	mso-style-qformat:yes;
+	mso-style-type:export-only;
+	margin-top:0in;
+	margin-right:0in;
+	margin-bottom:0in;
+	margin-left:.5in;
+	margin-bottom:.0001pt;
+	mso-add-space:auto;
+	line-height:115%;
+	mso-pagination:widow-orphan;
+	font-size:11.0pt;
+	font-family:"Calibri","sans-serif";
+	mso-ascii-font-family:Calibri;
+	mso-ascii-theme-font:minor-latin;
+	mso-fareast-font-family:Calibri;
+	mso-fareast-theme-font:minor-latin;
+	mso-hansi-font-family:Calibri;
+	mso-hansi-theme-font:minor-latin;
+	mso-bidi-font-family:"Times New Roman";
+	mso-bidi-theme-font:minor-bidi;}
+p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle
+	{mso-style-priority:34;
+	mso-style-unhide:no;
+	mso-style-qformat:yes;
+	mso-style-type:export-only;
+	margin-top:0in;
+	margin-right:0in;
+	margin-bottom:0in;
+	margin-left:.5in;
+	margin-bottom:.0001pt;
+	mso-add-space:auto;
+	line-height:115%;
+	mso-pagination:widow-orphan;
+	font-size:11.0pt;
+	font-family:"Calibri","sans-serif";
+	mso-ascii-font-family:Calibri;
+	mso-ascii-theme-font:minor-latin;
+	mso-fareast-font-family:Calibri;
+	mso-fareast-theme-font:minor-latin;
+	mso-hansi-font-family:Calibri;
+	mso-hansi-theme-font:minor-latin;
+	mso-bidi-font-family:"Times New Roman";
+	mso-bidi-theme-font:minor-bidi;}
+p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast
+	{mso-style-priority:34;
+	mso-style-unhide:no;
+	mso-style-qformat:yes;
+	mso-style-type:export-only;
+	margin-top:0in;
+	margin-right:0in;
+	margin-bottom:10.0pt;
+	margin-left:.5in;
+	mso-add-space:auto;
+	line-height:115%;
+	mso-pagination:widow-orphan;
+	font-size:11.0pt;
+	font-family:"Calibri","sans-serif";
+	mso-ascii-font-family:Calibri;
+	mso-ascii-theme-font:minor-latin;
+	mso-fareast-font-family:Calibri;
+	mso-fareast-theme-font:minor-latin;
+	mso-hansi-font-family:Calibri;
+	mso-hansi-theme-font:minor-latin;
+	mso-bidi-font-family:"Times New Roman";
+	mso-bidi-theme-font:minor-bidi;}
+span.BalloonTextChar
+	{mso-style-name:"Balloon Text Char";
+	mso-style-noshow:yes;
+	mso-style-priority:99;
+	mso-style-unhide:no;
+	mso-style-locked:yes;
+	mso-style-link:"Balloon Text";
+	mso-ansi-font-size:8.0pt;
+	mso-bidi-font-size:8.0pt;
+	font-family:"Tahoma","sans-serif";
+	mso-ascii-font-family:Tahoma;
+	mso-hansi-font-family:Tahoma;
+	mso-bidi-font-family:Tahoma;}
+.MsoChpDefault
+	{mso-style-type:export-only;
+	mso-default-props:yes;
+	font-size:10.0pt;
+	mso-ansi-font-size:10.0pt;
+	mso-bidi-font-size:10.0pt;
+	mso-ascii-font-family:Calibri;
+	mso-ascii-theme-font:minor-latin;
+	mso-fareast-font-family:Calibri;
+	mso-fareast-theme-font:minor-latin;
+	mso-hansi-font-family:Calibri;
+	mso-hansi-theme-font:minor-latin;
+	mso-bidi-font-family:"Times New Roman";
+	mso-bidi-theme-font:minor-bidi;}
+@page WordSection1
+	{size:8.5in 11.0in;
+	margin:1.0in 1.0in 1.0in 1.0in;
+	mso-header-margin:.5in;
+	mso-footer-margin:.5in;
+	mso-paper-source:0;}
+div.WordSection1
+	{page:WordSection1;}
+ /* List Definitions */
+ @list l0
+	{mso-list-id:779757819;
+	mso-list-type:hybrid;
+	mso-list-template-ids:939584274 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
+@list l0:level1
+	{mso-level-text:"%1\)";
+	mso-level-tab-stop:none;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l0:level2
+	{mso-level-tab-stop:1.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l0:level3
+	{mso-level-tab-stop:1.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l0:level4
+	{mso-level-tab-stop:2.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l0:level5
+	{mso-level-tab-stop:2.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l0:level6
+	{mso-level-tab-stop:3.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l0:level7
+	{mso-level-tab-stop:3.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l0:level8
+	{mso-level-tab-stop:4.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l0:level9
+	{mso-level-tab-stop:4.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1
+	{mso-list-id:1813714603;
+	mso-list-type:hybrid;
+	mso-list-template-ids:939584274 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
+@list l1:level1
+	{mso-level-text:"%1\)";
+	mso-level-tab-stop:none;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level2
+	{mso-level-tab-stop:1.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level3
+	{mso-level-tab-stop:1.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level4
+	{mso-level-tab-stop:2.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level5
+	{mso-level-tab-stop:2.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level6
+	{mso-level-tab-stop:3.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level7
+	{mso-level-tab-stop:3.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level8
+	{mso-level-tab-stop:4.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level9
+	{mso-level-tab-stop:4.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+ol
+	{margin-bottom:0in;}
+ul
+	{margin-bottom:0in;}
+-->
+</style>
+<!--[if gte mso 10]>
+<style>
+ /* Style Definitions */
+ table.MsoNormalTable
+	{mso-style-name:"Table Normal";
+	mso-tstyle-rowband-size:0;
+	mso-tstyle-colband-size:0;
+	mso-style-noshow:yes;
+	mso-style-priority:99;
+	mso-style-qformat:yes;
+	mso-style-parent:"";
+	mso-padding-alt:0in 5.4pt 0in 5.4pt;
+	mso-para-margin:0in;
+	mso-para-margin-bottom:.0001pt;
+	mso-pagination:widow-orphan;
+	font-size:10.0pt;
+	font-family:"Calibri","sans-serif";
+	mso-ascii-font-family:Calibri;
+	mso-ascii-theme-font:minor-latin;
+	mso-hansi-font-family:Calibri;
+	mso-hansi-theme-font:minor-latin;}
+</style>
+<![endif]--><!--[if gte mso 9]><xml>
+ <o:shapedefaults v:ext="edit" spidmax="4098"/>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <o:shapelayout v:ext="edit">
+  <o:idmap v:ext="edit" data="1"/>
+ </o:shapelayout></xml><![endif]-->
+</head>
+
+<body lang=EN-US style='tab-interval:.5in'>
+
+<div class=WordSection1>
+
+<p class=MsoNormal style='margin-right:307.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif"'>This workflow contains examples of using the BNW structural constraint interface to help identify biologically meaningful genetic network models for two cases:<o:p></o:p></span></p>
+
+<p class=MsoListParagraphCxSpFirst style='margin-right:307.5pt;mso-add-space:
+auto;text-indent:-.25in;mso-list:l1 level1 lfo2'><![if !supportLists]><span
+style='font-size:12.0pt;line-height:115%;font-family:"Arial","sans-serif";
+mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>1)<span
+style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span
+style='font-size:12.0pt;line-height:115%;font-family:"Arial","sans-serif"'>A genetic network linking genotype and phenotype<o:p></o:p></span></p>
+
+<p class=MsoListParagraphCxSpMiddle style='margin-right:307.5pt;mso-add-space:
+auto;text-indent:-.25in;mso-list:l1 level1 lfo2'><![if !supportLists]><span
+style='font-size:12.0pt;line-height:115%;font-family:"Arial","sans-serif";
+mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>2)<span
+style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span
+style='font-size:12.0pt;line-height:115%;font-family:"Arial","sans-serif"'>A genetic network with multiple genotypes and cis- and trans-regulated genes<o:p></o:p></span></p>
+
+
+<p class=MsoNormal style='margin-top:0in;margin-right:307.5pt;margin-bottom:
+0in;margin-left:0in;margin-bottom:.0001pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif"'><o:p>&nbsp;</o:p></span></p>
+
+<p class=MsoNormal style='margin-right:307.5pt'><b style='mso-bidi-font-weight:
+normal'><span style='font-size:14.0pt;line-height:115%;font-family:"Arial","sans-serif"'>1.
+A genetic network linking genotype and phenotype<o:p></o:p></span></b></p>
+
+<p class=MsoNormal style='margin-top:0in;margin-right:307.5pt;margin-bottom:
+0in;margin-left:0in;margin-bottom:.0001pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif"'>In this example, we will use the structural constraint interface to create a genetic network linking a genotype with intermediated phenotypes (i.e., gene expression or other cellular level traits) and a higher-order phenotype. The figure below shows a screenshot of BNW after loading the data file and selecting <u>Go to structure learning settings and the BNW structural constraint interface</u>. There are 5 nodes in the network, Genotype, Int1, Int2, Int3, and a Phenotype.<br><br><o:p></o:p></span></p>
+<![if !vml]><img width=520 height=205
+src="BNW_workflow_test_files/image2_1.jpg" v:shapes="Picture_x0020_2"><![endif]></span><span
+style='font-size:12.0pt;line-height:115%;font-family:"Arial","sans-serif"'><o:p></o:p></span></p>
+<p class=MsoNormal style='margin-top:0in;margin-right:307.5pt;margin-bottom:
+0in;margin-left:0in;margin-bottom:.0001pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif"'><o:p>&nbsp;</o:p></span></p>
+
+<p class=MsoNormal style='margin-top:0in;margin-right:307.5pt;margin-bottom:
+0in;margin-left:0in;margin-bottom:.0001pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif"'> We want to assign the nodes to three tiers in this example, so we will keep the number of tiers at the default setting, and drag the nodes to the proper tiers.<br><br><o:p></o:p></span></p>
+<![if !vml]><img width=520 height=205
+src="BNW_workflow_test_files/image2_2.jpg" v:shapes="Picture_x0020_2"><![endif]></span><span
+style='font-size:12.0pt;line-height:115%;font-family:"Arial","sans-serif"'><o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-top:0in;margin-right:307.5pt;margin-bottom:
+0in;margin-left:0in;margin-bottom:.0001pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif"'>In this example, we do not want the genotype to be the direct parent of the phenotype, so we made some changes to the <u>Define interactions allowed between tiers</u> section of the structural constraint interface. Specifically, we have unchecked two boxes that are different from the default settings: (1) we have unchecked the box that allows the node(s) in Tier1 from being the parents of the node(s) in Tier3 and (2) we have unchecked the box that allows the node(s) in Tier3 from being the children of the node(s) in Tier1.  Actually, unchecking either of these boxes would have been sufficient in preventing direct interactions between Genotype and Phenotype, but, there is no harm in unchecking both boxes. There are no additional specific edges that we want to ban or require in the network, so we do not have to add any edges to the <u>Specify additional constraint</u> section and we can proceed with structure learning.<br><br><o:p></o:p></span></p>
+<![if !vml]><img width=650 height=200
+src="BNW_workflow_test_files/image2_3.jpg" v:shapes="Picture_x0020_2"><![endif]></span><span
+style='font-size:12.0pt;line-height:115%;font-family:"Arial","sans-serif"'><o:p></o:p></span></p>
+
+
+<p class=MsoNormal style='margin-right:307.5pt'><b style='mso-bidi-font-weight:
+normal'><span style='font-size:14.0pt;line-height:115%;font-family:"Arial","sans-serif"'>2.
+A genetic network with multiple genotypes and cis- and trans-regulated genes.<o:p></o:p></span></b></p>
+
+<p class=MsoNormal style='margin-top:0in;margin-right:307.5pt;margin-bottom:
+0in;margin-left:0in;margin-bottom:.0001pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'> In this example, we will add restrictions to a network containing 8 nodes: 2 genotype nodes (Geno1 and Geno2), 3 cis-regulated gene expression traits (cisGene1, cisGene2, and cisGene3), 2 trans-regulated gene expression traits (transGene1 and transGene2), and a phenotype (Pheno). We have four tiers of nodes (genotypes, cis-regulated genes, trans-regulated genes, and phenotype), so we have selected 4 from the dropdown menu at the top of the page and assigned the nodes to the correct tiers. We could make a more complex system of tiers that would allow us to specify which genes are regulated by which genotypes (for example, Geno1 regulates cisGene1 and transGene1, while Geno2 regulates cisGene2, cisGene3, and transGene2), but, for this example, we will use a simpler system of 4 tiers.<br><br><o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-right:307.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'>
+<![if !vml]><img width=537 height=258
+src="BNW_workflow_test_files/image2_4.jpg" v:shapes="Picture_x0020_14"><![endif]><o:p></o:p></span></p>
+
+
+<p class=MsoNormal style='margin-top:0in;margin-right:307.5pt;margin-bottom:
+0in;margin-left:0in;margin-bottom:.0001pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'> We have made one change to the default setting in the <u>Define interactions allowed between tiers</u> section. For Tier1, which contains the genotypes, we have selected "No" for the "Are within tier interactions allowed?", as it does not make biological sense for one genotype variation to cause the variation in another genotype in this examples.<br><br><o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-right:307.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'>
+<![if !vml]><img width=536 height=133
+src="BNW_workflow_test_files/image2_5.jpg" v:shapes="Picture_x0020_14"><![endif]><o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-top:0in;margin-right:307.5pt;margin-bottom:
+0in;margin-left:0in;margin-bottom:.0001pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'>Assume that a known regulatory relationship between cisGene1 and transGene1 has been established from previous experiments. We can require that this relationship is included in the network by adding the edge list of required edges in the <u>Specify additional constraints</u> section.<br><br><o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-right:307.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'>
+<![if !vml]><img width=750 height=300
+src="BNW_workflow_test_files/image2_6.jpg" v:shapes="Picture_x0020_17"><![endif]><o:p></o:p></span></p>
+</div>
+
+</body>
+
+</html>
diff --git a/sourcecodes/BNW_workflow_net1.htm b/sourcecodes/BNW_workflow_net1.htm
new file mode 100644
index 00000000..2b81a60e
--- /dev/null
+++ b/sourcecodes/BNW_workflow_net1.htm
@@ -0,0 +1,385 @@
+<html xmlns:v="urn:schemas-microsoft-com:vml"
+xmlns:o="urn:schemas-microsoft-com:office:office"
+xmlns:w="urn:schemas-microsoft-com:office:word"
+xmlns:m="http://schemas.microsoft.com/office/2004/12/omml"
+xmlns="http://www.w3.org/TR/REC-html40">
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<meta name=ProgId content=Word.Document>
+<meta name=Generator content="Microsoft Word 12">
+<meta name=Originator content="Microsoft Word 12">
+<link rel=File-List href="BNW_workflow_test_files/filelist.xml">
+<link rel=Edit-Time-Data href="BNW_workflow_test_files/editdata.mso">
+<link rel=themeData href="BNW_workflow_test_files/themedata.thmx">
+<link rel=colorSchemeMapping
+href="BNW_workflow_test_files/colorschememapping.xml">
+<style>
+<!--
+ /* Font Definitions */
+ @font-face
+	{font-family:"Cambria Math";
+	panose-1:2 4 5 3 5 4 6 3 2 4;
+	mso-font-charset:1;
+	mso-generic-font-family:roman;
+	mso-font-format:other;
+	mso-font-pitch:variable;
+	mso-font-signature:0 0 0 0 0 0;}
+@font-face
+	{font-family:Calibri;
+	panose-1:2 15 5 2 2 2 4 3 2 4;
+	mso-font-charset:0;
+	mso-generic-font-family:swiss;
+	mso-font-pitch:variable;
+	mso-font-signature:-1610611985 1073750139 0 0 159 0;}
+@font-face
+	{font-family:Tahoma;
+	panose-1:2 11 6 4 3 5 4 4 2 4;
+	mso-font-charset:0;
+	mso-generic-font-family:swiss;
+	mso-font-pitch:variable;
+	mso-font-signature:-520081665 -1073717157 41 0 66047 0;}
+ /* Style Definitions */
+ p.MsoNormal, li.MsoNormal, div.MsoNormal
+	{mso-style-unhide:no;
+	mso-style-qformat:yes;
+	mso-style-parent:"";
+	margin-top:0in;
+	margin-right:0in;
+	margin-bottom:10.0pt;
+	margin-left:0in;
+	line-height:115%;
+	mso-pagination:widow-orphan;
+	font-size:11.0pt;
+	font-family:"Calibri","sans-serif";
+	mso-ascii-font-family:Calibri;
+	mso-ascii-theme-font:minor-latin;
+	mso-fareast-font-family:Calibri;
+	mso-fareast-theme-font:minor-latin;
+	mso-hansi-font-family:Calibri;
+	mso-hansi-theme-font:minor-latin;
+	mso-bidi-font-family:"Times New Roman";
+	mso-bidi-theme-font:minor-bidi;}
+p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
+	{mso-style-noshow:yes;
+	mso-style-priority:99;
+	mso-style-link:"Balloon Text Char";
+	margin:0in;
+	margin-bottom:.0001pt;
+	mso-pagination:widow-orphan;
+	font-size:8.0pt;
+	font-family:"Tahoma","sans-serif";
+	mso-fareast-font-family:Calibri;
+	mso-fareast-theme-font:minor-latin;}
+p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
+	{mso-style-priority:34;
+	mso-style-unhide:no;
+	mso-style-qformat:yes;
+	margin-top:0in;
+	margin-right:0in;
+	margin-bottom:10.0pt;
+	margin-left:.5in;
+	mso-add-space:auto;
+	line-height:115%;
+	mso-pagination:widow-orphan;
+	font-size:11.0pt;
+	font-family:"Calibri","sans-serif";
+	mso-ascii-font-family:Calibri;
+	mso-ascii-theme-font:minor-latin;
+	mso-fareast-font-family:Calibri;
+	mso-fareast-theme-font:minor-latin;
+	mso-hansi-font-family:Calibri;
+	mso-hansi-theme-font:minor-latin;
+	mso-bidi-font-family:"Times New Roman";
+	mso-bidi-theme-font:minor-bidi;}
+p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst
+	{mso-style-priority:34;
+	mso-style-unhide:no;
+	mso-style-qformat:yes;
+	mso-style-type:export-only;
+	margin-top:0in;
+	margin-right:0in;
+	margin-bottom:0in;
+	margin-left:.5in;
+	margin-bottom:.0001pt;
+	mso-add-space:auto;
+	line-height:115%;
+	mso-pagination:widow-orphan;
+	font-size:11.0pt;
+	font-family:"Calibri","sans-serif";
+	mso-ascii-font-family:Calibri;
+	mso-ascii-theme-font:minor-latin;
+	mso-fareast-font-family:Calibri;
+	mso-fareast-theme-font:minor-latin;
+	mso-hansi-font-family:Calibri;
+	mso-hansi-theme-font:minor-latin;
+	mso-bidi-font-family:"Times New Roman";
+	mso-bidi-theme-font:minor-bidi;}
+p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle
+	{mso-style-priority:34;
+	mso-style-unhide:no;
+	mso-style-qformat:yes;
+	mso-style-type:export-only;
+	margin-top:0in;
+	margin-right:0in;
+	margin-bottom:0in;
+	margin-left:.5in;
+	margin-bottom:.0001pt;
+	mso-add-space:auto;
+	line-height:115%;
+	mso-pagination:widow-orphan;
+	font-size:11.0pt;
+	font-family:"Calibri","sans-serif";
+	mso-ascii-font-family:Calibri;
+	mso-ascii-theme-font:minor-latin;
+	mso-fareast-font-family:Calibri;
+	mso-fareast-theme-font:minor-latin;
+	mso-hansi-font-family:Calibri;
+	mso-hansi-theme-font:minor-latin;
+	mso-bidi-font-family:"Times New Roman";
+	mso-bidi-theme-font:minor-bidi;}
+p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast
+	{mso-style-priority:34;
+	mso-style-unhide:no;
+	mso-style-qformat:yes;
+	mso-style-type:export-only;
+	margin-top:0in;
+	margin-right:0in;
+	margin-bottom:10.0pt;
+	margin-left:.5in;
+	mso-add-space:auto;
+	line-height:115%;
+	mso-pagination:widow-orphan;
+	font-size:11.0pt;
+	font-family:"Calibri","sans-serif";
+	mso-ascii-font-family:Calibri;
+	mso-ascii-theme-font:minor-latin;
+	mso-fareast-font-family:Calibri;
+	mso-fareast-theme-font:minor-latin;
+	mso-hansi-font-family:Calibri;
+	mso-hansi-theme-font:minor-latin;
+	mso-bidi-font-family:"Times New Roman";
+	mso-bidi-theme-font:minor-bidi;}
+span.BalloonTextChar
+	{mso-style-name:"Balloon Text Char";
+	mso-style-noshow:yes;
+	mso-style-priority:99;
+	mso-style-unhide:no;
+	mso-style-locked:yes;
+	mso-style-link:"Balloon Text";
+	mso-ansi-font-size:8.0pt;
+	mso-bidi-font-size:8.0pt;
+	font-family:"Tahoma","sans-serif";
+	mso-ascii-font-family:Tahoma;
+	mso-hansi-font-family:Tahoma;
+	mso-bidi-font-family:Tahoma;}
+.MsoChpDefault
+	{mso-style-type:export-only;
+	mso-default-props:yes;
+	font-size:10.0pt;
+	mso-ansi-font-size:10.0pt;
+	mso-bidi-font-size:10.0pt;
+	mso-ascii-font-family:Calibri;
+	mso-ascii-theme-font:minor-latin;
+	mso-fareast-font-family:Calibri;
+	mso-fareast-theme-font:minor-latin;
+	mso-hansi-font-family:Calibri;
+	mso-hansi-theme-font:minor-latin;
+	mso-bidi-font-family:"Times New Roman";
+	mso-bidi-theme-font:minor-bidi;}
+@page WordSection1
+	{size:8.5in 11.0in;
+	margin:1.0in 1.0in 1.0in 1.0in;
+	mso-header-margin:.5in;
+	mso-footer-margin:.5in;
+	mso-paper-source:0;}
+div.WordSection1
+	{page:WordSection1;}
+ /* List Definitions */
+ @list l0
+	{mso-list-id:779757819;
+	mso-list-type:hybrid;
+	mso-list-template-ids:939584274 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
+@list l0:level1
+	{mso-level-text:"%1\)";
+	mso-level-tab-stop:none;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l0:level2
+	{mso-level-tab-stop:1.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l0:level3
+	{mso-level-tab-stop:1.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l0:level4
+	{mso-level-tab-stop:2.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l0:level5
+	{mso-level-tab-stop:2.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l0:level6
+	{mso-level-tab-stop:3.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l0:level7
+	{mso-level-tab-stop:3.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l0:level8
+	{mso-level-tab-stop:4.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l0:level9
+	{mso-level-tab-stop:4.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1
+	{mso-list-id:1813714603;
+	mso-list-type:hybrid;
+	mso-list-template-ids:939584274 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
+@list l1:level1
+	{mso-level-text:"%1\)";
+	mso-level-tab-stop:none;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level2
+	{mso-level-tab-stop:1.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level3
+	{mso-level-tab-stop:1.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level4
+	{mso-level-tab-stop:2.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level5
+	{mso-level-tab-stop:2.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level6
+	{mso-level-tab-stop:3.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level7
+	{mso-level-tab-stop:3.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level8
+	{mso-level-tab-stop:4.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level9
+	{mso-level-tab-stop:4.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+ol
+	{margin-bottom:0in;}
+ul
+	{margin-bottom:0in;}
+-->
+</style>
+</head>
+
+<body lang=EN-US style='tab-interval:.5in'>
+
+<div class=WordSection1>
+
+<p class=MsoNormal style='margin-right:107.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif"'>This tutorial provides
+an overview of using BNW to build a Bayesian network model from a dataset and use the network to make predictions. The dataset used in this tutorial is a synthetic example of a genetic dataset that has a total of 8 variables. Two of the variables are genotypes labeled Geno1 and Geno2, and the remaining 6 variables are gene expression levels or other quantitative traits that are labeled Trait1 to Trait6. The dataset is available <a href="example_datasets/example_data_8nodes.txt">here</a>.<br><br>The data file is formatted according to the guidelines on the <a href=http://compbio.uthsc.edu/BNW_1.01/sourcecodes/help.php#file_format>BNW help page</a>. The first row of the file contains the names of the variables and the remaining rows contain the data for each sample of the dataset. The genotypes (Geno1 and Geno2), which are the only discrete variables in the network, are the leftmost variables in the input file and are integer values (1 and 2) for all of the samples. The quantitative traits are continuous variables, and, therefore, all contain a "." in at least one of the samples.<o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-right:107.5pt'><b style='mso-bidi-font-weight:
+normal'><span style='font-size:14.0pt;line-height:115%;font-family:"Arial","sans-serif"'>1. Structure learning using default options<o:p></o:p></span></b></p>
+
+<p class=MsoNormal style='margin-top:0in;margin-right:107.5pt;margin-bottom:
+0in;margin-left:0in;margin-bottom:.0001pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif"'>We do not know the network structure of this datasets, so we will use BNW to learn the structure that best explains the data. To begin, select <u>Learn a network model from data</u> from the BNW home page. Next, click <u>Choose File</u> at the top of the file upload page, navigate to and select the data file, and click <u>Upload</u>. The contents of the uploaded file should now be visible as shown below.<br><br><o:p></o:p></span></p>
+<p class=MsoNormal style='margin-right:107.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'><![if !vml]><img width=621 height=218
+src="BNW_workflow_test_files/8node_file_upload.jpg" v:shapes="Picture_x0020_2"><![endif]></span><span
+style='font-size:12.0pt;line-height:115%;font-family:"Arial","sans-serif"'><o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-top:0in;margin-right:107.5pt;margin-bottom:
+0in;margin-left:0in;margin-bottom:.0001pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif"'>Initially, we will perform structure learning using default options in BNW. By default, BNW limits the maximum number of parents for any node in the network to 4 and presents the structure of the single highest scoring network. To perform structure learning using the default settings and view the network structure, click <u>Perform Bayesian network modeling using default settings</u>. The structure below should be displayed and the network is available <a href="example.php?My_key=example1|Bqx" target="_blank">here</a>.<br><br>
+<p class=MsoNormal style='margin-right:107.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'>
+<img width=548 height=479
+src="BNW_workflow_test_files/8node_best_structure.jpg" v:shapes="Picture_x0020_5"><o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-top:0in;margin-right:107.5pt;margin-bottom:
+0in;margin-left:0in;margin-bottom:.0001pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'><br>In the single best scoring network structure, the genotype nodes, Geno1 and Geno2, directly influence Trait2 and Traits3, 4, and 6, respectively. There are also several direct interactions between traits; for example, Trait2 influences Trait1 and Trait4. Additionally, Trait5 is absent from the network, indicating that this variable did not interact with the other variables strongly enough to be located within the highest scoring network.<o:p></o:p></span></p><br>
+
+<p class=MsoNormal style='margin-right:107.5pt'><b style='mso-bidi-font-weight:
+normal'><span style='font-size:14.0pt;line-height:115%;font-family:"Arial","sans-serif"'>2. Modifying structure learning settings<o:p></o:p></span></b></p>
+
+<p class=MsoNormal style='margin-top:0in;margin-right:107.5pt;margin-bottom:
+0in;margin-left:0in;margin-bottom:.0001pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'>In order to test if edges present the single best scoring network are conserved across high scoring networks. We can modify the structure learning settings to get identify the structures of many high scoring networks and perform <a href=http://compbio.uthsc.edu/BNW_1.01/sourcecodes/help.php#learn_details>model averaging</a> over these structures. To do this, return to the BNW home page, select <u>Learn a network model from data</u>, and upload the datafile. Instead of using the default settings, select <u>Go to structure learning settings and the BNW structural constraint interface</u>. A more detailed overview of use of the structural constraint interface is provided in <a href=http://compbio.uthsc.edu/BNW_1.01/sourcecodes/BNW_workflow_2.htm>another tutorial</a>, but, here, we will investigate the impact of modifying some of the structure learning settings shown below:<br><o:p></o:p></span></p><br>
+
+<p class=MsoNormal style='margin-right:107.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'>
+<![if !vml]><img width=628 height=181
+src="BNW_workflow_test_files/8node_global_settings.jpg" v:shapes="Picture_x0020_8"><![endif]><o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-top:0in;margin-right:107.5pt;margin-bottom:
+0in;margin-left:0in;margin-bottom:.0001pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'><br>Change the <u>Number of networks to include in model averaging</u> to 100 and select <u>Perform Bayesian network modeling</u>. Now, instead of displaying the single highest scoring network, BNW will determine the 100 highest scoring networks, perform model averaing over these networks, and display the structure after model averaging that includes all features with a <u>Model averaging edge selection threshold</u> greater than 0.5. Model averaging over the 100 highest scoring structures has resulted in a change in the network structure as shown below and available <a href="example.php?My_key=example2|hQG" target="blank_">here</a>.<br><o:p></o:p></span></p><br>
+
+<p class=MsoNormal style='margin-right:107.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'>
+<![if !vml]><img width=558 height=475
+src="BNW_workflow_test_files/8node_model_avg_struct.jpg" v:shapes="Picture_x0020_8"><![endif]><o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-top:0in;margin-right:107.5pt;margin-bottom:
+0in;margin-left:0in;margin-bottom:.0001pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'><br>Specifically, the single best model network contains a directed edge linking Trait6 with Trait3, while this edge is absent from the structure after model averaging over the 100 best scoring networks. Clicking <u>Display structure matrix</u> displays the model averaging scores as well as the structure matrix. The structure matrix file can be downloaded and used in return sessions to BNW, allowing users to skip structure learning and more quickly use the model to make predictions.<br><o:p></o:p></span></p><br>
+
+<p class=MsoNormal style='margin-right:107.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'>
+<![if !vml]><img width=899 height=563
+src="BNW_workflow_test_files/8node_matrix.jpg" v:shapes="Picture_x0020_8"><![endif]><o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-top:0in;margin-right:107.5pt;margin-bottom:
+0in;margin-left:0in;margin-bottom:.0001pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'><br>In the model averaging scores, we can observe that most of the network edges in the model average network were found in all or nearly all of the 100 highest scoring networks. For example, edges from Geno2 to Traits 3 and 4 have posterior probabilities of 1. Also, the edge from Trait6 to Trait3 that was observed in the single highest scoring network has a posterior probability of 0.46, and it, therefore, falls just short of being included in the model averaged network structure.<br><o:p></o:p></span></p><br>
+
+<p class=MsoNormal style='margin-right:107.5pt'><b style='mso-bidi-font-weight:
+normal'><span style='font-size:14.0pt;line-height:115%;font-family:"Arial","sans-serif"'>3. Using the network structure to make predictions<o:p></o:p></span></b></p>
+
+<p class=MsoNormal style='margin-top:0in;margin-right:107.5pt;margin-bottom:
+0in;margin-left:0in;margin-bottom:.0001pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'><br>To make predictions with the network, we will use the structure learned after model averaging of the top 100 highest scoring networks. First, we will use the model to compare the expected values for nodes in the network based on observed genotypes. For these predictions, we will keep the prediction in evidence mode. The difference between evidence and intervention modes is discussed in the <a href=http://compbio.uthsc.edu/BNW_1.01/sourcecodes/faq.php#evid_inter>BNW FAQ page</a>. To use the model to make predictions based on Geno1, click on one of the blue bars in the Geno1 node and enter 1 or 2 to indicate which genotype value should be used to predict the values of the other network nodes. In the figure below, Geno1 is outlined in red and state 2 has a 100% probability, indicating that the value of this node has been entered as evidence. The red lines in the figure show the predicted distributions of the nodes after this evidence is known and can be compared with the blue lines which show the distributions for variables using the original data.<o:p></o:p></span></p><br>
+
+<p class=MsoNormal style='margin-right:107.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'>
+<![if !vml]><img width=558 height=475
+src="BNW_workflow_test_files/8node_geno1_2.jpg" v:shapes="Picture_x0020_8"><![endif]><o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-top:0in;margin-right:107.5pt;margin-bottom:
+0in;margin-left:0in;margin-bottom:.0001pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'><br>If Geno1 has genotype 2, the value of Traits 1, 2, and 4 are expected to increase compared with the distribution for all data. Specifically, the mean value of Trait2 is expected to be near 1 for Geno1=2 data, while it is close to 0 when this evidence is not known. Traits 1 and 4 are also expected to increase, but the magnitude of this increase is not expected to be as large. Predicted distributions for the other nodes in the network, which are not descendants of Geno1, are expected to be close to the same as their original distributions, and, the red line covers the blue line for some nodes.  Evidence for multiple nodes can be considered at the same time by clicking on a new node in the network and entering a value. Alternatively, users can select <u>Clear evidence</u> to reset the network to show the orignial distributions in a new tab.<br><br>
+Next, we will make predictions using the intervention mode. To use the prediction mode, click the button next to <u>Intervention</u> at the top of the page. The <u>Selected mode</u> tab on the left of the screan should now display Intervention. The effects of experimental intervention on Trait2 can be predicted by clicking on the blue line in the Trait2 node and entering a value for the variable. The figure below shows the network after setting Trait2 to a value of 1.5.<o:p></o:p></span></p><br>
+
+<p class=MsoNormal style='margin-right:107.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'>
+<![if !vml]><img width=558 height=475
+src="BNW_workflow_test_files/8node_trait2_15.jpg" v:shapes="Picture_x0020_8"><![endif]><o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-top:0in;margin-right:107.5pt;margin-bottom:
+0in;margin-left:0in;margin-bottom:.0001pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'><br>Entering a value for Trait2 in intervention mode results in a change in the structure of the network. Specifically, as Trait2 is now set by the experimental intervention, it is no longer dependent on its parents. In this case, as Geno1 was only connected to the network by being the parent of Trait2, Geno1 no longer appears in the network. Also, intervention mode only predicts how nodes that are descendants of Trait2 are affected. Setting Trait2 to 1.5 results in increases in the predicted values of both Trait1 and Trait4.<o:p></o:p></span></p><br>
+
+
+</div>
+
+</body>
+
+</html>
diff --git a/sourcecodes/BNW_workflow_sci.htm b/sourcecodes/BNW_workflow_sci.htm
new file mode 100644
index 00000000..73451b4c
--- /dev/null
+++ b/sourcecodes/BNW_workflow_sci.htm
@@ -0,0 +1,389 @@
+<html xmlns:v="urn:schemas-microsoft-com:vml"
+xmlns:o="urn:schemas-microsoft-com:office:office"
+xmlns:w="urn:schemas-microsoft-com:office:word"
+xmlns:m="http://schemas.microsoft.com/office/2004/12/omml"
+xmlns="http://www.w3.org/TR/REC-html40">
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<meta name=ProgId content=Word.Document>
+<meta name=Generator content="Microsoft Word 12">
+<meta name=Originator content="Microsoft Word 12">
+<link rel=File-List href="BNW_workflow_test_files/filelist.xml">
+<link rel=Edit-Time-Data href="BNW_workflow_test_files/editdata.mso">
+<style>
+<!--
+ /* Font Definitions */
+ @font-face
+	{font-family:"Cambria Math";
+	panose-1:2 4 5 3 5 4 6 3 2 4;
+	mso-font-charset:1;
+	mso-generic-font-family:roman;
+	mso-font-format:other;
+	mso-font-pitch:variable;
+	mso-font-signature:0 0 0 0 0 0;}
+@font-face
+	{font-family:Calibri;
+	panose-1:2 15 5 2 2 2 4 3 2 4;
+	mso-font-charset:0;
+	mso-generic-font-family:swiss;
+	mso-font-pitch:variable;
+	mso-font-signature:-1610611985 1073750139 0 0 159 0;}
+@font-face
+	{font-family:Tahoma;
+	panose-1:2 11 6 4 3 5 4 4 2 4;
+	mso-font-charset:0;
+	mso-generic-font-family:swiss;
+	mso-font-pitch:variable;
+	mso-font-signature:-520081665 -1073717157 41 0 66047 0;}
+ /* Style Definitions */
+ p.MsoNormal, li.MsoNormal, div.MsoNormal
+	{mso-style-unhide:no;
+	mso-style-qformat:yes;
+	mso-style-parent:"";
+	margin-top:0in;
+	margin-right:0in;
+	margin-bottom:10.0pt;
+	margin-left:0in;
+	line-height:115%;
+	mso-pagination:widow-orphan;
+	font-size:11.0pt;
+	font-family:"Calibri","sans-serif";
+	mso-ascii-font-family:Calibri;
+	mso-ascii-theme-font:minor-latin;
+	mso-fareast-font-family:Calibri;
+	mso-fareast-theme-font:minor-latin;
+	mso-hansi-font-family:Calibri;
+	mso-hansi-theme-font:minor-latin;
+	mso-bidi-font-family:"Times New Roman";
+	mso-bidi-theme-font:minor-bidi;}
+p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
+	{mso-style-noshow:yes;
+	mso-style-priority:99;
+	mso-style-link:"Balloon Text Char";
+	margin:0in;
+	margin-bottom:.0001pt;
+	mso-pagination:widow-orphan;
+	font-size:8.0pt;
+	font-family:"Tahoma","sans-serif";
+	mso-fareast-font-family:Calibri;
+	mso-fareast-theme-font:minor-latin;}
+p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
+	{mso-style-priority:34;
+	mso-style-unhide:no;
+	mso-style-qformat:yes;
+	margin-top:0in;
+	margin-right:0in;
+	margin-bottom:10.0pt;
+	margin-left:.5in;
+	mso-add-space:auto;
+	line-height:115%;
+	mso-pagination:widow-orphan;
+	font-size:11.0pt;
+	font-family:"Calibri","sans-serif";
+	mso-ascii-font-family:Calibri;
+	mso-ascii-theme-font:minor-latin;
+	mso-fareast-font-family:Calibri;
+	mso-fareast-theme-font:minor-latin;
+	mso-hansi-font-family:Calibri;
+	mso-hansi-theme-font:minor-latin;
+	mso-bidi-font-family:"Times New Roman";
+	mso-bidi-theme-font:minor-bidi;}
+p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst
+	{mso-style-priority:34;
+	mso-style-unhide:no;
+	mso-style-qformat:yes;
+	mso-style-type:export-only;
+	margin-top:0in;
+	margin-right:0in;
+	margin-bottom:0in;
+	margin-left:.5in;
+	margin-bottom:.0001pt;
+	mso-add-space:auto;
+	line-height:115%;
+	mso-pagination:widow-orphan;
+	font-size:11.0pt;
+	font-family:"Calibri","sans-serif";
+	mso-ascii-font-family:Calibri;
+	mso-ascii-theme-font:minor-latin;
+	mso-fareast-font-family:Calibri;
+	mso-fareast-theme-font:minor-latin;
+	mso-hansi-font-family:Calibri;
+	mso-hansi-theme-font:minor-latin;
+	mso-bidi-font-family:"Times New Roman";
+	mso-bidi-theme-font:minor-bidi;}
+p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle
+	{mso-style-priority:34;
+	mso-style-unhide:no;
+	mso-style-qformat:yes;
+	mso-style-type:export-only;
+	margin-top:0in;
+	margin-right:0in;
+	margin-bottom:0in;
+	margin-left:.5in;
+	margin-bottom:.0001pt;
+	mso-add-space:auto;
+	line-height:115%;
+	mso-pagination:widow-orphan;
+	font-size:11.0pt;
+	font-family:"Calibri","sans-serif";
+	mso-ascii-font-family:Calibri;
+	mso-ascii-theme-font:minor-latin;
+	mso-fareast-font-family:Calibri;
+	mso-fareast-theme-font:minor-latin;
+	mso-hansi-font-family:Calibri;
+	mso-hansi-theme-font:minor-latin;
+	mso-bidi-font-family:"Times New Roman";
+	mso-bidi-theme-font:minor-bidi;}
+p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast
+	{mso-style-priority:34;
+	mso-style-unhide:no;
+	mso-style-qformat:yes;
+	mso-style-type:export-only;
+	margin-top:0in;
+	margin-right:0in;
+	margin-bottom:10.0pt;
+	margin-left:.5in;
+	mso-add-space:auto;
+	line-height:115%;
+	mso-pagination:widow-orphan;
+	font-size:11.0pt;
+	font-family:"Calibri","sans-serif";
+	mso-ascii-font-family:Calibri;
+	mso-ascii-theme-font:minor-latin;
+	mso-fareast-font-family:Calibri;
+	mso-fareast-theme-font:minor-latin;
+	mso-hansi-font-family:Calibri;
+	mso-hansi-theme-font:minor-latin;
+	mso-bidi-font-family:"Times New Roman";
+	mso-bidi-theme-font:minor-bidi;}
+span.BalloonTextChar
+	{mso-style-name:"Balloon Text Char";
+	mso-style-noshow:yes;
+	mso-style-priority:99;
+	mso-style-unhide:no;
+	mso-style-locked:yes;
+	mso-style-link:"Balloon Text";
+	mso-ansi-font-size:8.0pt;
+	mso-bidi-font-size:8.0pt;
+	font-family:"Tahoma","sans-serif";
+	mso-ascii-font-family:Tahoma;
+	mso-hansi-font-family:Tahoma;
+	mso-bidi-font-family:Tahoma;}
+.MsoChpDefault
+	{mso-style-type:export-only;
+	mso-default-props:yes;
+	font-size:10.0pt;
+	mso-ansi-font-size:10.0pt;
+	mso-bidi-font-size:10.0pt;
+	mso-ascii-font-family:Calibri;
+	mso-ascii-theme-font:minor-latin;
+	mso-fareast-font-family:Calibri;
+	mso-fareast-theme-font:minor-latin;
+	mso-hansi-font-family:Calibri;
+	mso-hansi-theme-font:minor-latin;
+	mso-bidi-font-family:"Times New Roman";
+	mso-bidi-theme-font:minor-bidi;}
+@page WordSection1
+	{size:8.5in 11.0in;
+	margin:1.0in 1.0in 1.0in 1.0in;
+	mso-header-margin:.5in;
+	mso-footer-margin:.5in;
+	mso-paper-source:0;}
+div.WordSection1
+	{page:WordSection1;}
+ /* List Definitions */
+ @list l0
+	{mso-list-id:779757819;
+	mso-list-type:hybrid;
+	mso-list-template-ids:939584274 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
+@list l0:level1
+	{mso-level-text:"%1\)";
+	mso-level-tab-stop:none;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l0:level2
+	{mso-level-tab-stop:1.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l0:level3
+	{mso-level-tab-stop:1.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l0:level4
+	{mso-level-tab-stop:2.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l0:level5
+	{mso-level-tab-stop:2.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l0:level6
+	{mso-level-tab-stop:3.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l0:level7
+	{mso-level-tab-stop:3.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l0:level8
+	{mso-level-tab-stop:4.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l0:level9
+	{mso-level-tab-stop:4.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1
+	{mso-list-id:1813714603;
+	mso-list-type:hybrid;
+	mso-list-template-ids:939584274 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
+@list l1:level1
+	{mso-level-text:"%1\)";
+	mso-level-tab-stop:none;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level2
+	{mso-level-tab-stop:1.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level3
+	{mso-level-tab-stop:1.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level4
+	{mso-level-tab-stop:2.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level5
+	{mso-level-tab-stop:2.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level6
+	{mso-level-tab-stop:3.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level7
+	{mso-level-tab-stop:3.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level8
+	{mso-level-tab-stop:4.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level9
+	{mso-level-tab-stop:4.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+ol
+	{margin-bottom:0in;}
+ul
+	{margin-bottom:0in;}
+-->
+</style>
+<!--[if gte mso 10]>
+<style>
+ /* Style Definitions */
+ table.MsoNormalTable
+	{mso-style-name:"Table Normal";
+	mso-tstyle-rowband-size:0;
+	mso-tstyle-colband-size:0;
+	mso-style-noshow:yes;
+	mso-style-priority:99;
+	mso-style-qformat:yes;
+	mso-style-parent:"";
+	mso-padding-alt:0in 5.4pt 0in 5.4pt;
+	mso-para-margin:0in;
+	mso-para-margin-bottom:.0001pt;
+	mso-pagination:widow-orphan;
+	font-size:10.0pt;
+	font-family:"Calibri","sans-serif";
+	mso-ascii-font-family:Calibri;
+	mso-ascii-theme-font:minor-latin;
+	mso-hansi-font-family:Calibri;
+	mso-hansi-theme-font:minor-latin;}
+</style>
+<![endif]--><!--[if gte mso 9]><xml>
+ <o:shapedefaults v:ext="edit" spidmax="4098"/>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <o:shapelayout v:ext="edit">
+  <o:idmap v:ext="edit" data="1"/>
+ </o:shapelayout></xml><![endif]-->
+</head>
+
+<body lang=EN-US style='tab-interval:.5in'>
+
+<div class=WordSection1>
+
+<p class=MsoNormal style='margin-right:307.5pt'><b style='mso-bidi-font-weight:
+normal'><span style='font-size:14.0pt;line-height:115%;font-family:"Arial","sans-serif"'>1.
+A genetic network linking genotype and phenotype<o:p></o:p></span></b></p>
+
+<p class=MsoNormal style='margin-top:0in;margin-right:307.5pt;margin-bottom:
+0in;margin-left:0in;margin-bottom:.0001pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif"'>In this example, we will use the structural constraint interface to create a genetic network linking a genotype with gene expression traits and a higher-order phenotype. There are 5 nodes in the network: Genotype, Gene1, Gene2, Gene3, and Phenotype. The input datafile is available <a href="example_datasets/sci_5node_input_data2.txt">here</a>. To begin, select <u>Learn a network model from data</u> on the BNW homepage and load the data file, displaying what is shown below:<br><br><o:p></o:p></span></p>
+
+
+<img width=515 height=180 src="BNW_workflow_test_files/sci_5node_upload.jpg" v:shapes="Picture_x0020_2"></img>
+
+<p class=MsoNormal style='margin-top:0in;margin-right:307.5pt;margin-bottom:
+0in;margin-left:0in;margin-bottom:.0001pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif"'><br>We now have the option of either learning performing structure learning using the default BNW settings and no additional structural constraints or we can use modify settings and add structural constraints. Here, we will select <u>Go to structure learning settings and the BNW structural constraint interface</u> to select the latter option. The BNW structural constraint interface is described in our <a href="help.php#constraint_interface">Help page</a>. At shown in the figure below, the top of the page has several settings for global features of the structure search. We have kept the default settings, except we have changed the <u>Number of networks to include in model averaging</u> to 1000. As this is a small network with only 5 nodes, including many high scoring networks had little effect on the estimated time required to perform structure learning, and the estimated run time increased from 12 to 13 seconds. We also could increase the <u>Maximum number of parents for any node</u> to any value without significantly changing the run time for a network of this size. For larger networks with more than approximately 10 nodes, changing these settings can have a major impact on estimated run times.<br><br><o:p></o:p></span></p>
+
+<img width=596 height=217 src="BNW_workflow_test_files/sci_5node_part1.jpg" v:shapes="Picture_x0020_2"></img>
+
+<p class=MsoNormal style='margin-top:0in;margin-right:307.5pt;margin-bottom:
+0in;margin-left:0in;margin-bottom:.0001pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif"'><br>In the next section of the structural constraint interface, we assign nodes to tiers which will can be used to focus network searches on biologically meaningful networks. Our dataset contains a genotype, three gene expression traits, and a higher order phenotype. Instead of considering all possible network models for this dataset, we may want to focus on models relevant to a questions such as: How does variation in genotype and gene expression explain the variation observed in the phenotype? To address this question, we assign the network nodes to three tiers: Tier1 contains the genotype, Tier2 contains the gene expression traits, and Tier3 contains the phenotype.<br><br><o:p></o:p></span></p>
+
+<img width=633 height=214 src="BNW_workflow_test_files/sci_5node_part2.jpg" v:shapes="Picture_x0020_2"></img>
+
+<p class=MsoNormal style='margin-top:0in;margin-right:307.5pt;margin-bottom:
+0in;margin-left:0in;margin-bottom:.0001pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif"'><br>The third section of the BNW structural constraint interface allows users to specify the interactions that are allowed within and between tiers. By default, within tier interactions (i.e., nodes in TierX can be parents or children of other nodes in TierX) are allowed, but users may want to prevent within tier interactions for some cases. For example, it may be advantageous to prevent interactions between a tier that contained a set of some demographic variables (e.g., age, sex, and race), as these variables are not likely to be causal factor that influence other factors in the tier. In this case, within tier interactions only apply to Tier2, and we do not have any prior knowledge that indicates that between gene interactions should not be allowed, so we will keep the default setting and allow within tier interactions.<br><br> The default settings for between tier interactions allow nodes within a tier to be the parents of all nodes in lower ranking tiers. Here, the Genotype node in Tier1 can be parents of the gene nodes in Tier2 and the Phenotype node in Tier3, the gene nodes in Tier2 can be the parents of the Tier3 Phenotype node, and the Tier3 Phenotype node cannot be the parents of nodes in any other tier. Therefore, by default, the Genotype node can be the direct parent of the Phenotype node. We may want to allow this interaction, as the genotype may influence genotype through genes or other factors that are not explicitly included as variables in the network. If users do not want to allow this direct Genotype-Phenotype interaction, they can unclick the Tier3 box in the <u>Which tiers contain nodes that can be the children of this tier?</u> for Tier1. In this case, we have maintained the default settings which are shown below.<br><br><o:p></o:p></span></p>
+
+<img width=600 height=175 src="BNW_workflow_test_files/sci_5node_part3.jpg" v:shapes="Picture_x0020_2"></img>
+
+<p class=MsoNormal style='margin-top:0in;margin-right:307.5pt;margin-bottom:
+0in;margin-left:0in;margin-bottom:.0001pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif"'><br>In this example, we will not specify any additional constraints in the fourth section of the structural constraint interface, and we can click <u>Perform Bayesian network modeling</u> on the upper left corner of the page. The figure below shows the network with the model average network of the 1000 highest scoring networks and this network is available <a href="example.php?My_key=example_sci|Llu" target="_blank">here</a>. Genotype directly influences two of the genes (Gene1 and Gene3), and two of the genes (Gene2 and Gene3) directly influence the Phenotype. In this case, although we did not prevent the Genotype from directly influencing the Phenotype, the highest scoring networks did not include this directed edge. The right side of the figure shows the predictions of the network with Genotype=1 used as evidence. If Genotype is known to be in state 1, the values of all other variables in the network are expected to decrease compared to the distributions learned using all phenotypes. A more complete description of using BNW to make predictions with network models can be found in a <a href="BNW_workflow_net1.htm">separate tutorial</a>.<br><br><o:p></o:p></span></p>
+
+<img width=700 height=450 src="BNW_workflow_test_files/sci_5node_network1.jpg" v:shapes="Picture_x0020_2"></img>
+
+
+<p class=MsoNormal style='margin-right:307.5pt'><b style='mso-bidi-font-weight:
+normal'><span style='font-size:14.0pt;line-height:115%;font-family:"Arial","sans-serif"'><br>2.
+A genetic network with multiple genotypes and cis- and trans-regulated genes.<o:p></o:p></span></b></p>
+
+<p class=MsoNormal style='margin-top:0in;margin-right:307.5pt;margin-bottom:
+0in;margin-left:0in;margin-bottom:.0001pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'> In this example, we will add restrictions to a network containing 8 nodes: 2 genotype nodes (Geno1 and Geno2), 3 cis-regulated gene expression traits (cisGene1, cisGene2, and cisGene3), 2 trans-regulated gene expression traits (transGene1 and transGene2), and a phenotype (Pheno). We have four tiers of nodes (genotypes, cis-regulated genes, trans-regulated genes, and phenotype), so we have selected 4 from the dropdown menu at the top of the page and assigned the nodes to the correct tiers. We could make a more complex system of tiers that would allow us to specify which genes are regulated by which genotypes (for example, Geno1 regulates cisGene1 and transGene1, while Geno2 regulates cisGene2, cisGene3, and transGene2), but, for this example, we will use a simpler system of 4 tiers.<br><br><o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-right:307.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'>
+<![if !vml]><img width=537 height=258
+src="BNW_workflow_test_files/image2_4.jpg" v:shapes="Picture_x0020_14"><![endif]><o:p></o:p></span></p>
+
+
+<p class=MsoNormal style='margin-top:0in;margin-right:307.5pt;margin-bottom:
+0in;margin-left:0in;margin-bottom:.0001pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'> We have made one change to the default setting in the <u>Define interactions allowed between tiers</u> section. For Tier1, which contains the genotypes, we have selected "No" for the "Are within tier interactions allowed?", as it does not make biological sense for one genotype variation to cause the variation in another genotype in this example.<br><br><o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-right:307.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'>
+<![if !vml]><img width=536 height=133
+src="BNW_workflow_test_files/image2_5.jpg" v:shapes="Picture_x0020_14"><![endif]><o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-top:0in;margin-right:307.5pt;margin-bottom:
+0in;margin-left:0in;margin-bottom:.0001pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'>Assume that a known regulatory relationship between cisGene1 and transGene1 has been established from previous experiments. We can require that this relationship is included in the network by adding the edge list of required edges in the <u>Specify additional constraints</u> section.<br><br><o:p></o:p></span></p>
+
+<p class=MsoNormal style='margin-right:307.5pt'><span style='font-size:12.0pt;
+line-height:115%;font-family:"Arial","sans-serif";mso-no-proof:yes'>
+<![if !vml]><img width=750 height=300
+src="BNW_workflow_test_files/image2_6.jpg" v:shapes="Picture_x0020_17"><![endif]><o:p></o:p></span></p>
+</div>
+
+</body>
+
+</html>
diff --git a/sourcecodes/BNW_workflow_test_files/8node_best_structure.jpg b/sourcecodes/BNW_workflow_test_files/8node_best_structure.jpg
new file mode 100644
index 00000000..a6f1ff3e
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/8node_best_structure.jpg
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/8node_file_upload.jpg b/sourcecodes/BNW_workflow_test_files/8node_file_upload.jpg
new file mode 100644
index 00000000..0e5bf4aa
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/8node_file_upload.jpg
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/8node_geno1_2.jpg b/sourcecodes/BNW_workflow_test_files/8node_geno1_2.jpg
new file mode 100644
index 00000000..7e07f1aa
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/8node_geno1_2.jpg
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/8node_global_settings.jpg b/sourcecodes/BNW_workflow_test_files/8node_global_settings.jpg
new file mode 100644
index 00000000..80a427c9
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/8node_global_settings.jpg
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/8node_matrix.jpg b/sourcecodes/BNW_workflow_test_files/8node_matrix.jpg
new file mode 100644
index 00000000..71842c04
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/8node_matrix.jpg
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/8node_model_avg_struct.jpg b/sourcecodes/BNW_workflow_test_files/8node_model_avg_struct.jpg
new file mode 100644
index 00000000..034b1a6a
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/8node_model_avg_struct.jpg
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/8node_trait2_15.jpg b/sourcecodes/BNW_workflow_test_files/8node_trait2_15.jpg
new file mode 100644
index 00000000..887af1fd
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/8node_trait2_15.jpg
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/colorschememapping.xml b/sourcecodes/BNW_workflow_test_files/colorschememapping.xml
new file mode 100644
index 00000000..6a0069cd
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/colorschememapping.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<a:clrMap xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" bg1="lt1" tx1="dk1" bg2="lt2" tx2="dk2" accent1="accent1" accent2="accent2" accent3="accent3" accent4="accent4" accent5="accent5" accent6="accent6" hlink="hlink" folHlink="folHlink"/>
\ No newline at end of file
diff --git a/sourcecodes/BNW_workflow_test_files/filelist.xml b/sourcecodes/BNW_workflow_test_files/filelist.xml
new file mode 100644
index 00000000..a819df9c
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/filelist.xml
@@ -0,0 +1,32 @@
+<xml xmlns:o="urn:schemas-microsoft-com:office:office">
+ <o:MainFile HRef="../BNW_workflow_test.htm"/>
+ <o:File HRef="themedata.thmx"/>
+ <o:File HRef="colorschememapping.xml"/>
+ <o:File HRef="image003.png"/>
+ <o:File HRef="image004.jpg"/>
+ <o:File HRef="image005.png"/>
+ <o:File HRef="image006.jpg"/>
+ <o:File HRef="image007.png"/>
+ <o:File HRef="image008.jpg"/>
+ <o:File HRef="image009.png"/>
+ <o:File HRef="image010.jpg"/>
+ <o:File HRef="image011.png"/>
+ <o:File HRef="image012.jpg"/>
+ <o:File HRef="image013.png"/>
+ <o:File HRef="image014.jpg"/>
+ <o:File HRef="image015.png"/>
+ <o:File HRef="image016.jpg"/>
+ <o:File HRef="image017.png"/>
+ <o:File HRef="image018.jpg"/>
+ <o:File HRef="image033.png"/>
+ <o:File HRef="image020.jpg"/>
+ <o:File HRef="image019.png"/>
+ <o:File HRef="image022.jpg"/>
+ <o:File HRef="image021.png"/>
+ <o:File HRef="image024.jpg"/>
+ <o:File HRef="image023.png"/>
+ <o:File HRef="image026.jpg"/>
+ <o:File HRef="image025.png"/>
+ <o:File HRef="image039.jpg"/>
+ <o:File HRef="filelist.xml"/>
+</xml>
\ No newline at end of file
diff --git a/sourcecodes/BNW_workflow_test_files/image003.jpg b/sourcecodes/BNW_workflow_test_files/image003.jpg
new file mode 100644
index 00000000..e0730dbb
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/image003.jpg
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/image003.png b/sourcecodes/BNW_workflow_test_files/image003.png
new file mode 100644
index 00000000..02bbb455
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/image003.png
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/image004.jpg b/sourcecodes/BNW_workflow_test_files/image004.jpg
new file mode 100644
index 00000000..e85cb227
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/image004.jpg
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/image005.png b/sourcecodes/BNW_workflow_test_files/image005.png
new file mode 100644
index 00000000..d03c5765
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/image005.png
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/image006.jpg b/sourcecodes/BNW_workflow_test_files/image006.jpg
new file mode 100644
index 00000000..e063261a
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/image006.jpg
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/image007.png b/sourcecodes/BNW_workflow_test_files/image007.png
new file mode 100644
index 00000000..3a34f8b9
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/image007.png
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/image008.jpg b/sourcecodes/BNW_workflow_test_files/image008.jpg
new file mode 100644
index 00000000..d0a567ae
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/image008.jpg
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/image009.png b/sourcecodes/BNW_workflow_test_files/image009.png
new file mode 100644
index 00000000..1962b49e
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/image009.png
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/image010.jpg b/sourcecodes/BNW_workflow_test_files/image010.jpg
new file mode 100644
index 00000000..59f69854
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/image010.jpg
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/image011.png b/sourcecodes/BNW_workflow_test_files/image011.png
new file mode 100644
index 00000000..e09aec2e
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/image011.png
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/image012.jpg b/sourcecodes/BNW_workflow_test_files/image012.jpg
new file mode 100644
index 00000000..6f0786cc
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/image012.jpg
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/image013.png b/sourcecodes/BNW_workflow_test_files/image013.png
new file mode 100644
index 00000000..8cf05f23
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/image013.png
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/image014.jpg b/sourcecodes/BNW_workflow_test_files/image014.jpg
new file mode 100644
index 00000000..6f7fdf93
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/image014.jpg
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/image015.png b/sourcecodes/BNW_workflow_test_files/image015.png
new file mode 100644
index 00000000..ca53ba02
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/image015.png
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/image016.jpg b/sourcecodes/BNW_workflow_test_files/image016.jpg
new file mode 100644
index 00000000..301e4ea1
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/image016.jpg
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/image017.png b/sourcecodes/BNW_workflow_test_files/image017.png
new file mode 100644
index 00000000..0f992d24
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/image017.png
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/image018.jpg b/sourcecodes/BNW_workflow_test_files/image018.jpg
new file mode 100644
index 00000000..5ac5ae3c
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/image018.jpg
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/image019.png b/sourcecodes/BNW_workflow_test_files/image019.png
new file mode 100644
index 00000000..a30bf78f
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/image019.png
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/image020.jpg b/sourcecodes/BNW_workflow_test_files/image020.jpg
new file mode 100644
index 00000000..beb9de4e
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/image020.jpg
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/image021.png b/sourcecodes/BNW_workflow_test_files/image021.png
new file mode 100644
index 00000000..4278a3f8
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/image021.png
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/image022.jpg b/sourcecodes/BNW_workflow_test_files/image022.jpg
new file mode 100644
index 00000000..8ba6b124
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/image022.jpg
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/image023.png b/sourcecodes/BNW_workflow_test_files/image023.png
new file mode 100644
index 00000000..e7ecb665
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/image023.png
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/image024.jpg b/sourcecodes/BNW_workflow_test_files/image024.jpg
new file mode 100644
index 00000000..1cc62242
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/image024.jpg
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/image025.png b/sourcecodes/BNW_workflow_test_files/image025.png
new file mode 100644
index 00000000..27729f00
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/image025.png
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/image026.jpg b/sourcecodes/BNW_workflow_test_files/image026.jpg
new file mode 100644
index 00000000..8bf192dc
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/image026.jpg
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/image033.png b/sourcecodes/BNW_workflow_test_files/image033.png
new file mode 100644
index 00000000..7410feb2
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/image033.png
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/image039.jpg b/sourcecodes/BNW_workflow_test_files/image039.jpg
new file mode 100644
index 00000000..3a92d2ed
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/image039.jpg
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/image2_1.jpg b/sourcecodes/BNW_workflow_test_files/image2_1.jpg
new file mode 100644
index 00000000..1e929bad
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/image2_1.jpg
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/image2_2.jpg b/sourcecodes/BNW_workflow_test_files/image2_2.jpg
new file mode 100644
index 00000000..c8e4b628
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/image2_2.jpg
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/image2_3.jpg b/sourcecodes/BNW_workflow_test_files/image2_3.jpg
new file mode 100644
index 00000000..6fd9f414
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/image2_3.jpg
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/image2_4.jpg b/sourcecodes/BNW_workflow_test_files/image2_4.jpg
new file mode 100644
index 00000000..1f9070f1
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/image2_4.jpg
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/image2_5.jpg b/sourcecodes/BNW_workflow_test_files/image2_5.jpg
new file mode 100644
index 00000000..41051f92
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/image2_5.jpg
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/image2_6.jpg b/sourcecodes/BNW_workflow_test_files/image2_6.jpg
new file mode 100644
index 00000000..0e105597
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/image2_6.jpg
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/sci_5node_network1.jpg b/sourcecodes/BNW_workflow_test_files/sci_5node_network1.jpg
new file mode 100644
index 00000000..f0f9e662
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/sci_5node_network1.jpg
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/sci_5node_part1.jpg b/sourcecodes/BNW_workflow_test_files/sci_5node_part1.jpg
new file mode 100644
index 00000000..21cca66d
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/sci_5node_part1.jpg
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/sci_5node_part2.jpg b/sourcecodes/BNW_workflow_test_files/sci_5node_part2.jpg
new file mode 100644
index 00000000..d1803d1b
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/sci_5node_part2.jpg
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/sci_5node_part3.jpg b/sourcecodes/BNW_workflow_test_files/sci_5node_part3.jpg
new file mode 100644
index 00000000..0644daf9
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/sci_5node_part3.jpg
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/sci_5node_upload.jpg b/sourcecodes/BNW_workflow_test_files/sci_5node_upload.jpg
new file mode 100644
index 00000000..3dd7c3cc
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/sci_5node_upload.jpg
Binary files differdiff --git a/sourcecodes/BNW_workflow_test_files/themedata.thmx b/sourcecodes/BNW_workflow_test_files/themedata.thmx
new file mode 100644
index 00000000..55426d8e
--- /dev/null
+++ b/sourcecodes/BNW_workflow_test_files/themedata.thmx
Binary files differdiff --git a/sourcecodes/add_evd.php b/sourcecodes/add_evd.php
new file mode 100644
index 00000000..5c55f8b9
--- /dev/null
+++ b/sourcecodes/add_evd.php
@@ -0,0 +1,204 @@
+<?php 
+
+$keyval=trim($_GET['My_key']);
+
+include("restructuremap.php");
+
+
+function discretemap($textdata,$sym,$dmapdata)
+{
+$textdata=trim($textdata);
+$leve_l=array();
+$leve_l=explode("\n",$dmapdata);
+$leve_d=array();
+
+foreach($leve_l as $l)
+{ 
+  $l=trim($l);
+  $leve_d=explode("\t",$l);
+  $inxname=trim($leve_d[0]);
+  $name=trim($sym);
+  if($inxname==$name)
+  {    $i=0;
+       foreach($leve_d as $d)
+       { 
+         $d=trim($d);
+         if($d==$textdata)
+             return $i;
+         $i++;
+       }
+  } 
+}
+
+}
+
+
+
+
+
+function mapid($name,$keyval)
+{
+
+$dir="./data/";
+$nm=$dir.$keyval."mapdata.txt";
+$namelist=file_get_contents("$nm");
+
+$str_arrname=array();
+$str_arrname=explode("\n",$namelist);
+$dataname=array();
+$dataname=explode("\t",$str_arrname[0]);
+$i=1;
+
+ foreach($dataname as $cell)
+ {
+   $cell=trim($cell);
+   if($cell==$name)
+   {
+    $val=$i;
+    break;      
+   }
+    $i++;
+ }
+
+return $val;
+
+}
+
+
+$dir="./data/";
+
+$lfile=$dir.$keyval."nlevels.txt";
+$dmapdata=file_get_contents($lfile);   
+
+
+$sym=trim($_GET['name']);
+
+$textdata=$_GET['evidence'];
+$ft=$dir.$keyval."var.txt";
+$fpvar = file_get_contents("$ft");
+$ft=$dir.$keyval."vardata.txt";
+$fpdata  = file_get_contents("$ft");
+$ft=$dir.$keyval."varname.txt";
+$fpvarname  = file_get_contents("$ft");
+
+$vriable=mapid($sym,$keyval);
+
+$ft=$dir.$keyval."type.txt";
+$type = file_get_contents("$ft");
+$type_r=array();
+$type_r=explode("\n",$type);
+$type_n=array();
+$type_n=explode("\t",$type_r[0]);
+$type_d=array();
+$type_d=explode("\t",$type_r[1]);
+
+$nn=count($type_n);
+
+for($j=0;$j<$nn;$j++)
+{   
+   $dn=$type_n[$j];
+   $sym=trim($sym);
+   $dn=trim($dn); 
+   if($dn==$sym)
+     $s=$j;
+} 
+
+$dt=$type_d[$s];
+ 
+if($dt==1)
+   $textdata=reversemap($sym,$textdata,$keyval);
+else
+   $textdata=discretemap($textdata,$sym,$dmapdata);
+
+
+ $ft=$dir."$keyval"."var.txt"; 
+ $f1=fopen("$ft","w");  
+ $ft=$dir."$keyval"."vardata.txt";
+ $f2=fopen("$ft","w");  
+ $ft=$dir."$keyval"."varname.txt";
+ $f3=fopen("$ft","w");
+
+
+$pos = strpos($fpvarname, $sym);
+
+if($fpvarname=="")
+{
+  fwrite($f1,$vriable);
+  fwrite($f2,$textdata);
+  fwrite($f3,$sym);
+
+}
+else 
+{
+  if ($pos === false)// append at buttom as new records 
+  {
+  
+     $fpvar=$fpvar."\t".$vriable;
+     fwrite($f1,$fpvar);
+
+     $fpdata=$fpdata."\t".$textdata;
+     fwrite($f2,$fpdata);
+
+     $fpvarname=$fpvarname."\t".$sym;
+     fwrite($f3,$fpvarname);
+
+  }
+  else 
+  {
+     $cld=explode("\t",$fpvarname);
+     $j=0;
+     $inx=0;
+     foreach($cld as $cc)
+     {
+        $cc=trim($cc);
+        if($cc==$sym)
+        {
+              $inx=$j;
+        } 
+        $j++;
+    
+     }
+
+ 
+     fwrite($f1,$fpvar);
+     fwrite($f3,$fpvarname);
+
+     $cld1=explode("\t",$fpdata);
+     $j=0;
+     $dataw="";
+     foreach($cld1 as $cc)
+     {
+        $cc=trim($cc);
+        if($j==$inx)
+        {
+              $inx=$j;
+              fprintf($f2,"%s\t",$textdata);
+        }
+        else 
+        {          
+              fprintf($f2,"%s\t",$cc);
+        }
+        
+        $j++;
+    
+     }
+
+   }
+
+}
+
+
+  $file1="./data/".$keyval."run_evidencemodified.sh";
+  $initiallines=file_get_contents("./data/temp_evidence_file");
+  $all_lines="$initiallines"."$keyval\nfi\nexit";
+   
+  $fp = fopen($file1,"w"); 
+  fwrite($fp, "$all_lines\n");
+  fclose($fp);
+  //execute shell script for matlab
+  shell_exec('./runmat_evd.sh '.$keyval);
+
+?>
+<script>
+window.open("network_layout_evd_2.php?My_key=<?php print($keyval);?>",'_self',false);
+</script>
diff --git a/sourcecodes/add_evd_example.php b/sourcecodes/add_evd_example.php
new file mode 100644
index 00000000..1c6a8256
--- /dev/null
+++ b/sourcecodes/add_evd_example.php
@@ -0,0 +1,204 @@
+<?php 
+
+$keyval=trim($_GET['My_key']);
+
+include("restructuremap.php");
+
+
+function discretemap($textdata,$sym,$dmapdata)
+{
+$textdata=trim($textdata);
+$leve_l=array();
+$leve_l=explode("\n",$dmapdata);
+$leve_d=array();
+
+foreach($leve_l as $l)
+{ 
+  $l=trim($l);
+  $leve_d=explode("\t",$l);
+  $inxname=trim($leve_d[0]);
+  $name=trim($sym);
+  if($inxname==$name)
+  {    $i=0;
+       foreach($leve_d as $d)
+       { 
+         $d=trim($d);
+         if($d==$textdata)
+             return $i;
+         $i++;
+       }
+  } 
+}
+
+}
+
+
+
+
+
+function mapid($name,$keyval)
+{
+
+$dir="./data/";
+$nm=$dir.$keyval."mapdata.txt";
+$namelist=file_get_contents("$nm");
+
+$str_arrname=array();
+$str_arrname=explode("\n",$namelist);
+$dataname=array();
+$dataname=explode("\t",$str_arrname[0]);
+$i=1;
+
+ foreach($dataname as $cell)
+ {
+   $cell=trim($cell);
+   if($cell==$name)
+   {
+    $val=$i;
+    break;      
+   }
+    $i++;
+ }
+
+return $val;
+
+}
+
+
+$dir="./data/";
+
+$lfile=$dir.$keyval."nlevels.txt";
+$dmapdata=file_get_contents($lfile);   
+
+
+$sym=trim($_GET['name']);
+
+$textdata=$_GET['evidence'];
+$ft=$dir.$keyval."var.txt";
+$fpvar = file_get_contents("$ft");
+$ft=$dir.$keyval."vardata.txt";
+$fpdata  = file_get_contents("$ft");
+$ft=$dir.$keyval."varname.txt";
+$fpvarname  = file_get_contents("$ft");
+
+$vriable=mapid($sym,$keyval);
+
+$ft=$dir.$keyval."type.txt";
+$type = file_get_contents("$ft");
+$type_r=array();
+$type_r=explode("\n",$type);
+$type_n=array();
+$type_n=explode("\t",$type_r[0]);
+$type_d=array();
+$type_d=explode("\t",$type_r[1]);
+
+$nn=count($type_n);
+
+for($j=0;$j<$nn;$j++)
+{   
+   $dn=$type_n[$j];
+   $sym=trim($sym);
+   $dn=trim($dn); 
+   if($dn==$sym)
+     $s=$j;
+} 
+
+$dt=$type_d[$s];
+ 
+if($dt==1)
+   $textdata=reversemap($sym,$textdata,$keyval);
+else
+   $textdata=discretemap($textdata,$sym,$dmapdata);
+
+
+ $ft=$dir."$keyval"."var.txt"; 
+ $f1=fopen("$ft","w");  
+ $ft=$dir."$keyval"."vardata.txt";
+ $f2=fopen("$ft","w");  
+ $ft=$dir."$keyval"."varname.txt";
+ $f3=fopen("$ft","w");
+
+
+$pos = strpos($fpvarname, $sym);
+
+if($fpvarname=="")
+{
+  fwrite($f1,$vriable);
+  fwrite($f2,$textdata);
+  fwrite($f3,$sym);
+
+}
+else 
+{
+  if ($pos === false)// append at buttom as new records 
+  {
+  
+     $fpvar=$fpvar."\t".$vriable;
+     fwrite($f1,$fpvar);
+
+     $fpdata=$fpdata."\t".$textdata;
+     fwrite($f2,$fpdata);
+
+     $fpvarname=$fpvarname."\t".$sym;
+     fwrite($f3,$fpvarname);
+
+  }
+  else 
+  {
+     $cld=explode("\t",$fpvarname);
+     $j=0;
+     $inx=0;
+     foreach($cld as $cc)
+     {
+        $cc=trim($cc);
+        if($cc==$sym)
+        {
+              $inx=$j;
+        } 
+        $j++;
+    
+     }
+
+ 
+     fwrite($f1,$fpvar);
+     fwrite($f3,$fpvarname);
+
+     $cld1=explode("\t",$fpdata);
+     $j=0;
+     $dataw="";
+     foreach($cld1 as $cc)
+     {
+        $cc=trim($cc);
+        if($j==$inx)
+        {
+              $inx=$j;
+              fprintf($f2,"%s\t",$textdata);
+        }
+        else 
+        {          
+              fprintf($f2,"%s\t",$cc);
+        }
+        
+        $j++;
+    
+     }
+
+   }
+
+}
+
+
+  $file1="./data/".$keyval."run_evidencemodified.sh";
+  $initiallines=file_get_contents("./data/temp_evidence_file");
+  $all_lines="$initiallines"."$keyval\nfi\nexit";
+   
+  $fp = fopen($file1,"w"); 
+  fwrite($fp, "$all_lines\n");
+  fclose($fp);
+  //execute shell script for matlab
+  shell_exec('./runmat_evd.sh '.$keyval);
+
+?>
+<script>
+window.open("network_layout_evd_2_example.php?My_key=<?php print($keyval);?>",'_self',false);
+</script>
diff --git a/sourcecodes/add_inv.php b/sourcecodes/add_inv.php
new file mode 100644
index 00000000..77e0f0ef
--- /dev/null
+++ b/sourcecodes/add_inv.php
@@ -0,0 +1,262 @@
+<?php 
+include("restructuremap.php");
+$keyval=$_GET["My_key"];
+
+function discretemap($textdata,$sym,$dmapdata)
+{
+$textdata=trim($textdata);
+$leve_l=array();
+$leve_l=explode("\n",$dmapdata);
+$leve_d=array();
+
+foreach($leve_l as $l)
+{ 
+  $l=trim($l);
+  $leve_d=explode("\t",$l);
+  $inxname=trim($leve_d[0]);
+  $name=trim($sym);
+  if($inxname==$name)
+  {    $i=0;
+       foreach($leve_d as $d)
+       { 
+         $d=trim($d);
+         if($d==$textdata)
+             return $i;
+         $i++;
+       }
+  } 
+}
+
+}
+
+
+function mapid($name,$keyval)
+{
+
+$dir="./data/";
+
+$nm=$dir."$keyval"."mapdata.txt";
+$namelist=file_get_contents("$nm");
+
+$str_arrname=array();
+$str_arrname=explode("\n",$namelist);
+$dataname=array();
+$dataname=explode("\t",$str_arrname[0]);
+$i=1;
+
+ foreach($dataname as $cell)
+ {
+   $cell=trim($cell);
+   if($cell==$name)
+   {
+    $val=$i;
+    break;      
+   }
+    $i++;
+ }
+
+return $val;
+
+}
+
+
+$dir="./data/";
+
+$lfile=$dir.$keyval."nlevels.txt";
+$dmapdata=file_get_contents($lfile);
+
+
+$sym=trim($_GET['name']);
+
+$textdata=$_GET['evidence'];
+$ft=$dir.$keyval."var.txt";
+$fpvar = file_get_contents("$ft");
+$ft=$dir.$keyval."vardata.txt";
+$fpdata  = file_get_contents("$ft");
+$ft=$dir.$keyval."varname.txt";
+$fpvarname  = file_get_contents("$ft");
+
+$vriable=mapid($sym,$keyval);
+$ft=$dir.$keyval."type.txt";
+$type = file_get_contents("$ft");
+
+$type_r=array();
+$type_r=explode("\n",$type);
+$type_n=array();
+$type_n=explode("\t",$type_r[0]);
+$type_d=array();
+$type_d=explode("\t",$type_r[1]);
+
+$nn=count($type_n);
+
+for($j=0;$j<$nn;$j++)
+{   
+   $dn=$type_n[$j];
+   $sym=trim($sym);
+   $dn=trim($dn); 
+   if($dn==$sym)
+     $s=$j;
+} 
+
+$dt=$type_d[$s];
+ 
+if($dt==1)
+   $textdata=reversemap($sym,$textdata,$keyval);
+else
+   $textdata=discretemap($textdata,$sym,$dmapdata);
+
+ $ft=$dir.$keyval."var.txt"; 
+ $f1=fopen("$ft","w");  
+ $ft=$dir.$keyval."vardata.txt";
+ $f2=fopen("$ft","w");  
+ $ft=$dir.$keyval."varname.txt";
+ $f3=fopen("$ft","w");
+
+
+$pos = strpos($fpvarname, $sym);
+
+if($fpvarname=="")
+{
+  fwrite($f1,$vriable);
+  fwrite($f2,$textdata);
+  fwrite($f3,$sym);
+
+}
+else 
+{
+  if ($pos === false)// append at buttom as new records 
+  {
+  
+     $fpvar=$fpvar."\t".$vriable;
+     fwrite($f1,$fpvar);
+
+     $fpdata=$fpdata."\t".$textdata;
+     fwrite($f2,$fpdata);
+
+     $fpvarname=$fpvarname."\t".$sym;
+     fwrite($f3,$fpvarname);
+
+  }
+  else 
+  {
+     $cld=explode("\t",$fpvarname);
+     $j=0;
+     $inx=0;
+     foreach($cld as $cc)
+     {
+        $cc=trim($cc);
+        if($cc==$sym)
+        {
+              $inx=$j;
+        } 
+        $j++;
+    
+     }
+
+ 
+     fwrite($f1,$fpvar);
+     fwrite($f3,$fpvarname);
+
+     $cld1=explode("\t",$fpdata);
+     $j=0;
+     $dataw="";
+     foreach($cld1 as $cc)
+     {
+        $cc=trim($cc);
+        if($j==$inx)
+        {
+              $inx=$j;
+              fprintf($f2,"%s\t",$textdata);
+        }
+        else 
+        {          
+              fprintf($f2,"%s\t",$cc);
+        }
+        
+        $j++;
+    
+     }
+
+   }
+
+}
+
+include("mat_structure.php");
+structure_change($keyval);
+
+
+
+
+
+  $file1="./data/".$keyval."run_newintervention.sh";
+  $initiallines=file_get_contents("./data/temp_intervention_file");
+  $all_lines="$initiallines"."$keyval\nfi\nexit";
+
+  $fp = fopen($file1,"w"); 
+  fwrite($fp, "$all_lines\n");
+  fclose($fp);
+  //execute shell script for matlab
+ // $cmd="./runmat_inv.sh $keyval";
+//  system($cmd);
+shell_exec('./runmat_inv.sh '.$keyval);
+
+
+
+
+$matfile=$dir.$keyval."structure_input_new.txt";
+
+$fout=fopen($dir.$keyval."graphviz_new.txt","w");
+$matrix1=file_get_contents("$matfile");           
+$str_arrmat=array();
+$str_arrmat=explode("\n",$matrix1);
+$datamat=array();
+$data_cell=array(); 
+
+$dataname=array();
+$dataname=explode("\t",$str_arrmat[0]);
+$n=count($dataname);
+
+$initialstring="digraph G {\n"."size=\"10,10\";  ratio = fill;\n"."node [shape=square,width=1.5];\n";
+$endstring="}";
+fwrite($fout,"$initialstring");
+
+
+$g_file_name="./data/".$keyval."grviz_name_file_new.txt";
+$grviz_name_file=fopen($g_file_name,"w");
+
+for($i=0;$i<$n;$i++)
+{
+      $row_name=trim($dataname[$i]);  
+      fwrite($grviz_name_file,"$row_name\n");
+}
+
+
+for($i=1;$i<=$n;$i++)
+{
+         $ii=$i-1; 
+         $row_name=trim($dataname[$ii]);  
+
+ 
+         $col_arr=explode("\t",$str_arrmat[$i]);
+        
+        
+	   for($j=0;$j<$n;$j++)
+	   {
+               $col_val=trim($col_arr[$j]);
+               if($col_val==1)
+               { 
+                  $col_name=trim($dataname[$j]);
+                  fprintf($fout,"%s -> %s;\n",$ii,$j);  
+
+                 
+	        }
+          }
+          
+     
+} 
+fwrite($fout,"$endstring");   
+
+?>
+<script>
+window.open("network_layout_inv_2.php?My_key=<?php print($keyval);?>",'_self',false);
+</script>
diff --git a/sourcecodes/add_inv_example.php b/sourcecodes/add_inv_example.php
new file mode 100644
index 00000000..93c70c8d
--- /dev/null
+++ b/sourcecodes/add_inv_example.php
@@ -0,0 +1,251 @@
+<?php 
+include("restructuremap.php");
+$keyval=$_GET["My_key"];
+
+function discretemap($textdata,$sym,$dmapdata)
+{
+$textdata=trim($textdata);
+$leve_l=array();
+$leve_l=explode("\n",$dmapdata);
+$leve_d=array();
+
+foreach($leve_l as $l)
+{ 
+  $l=trim($l);
+  $leve_d=explode("\t",$l);
+  $inxname=trim($leve_d[0]);
+  $name=trim($sym);
+  if($inxname==$name)
+  {    $i=0;
+       foreach($leve_d as $d)
+       { 
+         $d=trim($d);
+         if($d==$textdata)
+             return $i;
+         $i++;
+       }
+  } 
+}
+
+}
+
+
+function mapid($name,$keyval)
+{
+
+$dir="./data/";
+
+$nm=$dir."$keyval"."mapdata.txt";
+$namelist=file_get_contents("$nm");
+
+$str_arrname=array();
+$str_arrname=explode("\n",$namelist);
+$dataname=array();
+$dataname=explode("\t",$str_arrname[0]);
+$i=1;
+
+ foreach($dataname as $cell)
+ {
+   $cell=trim($cell);
+   if($cell==$name)
+   {
+    $val=$i;
+    break;      
+   }
+    $i++;
+ }
+
+return $val;
+
+}
+
+
+$dir="./data/";
+
+$lfile=$dir.$keyval."nlevels.txt";
+$dmapdata=file_get_contents($lfile);
+
+
+$sym=trim($_GET['name']);
+
+$textdata=$_GET['evidence'];
+$ft=$dir.$keyval."var.txt";
+$fpvar = file_get_contents("$ft");
+$ft=$dir.$keyval."vardata.txt";
+$fpdata  = file_get_contents("$ft");
+$ft=$dir.$keyval."varname.txt";
+$fpvarname  = file_get_contents("$ft");
+
+$vriable=mapid($sym,$keyval);
+$ft=$dir.$keyval."type.txt";
+$type = file_get_contents("$ft");
+
+$type_r=array();
+$type_r=explode("\n",$type);
+$type_n=array();
+$type_n=explode("\t",$type_r[0]);
+$type_d=array();
+$type_d=explode("\t",$type_r[1]);
+
+$nn=count($type_n);
+
+for($j=0;$j<$nn;$j++)
+{   
+   $dn=$type_n[$j];
+   $sym=trim($sym);
+   $dn=trim($dn); 
+   if($dn==$sym)
+     $s=$j;
+} 
+
+$dt=$type_d[$s];
+ 
+if($dt==1)
+   $textdata=reversemap($sym,$textdata,$keyval);
+else
+   $textdata=discretemap($textdata,$sym,$dmapdata);
+
+ $ft=$dir.$keyval."var.txt"; 
+ $f1=fopen("$ft","w");  
+ $ft=$dir.$keyval."vardata.txt";
+ $f2=fopen("$ft","w");  
+ $ft=$dir.$keyval."varname.txt";
+ $f3=fopen("$ft","w");
+
+
+$pos = strpos($fpvarname, $sym);
+
+if($fpvarname=="")
+{
+  fwrite($f1,$vriable);
+  fwrite($f2,$textdata);
+  fwrite($f3,$sym);
+
+}
+else 
+{
+  if ($pos === false)// append at buttom as new records 
+  {
+  
+     $fpvar=$fpvar."\t".$vriable;
+     fwrite($f1,$fpvar);
+
+     $fpdata=$fpdata."\t".$textdata;
+     fwrite($f2,$fpdata);
+
+     $fpvarname=$fpvarname."\t".$sym;
+     fwrite($f3,$fpvarname);
+
+  }
+  else 
+  {
+     $cld=explode("\t",$fpvarname);
+     $j=0;
+     $inx=0;
+     foreach($cld as $cc)
+     {
+        $cc=trim($cc);
+        if($cc==$sym)
+        {
+              $inx=$j;
+        } 
+        $j++;
+    
+     }
+
+ 
+     fwrite($f1,$fpvar);
+     fwrite($f3,$fpvarname);
+
+     $cld1=explode("\t",$fpdata);
+     $j=0;
+     $dataw="";
+     foreach($cld1 as $cc)
+     {
+        $cc=trim($cc);
+        if($j==$inx)
+        {
+              $inx=$j;
+              fprintf($f2,"%s\t",$textdata);
+        }
+        else 
+        {          
+              fprintf($f2,"%s\t",$cc);
+        }
+        
+        $j++;
+    
+     }
+
+   }
+
+}
+
+include("mat_structure.php");
+structure_change($keyval);
+
+
+
+
+
+  $file1="./data/".$keyval."run_newintervention.sh";
+  $initiallines=file_get_contents("./data/temp_intervention_file");
+  $all_lines="$initiallines"."$keyval\nfi\nexit";
+
+  $fp = fopen($file1,"w"); 
+  fwrite($fp, "$all_lines\n");
+  fclose($fp);
+  //execute shell script for matlab
+ // $cmd="./runmat_inv.sh $keyval";
+//  system($cmd);
+shell_exec('./runmat_inv.sh '.$keyval);
+
+
+
+
+$matfile=$dir.$keyval."structure_input_new.txt";
+
+$fout=fopen($dir.$keyval."graphviz_new.txt","w");
+$matrix1=file_get_contents("$matfile");           
+$str_arrmat=array();
+$str_arrmat=explode("\n",$matrix1);
+$datamat=array();
+$data_cell=array(); 
+
+$dataname=array();
+$dataname=explode("\t",$str_arrmat[0]);
+$n=count($dataname);
+
+$initialstring="digraph G {\n"."size=\"10,10\";  ratio = fill;\n"."node [shape=square,width=1.5];\n";
+$endstring="}";
+fwrite($fout,"$initialstring");
+
+for($i=1;$i<=$n;$i++)
+{
+         $ii=$i-1; 
+         $row_name=trim($dataname[$ii]);  
+
+ 
+         $col_arr=explode("\t",$str_arrmat[$i]);
+        
+        
+	   for($j=0;$j<$n;$j++)
+	   {
+               $col_val=trim($col_arr[$j]);
+               if($col_val==1)
+               { 
+                  $col_name=trim($dataname[$j]);
+                  fprintf($fout,"%s -> %s;\n",$row_name,$col_name);  
+
+                 
+	        }
+          }
+          
+     
+} 
+fwrite($fout,"$endstring");   
+
+?>
+<script>
+window.open("network_layout_inv_2_example.php?My_key=<?php print($keyval);?>",'_self',false);
+</script>
diff --git a/sourcecodes/bn_file_load_gom.php b/sourcecodes/bn_file_load_gom.php
new file mode 100644
index 00000000..342afe02
--- /dev/null
+++ b/sourcecodes/bn_file_load_gom.php
@@ -0,0 +1,401 @@
+<?php
+////////////////This code load a data file and creates input file for continuous global optimal search (our modification). execute_bn_gom.php link is for execution of structure learning and create_tiers_gom.php is for adding restrictions///////////////////////////////////
+
+include("header_new.inc");
+include("header_batchsearch.inc");
+include("runtime_check.php");
+$searchID="";
+$UploadValue="NO";
+$TextFile=$HTTP_POST_FILES["MyFile"]["name"];
+
+/////////////Generate a random key/////////////////////
+$alphas=array();
+$alphas = array_merge(range('A', 'Z'), range('a', 'z'));
+
+$al1=rand(0,51);
+$al2=rand(0,51);
+$al3=rand(0,51);
+
+$alpha="$alphas[$al1]"."$alphas[$al2]"."$alphas[$al3]";
+$keyval=$alpha;
+
+
+if($_POST["My_key"]!="")
+  $keyval=$_POST["My_key"];
+
+
+////////////////////max parent/////////////////////////
+
+
+$type_n=array();
+
+//Get number of parent data and key value for changes in number of parent
+$type_n=explode("|",$_POST["nm_parent"]);
+if($keyval=="")
+   $keyval=$type_n[0];
+
+$sid=$keyval."continuous_input";
+$dir="./data/";
+
+$TextinFileFinal=$dir.$sid.".txt";
+$TextinFile=$dir.$sid."_temp.txt";
+$TextinFilenamelist=$dir.$keyval."name.txt";
+
+//print default number of parents
+$parent_number=4;
+$pfile=$dir.$keyval."parent.txt";
+$parentf=fopen($pfile,"w");
+fwrite($parentf,"$parent_number\n");
+
+//print default number of k for model averaging
+$k_number=1;
+$kfile=$dir.$keyval."k.txt";
+$kf=fopen($kfile,"w");
+fwrite($kf,"$k_number\n");
+
+//print default threshold for model averaging
+$thrfile=$dir.$keyval."thr.txt";
+$kf=fopen($thrfile,"w");
+fwrite($kf,"0.5\n");
+
+if(isset($HTTP_POST_VARS["searchkey"]))
+{
+   $searchID=$HTTP_POST_VARS["searchkey"];
+
+}
+
+if($searchID!="")
+{
+?>
+
+<!-- Site navigation menu -->
+<ul class="navbar2">
+  <li><a href="executionprogress.php?My_key=<?php print($keyval);?>">Perform Bayesian network modeling using default settings</a>
+  <li><a href="create_tiers_gom.php?My_key=<?php print($keyval);?>">Go to structure learning settings and the BNW structural constraint interface</a>  
+</ul>
+<ul class="navbar">
+  <li><a href="help.php#file_format" target="_blank">Data formatting guidelines</a> 
+  <li><a href="help.php" target="_blank">Help</a>
+  <li><a href="home.php">Home</a>
+</ul>
+<?php
+}
+else
+{
+
+?>
+<!-- Site navigation menu -->
+<ul class="navbar">
+  <li><a href="help.php#file_format" target="_blank">Data formatting guidelines</a> 
+  <li><a href="help.php" target="_blank">Help</a>
+  <li><a href="home.php">Home</a>
+</ul>
+<?php
+}
+
+
+if(isset($HTTP_POST_VARS["MyUpload"]))
+{
+   $UploadValue=$HTTP_POST_VARS["MyUpload"];
+   if ($UploadValue=="YES")
+   {
+        if($TextFile!="")
+        {
+            $sta=move_uploaded_file($HTTP_POST_FILES['MyFile']['tmp_name'],$TextinFile);
+            if(!$sta)
+            {
+                 echo "<script type='text/javascript'> window.alert ('Sorry, error uploading $TextFile.')</script>";
+                 flush();
+                 exit();
+            }
+            else
+            {
+                $searchID=file_get_contents("$TextinFile");
+		  unlink($TextinFile);
+
+            }
+
+        }
+
+       else
+       {
+           echo "<script type='text/javascript'> window.alert ('Sorry, please select upload file.')</script>";
+       }
+   }
+}
+
+?>
+<div id="outernew">
+<h2><font color=#33339f>Upload data file for structure learning search</font></h2>
+<FORM name="key_search" enctype="multipart/form-data" ACTION="bn_file_load_gom.php" METHOD=POST>
+
+<table align="left" cellspacing="3" cellpadding="1" border="0"  width="60%">
+<tr>
+<td>
+<INPUT style="background-color:#FFFFFF;color:#0000FF" type="file" name="MyFile" size=45 > 
+<INPUT TYPE="submit" value="  Upload  " onclick="return Upload();">
+<INPUT TYPE="hidden" NAME="My_key" value=<?php print($keyval) ?> >
+<INPUT TYPE="hidden" name="MyUpload" value="NO"> 
+</td>
+</tr>
+<tr>
+<td align="left"><font color=#33339f><br>Content of uploaded data file:</font><br>
+          <textarea name="searchkey" rows="10" cols="100"><?PHP print($searchID)?> </textarea>
+</td>
+</tr>
+<tr>
+<td>
+<INPUT TYPE="submit" value="  Load example data of immune responses to infection with Chlamydia psittaci  " onclick="return demochl();">&nbsp&nbsp&nbsp
+<INPUT TYPE="hidden" NAME="My_key" value=<?php print($keyval) ?> >
+</td>
+</tr>
+<tr>
+<td>
+<INPUT TYPE="submit" value="  Load example data of a synthetic genetic network with 2 genotypes and 6 traits  " onclick="return demo8nodes();">&nbsp&nbsp&nbsp
+<INPUT TYPE="hidden" NAME="My_key" value=<?php print($keyval) ?> >
+</td>
+</tr>
+<tr>
+<td>
+<INPUT TYPE="submit" value="  Load example data of immune-related gene in the spleens of BXD mice  " onclick="return demospnl();">&nbsp&nbsp&nbsp
+<INPUT TYPE="hidden" NAME="My_key" value=<?php print($keyval) ?> >
+</td>
+</tr>
+<tr>
+<td>
+<INPUT TYPE="submit" value="  Load the ksl dataset from deal  " onclick="return demoksl();">&nbsp&nbsp&nbsp
+<INPUT TYPE="hidden" NAME="My_key" value=<?php print($keyval) ?> >
+</td>
+</tr>
+<tr>
+<td>
+<INPUT TYPE="submit" value="  Load the rat dataset from deal  " onclick="return demorat();">&nbsp&nbsp&nbsp
+<INPUT TYPE="hidden" NAME="My_key" value=<?php print($keyval) ?> >
+</td>
+</tr>
+</table>
+</FORM>
+</div>
+<?php
+//////////////////Format data for Structure learning "C" code////////
+
+  $str_arr=array();
+  $searchID=trim($searchID);
+  $str_arr=explode("\n",$searchID);
+  $data=array();
+
+   
+  $fph = fopen($TextinFilenamelist,"w");
+  $fpmain = fopen($TextinFileFinal,"w");
+
+  $cont_arr=array();
+  $cont_arr_tmp=array();
+
+
+  $data_type=array();
+  $level_arr=array();
+
+//Who is discrete? Who is continuous?
+  $i=0;
+  $lc=0;
+  foreach($str_arr as $line)
+  {
+    $line=trim($line); 
+    if($lc==0)
+      {
+       fwrite($fph, "$line\n");
+	fprintf($fpmain, "$line\n");
+       $name_t=$line;
+
+	fclose($fph); 
+       $data=explode("\t",$line);
+	$j=0;
+       foreach($data as $d_c)
+	  {
+           $d_c=trim($d_c);
+           $level_arr[$j][0]=$d_c;  //variable name y for 
+            
+	    $data_type[$j]=0;
+            $j++;
+          }
+          $lcc=$j;  //$lcc=number of column in the input file 
+      }        
+    else
+      { 
+        
+        $strline=""; 
+        $data=explode("\t",$line);
+	 $j=0;
+        foreach($data as $d_c) 
+        {
+            $d_c=trim($d_c);
+	     $cont_arr[$i][$j]=$d_c; 
+            $cont_arr_tmp[$i][$j]=$d_c; 
+
+            $mystring = $d_c;
+	     $findme   = '.';
+	     $pos = strpos($mystring, $findme);
+            $strline.="1\t";
+  
+            if ($pos != false)
+            {
+                $data_type[$j]=1;
+            }
+            $j++;
+         }
+	 $i++; 
+    
+      }
+     $lc++;
+     
+  }
+$lc--; //$lc=number of rows in the input file
+//Now count number of labels for discrete variables and populate the $data_type[$j] 
+$data_count=0;
+$l_type="";
+for($j=0;$j<$lcc;$j++)
+{
+
+       if($data_type[$j]!=1)
+	{
+	  $data_count=0;
+	  for($i=0;$i<$lc;$i++)
+	  {
+              $vi=$i+1;
+	       for($ii=$vi;$ii<$lc;$ii++)
+	       {
+                 if($cont_arr[$i][$j]==$cont_arr[$ii][$j] && $cont_arr[$i][$j]!=-9999)
+		   {
+		       $cont_arr[$ii][$j]=-9999; 
+               
+		   } 
+	       }
+               
+              
+         }
+	  for($i=0;$i<$lc;$i++)
+	     {
+	       if($cont_arr[$i][$j]!=-9999 && $cont_arr[$i][$j]!="")
+		{
+                  // $data_count_l=$data_count+2;
+                  $data_count++;
+                  $level_arr[$j][$data_count]=$cont_arr[$i][$j];
+              }
+	     }
+	  $data_type[$j]=$data_count;
+	    
+	   
+	}
+       if($j==0)
+         $l_type.=$data_type[$j];
+       else
+	 $l_type.="\t".$data_type[$j];  
+      
+    }
+
+///////////////////Write data to files/////////////////
+$fptype = fopen($dir.$keyval."type.txt","w");
+$fpnode= fopen($dir.$keyval."nnode.txt","w");
+fwrite($fpnode,"$lcc\n");
+$fprows = fopen($dir.$keyval."nrows.txt","w");
+fwrite($fprows,"$lc\n");
+$flevel = fopen($dir.$keyval."nlevels.txt","w");
+
+//print in level mapping file for discrete variables
+for($j=0;$j<$lcc;$j++)
+{
+  if($data_type[$j]>1)
+  {  
+      fprintf($flevel,"%s",$level_arr[$j][0]);
+      $m=$data_type[$j];
+      for($jj=1;$jj<=$m;$jj++)
+      {
+         fprintf($flevel,"\t%s",$level_arr[$j][$jj]);
+      }
+
+      fprintf($flevel,"\n");  
+  }   
+}
+
+
+fwrite($fptype,"$name_t\n");
+for($j=0;$j<$lcc;$j++)
+{
+  fprintf($fptype,"$data_type[$j]\t");
+}
+fwrite($fptype,"\n");
+
+  
+fwrite($fpmain, "$l_type\n");
+$l_c=0;
+
+//perform discrete level replacement 
+for($m=0;$m<$lcc;$m++)  //column
+{
+  if($data_type[$m]>1)
+  {
+     $r=$data_type[$m];
+     for($j=1;$j<=$r;$j++)
+     {  
+         $search=$level_arr[$m][$j];
+         $replace=$j."#";
+         for($n=0;$n<$lc;$n++)  //row
+         { 
+           $val=$cont_arr_tmp[$n][$m];
+           if($val==$search)
+               $cont_arr_tmp[$n][$m]=$replace;  //alter levels 
+         }
+     }
+     for($n=0;$n<$lc;$n++)  //row
+          $cont_arr_tmp[$n][$m]=str_replace('#','',$cont_arr_tmp[$n][$m]);
+  }
+}
+
+//write data to output file
+for($j=0;$j<$lc;$j++)
+{
+  fprintf($fpmain,"%s",$cont_arr_tmp[$j][0]);
+  for($jj=1;$jj<$lcc;$jj++)
+    fprintf($fpmain,"\t%s",$cont_arr_tmp[$j][$jj]);
+  fprintf($fpmain, "\n");
+}
+
+fclose($fpmain);
+
+////////////////empty ban and white list/////////////////////////////
+
+$sid1=$keyval."ban";
+$sid2=$keyval."white";
+$wdir="./data/"; 
+
+$Textban=$wdir.$sid1.".txt";
+$Textwhite=$wdir.$sid2.".txt";
+
+$fpb = fopen($Textban,"w");
+$fpw = fopen($Textwhite,"w");
+
+$datpost="From\tTo\n";
+
+fwrite($fpb,"$datpost");
+fwrite($fpw,"$datpost");
+if($searchID!="")
+{
+
+$runtime=exe_time($keyval,$parent_number,$k_number);
+?>
+<div id="outernew">
+<p><h3><?php 
+print("Estimated run time for current dataset using default settings: $runtime seconds");
+?>
+<br><br></h3>
+</p>
+<br>
+</div>
+<?php
+}
+?>
+
+</body>
+</html>
+
+
diff --git a/sourcecodes/build.sh b/sourcecodes/build.sh
new file mode 100644
index 00000000..a5958fd7
--- /dev/null
+++ b/sourcecodes/build.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+gcc ./localscore/network_score.c ./localscore/libRmath.so -lm -o network_score
+gcc ./print_structure/structure.c -lm -o structure
+
+cd ./k-best/src/
+./buildk_poster.sh
+
+
+
diff --git a/sourcecodes/clear.php b/sourcecodes/clear.php
new file mode 100644
index 00000000..8d8f8344
--- /dev/null
+++ b/sourcecodes/clear.php
@@ -0,0 +1,20 @@
+<?php
+
+$oldkeyval=$_GET["My_key"];
+
+/////////////Generate a random key/////////////////////
+$alphas=array();
+$alphas = array_merge(range('A', 'Z'), range('a', 'z'));
+
+$al1=rand(0,51);
+$al2=rand(0,51);
+$al3=rand(0,51);
+
+$alpha="$alphas[$al1]"."$alphas[$al2]"."$alphas[$al3]";
+$keyval=$alpha;
+shell_exec('./filecopy.sh '.$oldkeyval.' '.$keyval);
+
+?>
+<script>
+window.open("layout.php?My_key=<?php print($keyval);?>",'_self',false);
+</script>
diff --git a/sourcecodes/clear_example.php b/sourcecodes/clear_example.php
new file mode 100644
index 00000000..4b0a8315
--- /dev/null
+++ b/sourcecodes/clear_example.php
@@ -0,0 +1,20 @@
+<?php
+
+$oldkeyval=$_GET["My_key"];
+
+/////////////Generate a random key/////////////////////
+$alphas=array();
+$alphas = array_merge(range('A', 'Z'), range('a', 'z'));
+
+$al1=rand(0,51);
+$al2=rand(0,51);
+$al3=rand(0,51);
+
+$alpha="$alphas[$al1]"."$alphas[$al2]"."$alphas[$al3]";
+$keyval=$alpha;
+shell_exec('./filecopy.sh '.$oldkeyval.' '.$keyval);
+
+?>
+<script>
+window.open("layout_example.php?My_key=<?php print($keyval);?>",'_self',false);
+</script>
diff --git a/sourcecodes/create_tiers_gom.php b/sourcecodes/create_tiers_gom.php
new file mode 100644
index 00000000..0f332eef
--- /dev/null
+++ b/sourcecodes/create_tiers_gom.php
@@ -0,0 +1,1034 @@
+<?php 
+
+///////This code will allow users to group variables in tier. getcombineDescription() function combined all data and take you to "tier_description_processing_gom.php" for preparation of ban and whitelist //////////
+
+include("header_new.inc");
+include("runtime_check.php");
+
+$keyval=$_GET["My_key"];
+
+$dir="./data/";
+
+
+
+$type_n=array();
+
+//Get number of tier data and key value for changes in number of tier
+
+if(isset($_POST["nm_tier"]))
+{
+   $type_n=explode("|",$_POST["nm_tier"]);
+}
+else if(isset($_POST["nm_parent"]))
+{
+   $type_n=explode("|",$_POST["nm_parent"]);
+}
+else if(isset($_POST["nm_k"]))
+{
+   $type_n=explode("|",$_POST["nm_k"]);
+}
+else if(isset($_POST["nm_thr"]))
+{
+    $type_n=explode("|",$_POST["nm_thr"]);
+}
+
+$parent_number=trim($type_n[0]);   
+$k_number=trim($type_n[1]);   
+$tier_number=trim($type_n[2]);   
+$structure_thr=trim($type_n[3]);   
+
+
+if($keyval=="")
+  $keyval=$type_n[4];
+
+if($parent_number=="")
+{
+   $parent_number=4;
+}
+
+if($k_number=="")
+{
+   $k_number=1;
+}
+
+if($tier_number=="")
+{
+  $tier_number=3;
+}
+if($structure_thr=="")
+{
+  $structure_thr=0.5;
+}
+
+
+
+$nf=$dir.$keyval."nnode.txt";
+$node=trim(file_get_contents("$nf"));
+$maxplist=$node-1;
+
+//print default number of parents
+$pfile=$dir.$keyval."parent.txt";
+$parentf=fopen($pfile,"w");
+fwrite($parentf,"$parent_number\n");
+
+//print default number of k for model averaging
+$kfile=$dir.$keyval."k.txt";
+$kf=fopen($kfile,"w");
+fwrite($kf,"$k_number\n");
+
+//print model averaging threshold
+$thrfile=$dir.$keyval."thr.txt";
+$kf=fopen($thrfile,"w");
+fwrite($kf,"$structure_thr\n");
+
+//////////////////Check execution time///////////////////////////////////////////////
+$runtime=exe_time($keyval,$parent_number,$k_number);
+
+//print("Runtime is $runtime");
+
+?>
+<!-- Site navigation menu -->
+<ul class="navbar2">
+  <li><p onClick="getcombineDescription(ntiers,'ban_from','ban_to','white_from','white_to','<?php print($keyval);?>')"><a href="javascript:void(0)" >Perform Bayesian network modeling</a></p>
+</ul>
+<ul class="navbar">
+  <li><a href="help.php#constraint_interface" target="_blank">How to use this page</a>
+  <li><a href="help.php" target="_blank">Help</a>
+  <li><a href="home.php">Home</a>
+
+</ul>
+
+<div id="outernew">
+<p><h3><?php 
+print("Estimated run time for the current parameters: $runtime seconds");
+?>
+<br><br></h3>
+</p>
+<br>
+<p><h3>1. Global structure learning settings:<br><br></h3>
+</p>
+<table align="center">
+<tr>
+<td align="left">
+Maximum number of parents for any node:
+</td>
+<td align="left"> 
+     <form method="post" action="create_tiers_gom.php" name="form">
+      <SELECT NAME="nm_parent"  onchange="form.submit();">
+      <?php if($node<=10) 
+            {
+               for($i=1;$i<$node;$i++)
+              {
+            ?>
+              <option value=<?php $combined=$i."|".$k_number."|".$tier_number."|".$structure_thr."|".$keyval; print($combined)?> <?php if($parent_number == $i) {print "selected";}?>><?php print($i)?></option>
+            <?php
+              }
+            }
+            else
+            {
+               for($i=1;$i<=9;$i++)
+               {
+   
+                ?>
+                 <option value=<?php $combined=$i."|".$k_number."|".$tier_number."|".$structure_thr."|".$keyval; print($combined)?> <?php if($parent_number == $i) {print "selected";}?>><?php print($i)?></option>
+               <?php
+               }
+               ?>
+              <option value=<?php $combined=$maxplist."|".$k_number."|".$tier_number."|".$structure_thr."|".$keyval; print($combined)?> <?php if($parent_number == $maxplist) {print "selected";}?>>All</option>
+           <?php
+
+            }
+            
+     ?>  
+ 
+      </SELECT>
+   </form>
+</td>
+</tr>
+<tr>
+<td align="left">
+Number of networks to include in model averaging:
+</td>
+<td align="left"> 
+     <form method="post" action="create_tiers_gom.php" name="form">
+      <SELECT NAME="nm_k"  onchange="form.submit();">
+           <option value=<?php $combined=$parent_number."|"."1"."|".$tier_number."|".$structure_thr."|".$keyval; print($combined)?> <?php if($k_number == 1) {print "selected";}?>><?php print("1")?></option>
+           <option value=<?php $combined=$parent_number."|"."10"."|".$tier_number."|".$structure_thr."|".$keyval; print($combined)?> <?php if($k_number == 10) {print "selected";}?>><?php print("10")?></option>
+          <option value=<?php $combined=$parent_number."|"."50"."|".$tier_number."|".$structure_thr."|".$keyval; print($combined)?> <?php if($k_number == 50) {print "selected";}?>><?php print("50")?></option>
+          <option value=<?php $combined=$parent_number."|"."100"."|".$tier_number."|".$structure_thr."|".$keyval; print($combined)?> <?php if($k_number == 100) {print "selected";}?>><?php print("100")?></option>
+          <option value=<?php $combined=$parent_number."|"."500"."|".$tier_number."|".$structure_thr."|".$keyval; print($combined)?> <?php if($k_number == 500) {print "selected";}?>><?php print("500")?></option>
+          <option value=<?php $combined=$parent_number."|"."1000"."|".$tier_number."|".$structure_thr."|".$keyval; print($combined)?> <?php if($k_number == 1000) {print "selected";}?>><?php print("1000")?></option>
+      </SELECT>
+   </form>
+</td>
+</tr>
+<tr>
+<td align="left">
+Model averaging edge selection threshold:
+</td>
+<td align="left"> 
+     <form method="post" action="create_tiers_gom.php" name="form">
+      <SELECT NAME="nm_thr"  onchange="form.submit();">
+     <option value=<?php $combined=$parent_number."|".$k_number."|".$tier_number."|"."0.5"."|".$keyval; print($combined)?> <?php if($structure_thr == 0.5) {print "selected";}?>>0.5</option>
+     <option value=<?php $combined=$parent_number."|".$k_number."|".$tier_number."|"."0.6"."|".$keyval; print($combined)?> <?php if($structure_thr == 0.6) {print "selected";}?>>0.6</option>
+     <option value=<?php $combined=$parent_number."|".$k_number."|".$tier_number."|"."0.7"."|".$keyval; print($combined)?> <?php if($structure_thr == 0.7) {print "selected";}?>>0.7</option>
+     <option value=<?php $combined=$parent_number."|".$k_number."|".$tier_number."|"."0.8"."|".$keyval; print($combined)?> <?php if($structure_thr == 0.8) {print "selected";}?>>0.8</option>
+     <option value=<?php $combined=$parent_number."|".$k_number."|".$tier_number."|"."0.9"."|".$keyval; print($combined)?> <?php if($structure_thr == 0.9) {print "selected";}?>>0.9</option>
+     <option value=<?php $combined=$parent_number."|".$k_number."|".$tier_number."|"."1.0"."|".$keyval; print($combined)?> <?php if($structure_thr == 1.0) {print "selected";}?>>1.0</option>
+    
+      </SELECT>
+   </form>
+</td>
+</tr>
+<tr>
+<td align="left">
+Number of tiers:
+</td>
+<td align="left"> 
+     <form method="post" action="create_tiers_gom.php" name="form">
+      <SELECT NAME="nm_tier"  onchange="form.submit();">
+      <?php for($i=2;$i<10;$i++)
+      {
+        ?>
+           <option value=<?php $combined=$parent_number."|".$k_number."|".$i."|".$structure_thr."|".$keyval; print($combined)?> <?php if($tier_number == $i) {print "selected";}?>><?php print($i)?></option>
+     <?php
+     }
+   
+     ?>  
+      </SELECT>
+   </form>
+</td>
+</tr>
+</table>
+</br>
+
+
+<?php
+
+
+if(isset($HTTP_POST_VARS["bantext"]))
+{
+   $ban_search=$HTTP_POST_VARS["searchkey"];
+}
+
+if(isset($HTTP_POST_VARS["whitetext"]))
+{
+   $white_search=$HTTP_POST_VARS["searchkey"];
+}
+
+?>
+
+<!DOCTYPE html> 
+<html> 
+<head> 
+<title>Drag and Drop test</title> 
+<style type="text/css"> 
+	#nodelist{
+		width:200px;
+		font-weight:bold;
+                border: 2px solid;
+		}
+        #tiers{
+                position:absolute;
+                left:215px;
+                white-space: nowrap; 
+                min-width: 3000px;
+                float:top;
+                }
+
+        #int_box1{
+                white-space: nowrap;
+                min-width: 10000px;
+                }
+        #int_box2{
+                white-space: nowrap;
+                min-width: 10000px;
+                }
+        #int_box3{
+                white-space: nowrap;
+                min-width: 10000px;
+                }
+        #int_box4{
+                white-space: nowrap;
+                min-width: 10000px;
+                }
+
+        #outer_tier_desc{
+                margin-top: 100px;
+                }
+
+        #outer_tier_desc1{
+                width:2000px;
+                margin-top: 20px;
+                }
+
+	#outer_box_lists{
+                margin-top: 100px;
+		}
+	#nodelist2{
+		width:200px;
+		font-weight:bold;
+                border: 2px solid;
+                float:left;
+		}
+	#ban_outer {
+                position:absolute;
+                left: 215px;
+                width:449px;
+		border: 2px solid;
+                background-color:#C0C0C0;
+		font-weight:bold;
+                margin-left:15px;
+	}
+        #ban_from {
+                width:200px;
+                border:2px solid;
+                margin-left:15px;
+        }
+        #ban_to {
+                width:200px;
+                border:2px solid;
+                margin-left:15px;
+        }
+	#white_outer {
+                position:absolute;
+                left:700px;
+                width:449px;
+		border: 2px solid;
+                background-color:#C0C0C0;
+		font-weight:bold;
+	}
+        #white_from {
+                width:200px;
+                border:2px solid;
+                margin-left:15px;
+        }
+        #white_to {
+                width:200px;
+                border:2px solid;
+                margin-left:15px;
+        }
+
+
+	.tier {
+		width:200px;
+		border: 2px solid;
+		font-weight:bold;
+                float:left;
+                background-color:#FFFFFF;
+                margin-left:5px;
+	        display: inline-block;
+	}
+	.int {
+		border: 2px solid;
+		font-weight:bold;
+                float:left;
+                background-color:#FFFFFF;
+                margin-left:0px;
+	        display: inline-block;
+	}
+	.int1 {
+		border: 2px solid;
+                background-color:#FFFFFF;
+	        clear: left;
+	        float:left;
+                margin-left:0px;
+	        display: inline-block;
+	}
+	.node1 {
+		width:150px;
+		height:30px;
+		float:left;	
+		margin-left:10px;
+		margin-top:10px;
+		border: 2px dashed;
+                background-color:#C0C0C0;
+	}
+	.node2 {
+		width:150px;
+		height:30px;
+		float:left;	
+		margin-left:10px;
+		margin-top:10px;
+		border: 2px dashed;
+                background-color:#EAE822;
+	}
+
+</style> 
+
+<script type="text/javascript">
+
+//There are three groups of functions here:
+//The first group is involved with dragging and dropping nodes
+// between different locations.
+//The second group is involved with creating the divs that are needed
+// based on the number of nodes and number of tiers and organizing
+// them on the webpage.
+//The third group determines which divs the nodes are located in
+// to group the nodes into tiers and make ban and white lists.
+
+
+//Drag and drop functions:
+function drag(drop_target, e) {
+		e.dataTransfer.setData('Text', drop_target.id);
+		}
+
+function drop(drop_target, e) {
+		var id = e.dataTransfer.getData('Text');
+		drop_target.appendChild(document.getElementById(id));
+		e.preventDefault();
+	        } 
+
+function dropCopy(ev) {
+           ev.stopPropagation();
+           ev.preventDefault();
+           var src = ev.dataTransfer.getData("Text");
+           var orig = document.getElementById(src);
+           var pid = orig.parentNode.id;
+           var target_id = ev.target.id;
+           //document.write(pid);
+           if (pid != target_id){
+                var origclone = orig.cloneNode(true);
+                var newid = src+"a";
+                origclone.setAttribute('id',newid);
+                document.getElementById(pid).appendChild(origclone);
+                ev.target.appendChild(orig);
+           }
+           else {
+                document.write(pid,target_id);
+           }
+           return false; 
+}
+
+
+
+
+function loadFunction(nnodes,ntiers) {
+             makeNodeList(nnodes,'nodelist','tr');
+             makeNodes(nnodes,'nodelist');
+             makeTiers(nnodes,ntiers);
+             makeNodes(nnodes,'nodelist2','bw');
+             makeTierDesc1(ntiers);
+             makeTierDesc2(ntiers);
+             makeTierDesc3(ntiers);
+             makeTierDesc4(ntiers);
+             makeBWLists(nnodes);
+}
+
+
+//Function to make the NodeList. It is similar to the above function.
+function makeNodeList(nnodes,nlist) {
+               var element1 = document.createElement('div');
+               var newheight = 45*nnodes + 40;
+               newheight = newheight+'px';                  
+               element1.setAttribute('id',nlist);
+               element1.setAttribute('ondrop','drop(this, event)');
+               element1.setAttribute('ondragenter','return false');
+               element1.setAttribute('ondragover','return false');
+               element1.style.height=(newheight);
+               element1.innerHTML = "Nodes<br>";
+               document.getElementById('tier_box').appendChild(element1);
+}
+
+
+//This is the function that makes the nodes. It is called when the
+// page loads. The nodes are placed in the "nodelist" div.
+//Will need to mofidy this function to pass it a list of the node
+// names. The inner html is what is used in the later functions
+// that make the tier list, banlist, and white list.
+function makeNodes(nnodes,nlist,suffix) {
+
+<?php $xyz=1;
+$nm=$dir."$keyval"."name.txt";
+
+$namelist=file_get_contents("$nm");
+$str_arrname=array();
+$str_arrname=explode("\n",$namelist);
+$dataname=array();
+$dataname=explode("\t",$str_arrname[0]);
+             for ($i=1;$i<=$node;$i++){
+$ii=$i-1;
+$npr=trim($dataname[$ii]);
+?>             
+               i="<?php print($i);?>";
+               var newname = 'node'+i;
+               var element1 = document.createElement('div');
+               element1.setAttribute('draggable','true');
+               element1.setAttribute('class','node1');
+               element1.setAttribute('ondragstart','drag(this, event)');
+               element1.setAttribute('id',newname+suffix);
+               element1.setAttribute('ondragover','return false');
+               element1.innerHTML = "<?php print($npr);?>";
+               document.getElementById(nlist).appendChild(element1);
+           <?php  }
+          ?>
+     }
+
+
+//Function to make the Tiers. It is similar to the above function.
+function makeTiers(nnodes,ntiers) {
+           for (i=1;i<=ntiers;i++){
+               var newname = 'Tier'+i;
+               var element1 = document.createElement('div');
+               //var newpos = i*205;
+               //newpos = 'left: '+newpos+'px';
+               var newheight = nnodes*45 + 40;
+               newheight = newheight+'px';
+               //var newstyle = newpos + newheight;         
+               element1.setAttribute('class','tier');
+               element1.setAttribute('id',newname);
+               element1.setAttribute('ondrop','drop(this, event)');
+               element1.setAttribute('ondragenter','return false');
+               element1.setAttribute('ondragover','return false');
+               //element1.setAttribute('style',newpos);
+               element1.style.height=(newheight);
+               element1.innerHTML = newname +"<br>";
+               document.getElementById('tiers').appendChild(element1);
+            }
+               var newwidth = ntiers*205 + 20;
+               newwidth = newwidth+'px';
+               document.getElementById('tiers').style.width=newwidth;
+}
+
+
+
+function makeTierDesc1(ntiers) {
+               var element1 = document.createElement('div');
+               var newheight = '20px';
+               var newwidth = '220px';
+               element1.setAttribute('id','int_box1_first');
+               element1.setAttribute('class','int');
+               element1.style.height=(newheight);
+               element1.style.width=(newwidth);
+               //element1.innerHTML = "st<br>";
+               document.getElementById('int_box1').appendChild(element1);
+	       for (i=1;i<=ntiers;i++) {
+		 var newname = 'int_box1'+i;
+                 var newheight = '20px';
+                 var newwidth = '205px';
+                 //var newwidth = ntiers*65 + 20;
+                 //newwidth = newwidth+'px';
+                 var element1 = document.createElement('div');
+                 element1.setAttribute('id',newname);
+                 element1.setAttribute('class','int');
+                 element1.innerHTML = "&nbsp&nbspTier"+i+"<br>";
+		 element1.style.height=(newheight);
+		 element1.style.width=(newwidth);
+		 document.getElementById('int_box1').appendChild(element1);
+	       }
+                 
+}
+function makeTierDesc2(ntiers) {
+               var element1 = document.createElement('div');
+               var newheight = '50px';
+               var newwidth = '220px';
+               element1.setAttribute('id','int_box2_first');
+               element1.setAttribute('class','int1');
+               element1.style.height=(newheight);
+               element1.style.width=(newwidth);
+               element1.innerHTML = "Are within tier <br>interactions allowed?<br>";
+               document.getElementById('int_box2').appendChild(element1);
+	       for (i=1;i<=ntiers;i++) {
+		 var newname = 'int_box2'+i;
+                 var newheight = '50px';
+                 var newwidth = '205px';
+                 //var newwidth = ntiers*65 + 20;
+                 //newwidth = newwidth+'px';
+                 var element1 = document.createElement('div');
+                 element1.setAttribute('id',newname);
+                 element1.setAttribute('class','int');
+                 element1.innerHTML = "<br>";
+		 element1.style.height=(newheight);
+		 element1.style.width=(newwidth);
+		 document.getElementById('int_box2').appendChild(element1);
+                       //create form to hold yes/no radio boxes
+                       var form1 = document.createElement('form');
+                       //form1.innerHTML = "Allow edges between nodes in Tier"+i+"?<br>";
+                       var radio_yes = document.createElement('input');
+                       radio_yes.setAttribute('type','radio');
+                       radio_yes.setAttribute('name',"r_yes_no_"+newname);
+                       radio_yes.setAttribute('id',"r_yes_"+newname);
+
+                       radio_yes.value = "r_yes_"+newname;
+                       radio_yes.setAttribute('checked','checked');
+                       form1.appendChild(radio_yes);
+                       var yes_label = document.createElement('label');
+                       yes_label.setAttribute('for',radio_yes.id);
+                       yes_label.innerHTML = "Yes&nbsp&nbsp&nbsp&nbsp&nbsp";
+                       form1.appendChild(yes_label);
+                       var radio_no = document.createElement('input');
+                       radio_no.setAttribute('type','radio');
+                       radio_no.setAttribute('name',"r_yes_no_"+newname);
+                       radio_no.setAttribute('id',"r_no_"+newname);
+                       radio_no.value = "r_no_"+newname;
+                       form1.appendChild(radio_no);
+                       var no_label = document.createElement('label');
+                       no_label.setAttribute('for',radio_no.id);
+                       no_label.innerHTML = "No<br>";
+                       form1.appendChild(no_label);
+                       element1.appendChild(form1);
+                     //  alert(radio_yes.value);
+                     //  alert(radio_yes.checked);
+                     //  alert(radio_no.value); 
+                     //  alert(radio_no.checked);
+	       }
+                 
+}
+
+function makeTierDesc3(ntiers) {
+               var element1 = document.createElement('div');
+               var newwidth = '220px';
+               var newheight = ntiers*10 + 25;
+               newheight = newheight + 'px'; 
+               //var newheight = '50px';
+               //var newwidth = '250px';
+               element1.setAttribute('id','int_box3_first');
+               element1.setAttribute('class','int1');
+               element1.style.height=(newheight);
+               element1.style.width=(newwidth);
+               element1.innerHTML = "Which tiers contain nodes that <br>can be the parents of this tier?<br>";
+               document.getElementById('int_box3').appendChild(element1);
+	       for (i=1;i<=ntiers;i++) {
+		 var newname = 'int_box3'+i;
+                 //var newheight = '50px';
+                 var newwidth = '205px';
+                 //newwidth = newwidth+'px';
+                 var element1 = document.createElement('div');
+                 element1.setAttribute('id',newname);
+                 element1.setAttribute('class','int');
+                 element1.innerHTML = "<br>";
+		 element1.style.height=(newheight);
+		 element1.style.width=(newwidth);
+		 document.getElementById('int_box3').appendChild(element1);
+                       //create form to hold allowed parents
+                       var form2 = document.createElement('form');
+                       //form2.innerHTML = "Which tiers can be the "+
+                       //    "parents of the nodes in Tier"+i+"?<br>";
+		       var k = 0;
+                       for (j=1;j<=ntiers;j++) {
+                          if (j!=i) {
+			    k = k + 1;
+                             var pbox = document.createElement('input');
+                             pbox.setAttribute('type','checkbox');
+                            // pbox.setAttribute('name',"par_"+i);
+                             pbox.setAttribute('name',"par_"+i+"_"+j);
+                             pbox.setAttribute('id',"par_"+i+"_"+j);   
+                             pbox.value = "par_"+i+"_"+j;
+                             if (j<i) {
+                                pbox.setAttribute('checked','checked');
+                             }
+                             var plabel = document.createElement('label');
+                             plabel.setAttribute('for',pbox.id);
+                             if (k%2 == 0) {
+                             plabel.innerHTML = "Tier"+j+"&nbsp&nbsp<br>";
+                             } else {
+                             plabel.innerHTML = "Tier"+j+"&nbsp&nbsp";
+                             }
+                             form2.appendChild(pbox);
+                             form2.appendChild(plabel);  
+                           }
+                        }
+                       element1.appendChild(form2);
+	       }
+}
+
+function makeTierDesc4(ntiers) {
+               var element1 = document.createElement('div');
+               //var newheight = '50px';
+               var newwidth = '220px';
+               var newheight = ntiers*10 + 25;
+               newheight = newheight + 'px'; 
+               element1.setAttribute('id','int_box4_first');
+               element1.setAttribute('class','int1');
+               element1.style.height=(newheight);
+               element1.style.width=(newwidth);
+               element1.innerHTML = "Which tiers contain nodes that<br> can be the children of this tier?<br>";
+               document.getElementById('int_box4').appendChild(element1);
+	       for (i=1;i<=ntiers;i++) {
+		 var newname = 'int_box4'+i;
+                 //var newheight = '50px';
+                 //var newwidth = ntiers*65 + 20;
+                 var newwidth = '205px';
+                 var element1 = document.createElement('div');
+                 element1.setAttribute('id',newname);
+                 element1.setAttribute('class','int');
+                 element1.innerHTML = "<br>";
+		 element1.style.height=(newheight);
+		 element1.style.width=(newwidth);
+		 document.getElementById('int_box4').appendChild(element1);
+                       //create form to hold allowed children
+                       var form3 = document.createElement('form');
+                       //form3.innerHTML = "Nodes in which tiers can be <br>the children of this tier?<br>";
+                       var k = 0;
+                       for (j=1;j<=ntiers;j++) {
+                          if (j!=i) {
+			     k = k + 1;
+                             var cbox = document.createElement('input');
+                             cbox.setAttribute('type','checkbox');
+                             //cbox.setAttribute('name',"child_"+i);
+                             cbox.setAttribute('name',"child_"+i+"_"+j);
+                             cbox.setAttribute('id',"child_"+i+"_"+j);
+
+                             cbox.value = "child_"+i+"_"+j;
+                             if (j>i) {
+                                cbox.setAttribute('checked','checked');
+                             }
+                             var clabel = document.createElement('label');
+                             clabel.setAttribute('for',cbox.id);
+                             if (k%2 == 0) {
+                                clabel.innerHTML = "Tier"+j+"&nbsp&nbsp<br>";
+			      } 
+			       else 
+                              {
+                               clabel.innerHTML = "Tier"+j+"&nbsp&nbsp";
+			      }
+                             form3.appendChild(cbox);
+                             form3.appendChild(clabel);  
+                           }
+                        }
+                       element1.appendChild(form3);
+	       }
+}
+
+
+
+//Old function to make section of page that allows for tier description.
+//Replaced by the four functions above.
+function makeTierDesc(ntiers) {
+                for (i=1;i<=ntiers;i++) {
+                       //var i = 2;
+                       var newname = 'desc_tier'+i;
+                       
+                       //create the outer division to hold the other boxes
+                       var out_div = document.createElement('div');
+                       out_div.setAttribute('id',newname);
+                       if (i==1) {
+                             out_div.innerHTML = "Tier"+i+"<br>";
+                       } else {
+                              out_div.innerHTML = "<br><br>Tier"+i+"<br>";
+                       }
+                       document.getElementById('outer_tier_desc').appendChild(out_div);
+
+                       //create form to hold yes/no radio boxes
+                       var form1 = document.createElement('form');
+                       form1.innerHTML = "Allow edges between nodes in Tier"+i+"?<br>";
+                       var radio_yes = document.createElement('input');
+                       radio_yes.setAttribute('type','radio');
+                       radio_yes.setAttribute('name',"r_yes_no_"+newname);
+                       radio_yes.setAttribute('id',"r_yes_"+newname);
+
+                       radio_yes.value = "r_yes_"+newname;
+                       radio_yes.setAttribute('checked','checked');
+                       form1.appendChild(radio_yes);
+                       var yes_label = document.createElement('label');
+                       yes_label.setAttribute('for',radio_yes.id);
+                       yes_label.innerHTML = "Yes    ";
+                       form1.appendChild(yes_label);
+                       var radio_no = document.createElement('input');
+                       radio_no.setAttribute('type','radio');
+                       radio_no.setAttribute('name',"r_yes_no_"+newname);
+                       radio_no.setAttribute('id',"r_no_"+newname);
+                       radio_no.value = "r_no_"+newname;
+                       form1.appendChild(radio_no);
+                       var no_label = document.createElement('label');
+                       no_label.setAttribute('for',radio_no.id);
+                       no_label.innerHTML = "No<br>";
+                       form1.appendChild(no_label);
+                       out_div.appendChild(form1);
+                     //  alert(radio_yes.value);
+                     //  alert(radio_yes.checked);
+                     //  alert(radio_no.value); 
+                     //  alert(radio_no.checked);
+
+
+                       //create form to hold allowed parents
+                       var form2 = document.createElement('form');
+                       form2.innerHTML = "Which tiers can be the "+
+                           "parents of the nodes in Tier"+i+"?<br>";
+                       for (j=1;j<=ntiers;j++) {
+                          if (j!=i) {
+                             var pbox = document.createElement('input');
+                             pbox.setAttribute('type','checkbox');
+                            // pbox.setAttribute('name',"par_"+i);
+                             pbox.setAttribute('name',"par_"+i+"_"+j);
+                             pbox.setAttribute('id',"par_"+i+"_"+j);   
+                             pbox.value = "par_"+i+"_"+j;
+                             if (j<i) {
+                                pbox.setAttribute('checked','checked');
+                             }
+                             var plabel = document.createElement('label');
+                             plabel.setAttribute('for',pbox.id);
+                             plabel.innerHTML = "Tier"+j;
+                             form2.appendChild(pbox);
+                             form2.appendChild(plabel);  
+                           }
+                        }
+                       out_div.appendChild(form2);
+            
+                    //   alert(pbox.value);
+                   //    alert(pbox.checked);
+                      
+   
+
+                       //create form to hold allowed children
+                       var form3 = document.createElement('form');
+                       form3.innerHTML = "Which tiers can be the "+
+                           "children of the nodes in Tier"+i+"?<br>";
+                       for (j=1;j<=ntiers;j++) {
+                          if (j!=i) {
+                             var cbox = document.createElement('input');
+                             cbox.setAttribute('type','checkbox');
+                             //cbox.setAttribute('name',"child_"+i);
+                             cbox.setAttribute('name',"child_"+i+"_"+j);
+                             cbox.setAttribute('id',"child_"+i+"_"+j);
+
+                             cbox.value = "child_"+i+"_"+j;
+                             if (j>i) {
+                                cbox.setAttribute('checked','checked');
+                             }
+                             var clabel = document.createElement('label');
+                             clabel.setAttribute('for',cbox.id);
+                             clabel.innerHTML = "Tier"+j;
+                             form3.appendChild(cbox);
+                             form3.appendChild(clabel);  
+                           }
+                        }
+                       out_div.appendChild(form3);
+                    //var break = document.createElement('div');
+                    //break.innerHTML = "<br>";
+                    //out_div.appendChild(break);
+                    //out_div.appendChild(break);
+                     //  alert(cbox.value);
+                      // alert(cbox.checked);
+
+                  }
+}
+
+//Function to give the divs for the ban and white lists the correct
+// dimensions.
+function makeBWLists(nnodes) {
+                var newheight = 45*nnodes + 40;
+                var nlheight = newheight+'px';
+                document.getElementById('nodelist2').style.height=nlheight;
+                var inheight = newheight*2; 
+                var outheight = inheight + 50;
+                inheight=inheight+'px';
+                outheight = outheight+'px';
+                document.getElementById('ban_outer').style.height=outheight;
+                document.getElementById('white_outer').style.height=outheight;
+                document.getElementById('ban_from').style.height=inheight;
+                document.getElementById('ban_to').style.height=inheight;
+                document.getElementById('white_from').style.height=inheight;
+                document.getElementById('white_to').style.height=inheight;
+          
+}
+
+
+//Functions that get the locations of the nodes to group the
+// nodes into tiers and make ban and white lists.
+//Will probably need to add a function to get the tier description information.
+//Might be able to do that with just php though?
+function getNodesInTiers(ntiers) {
+                output = ntiers+",\n";
+                for (i=1;i<=ntiers;i++){
+                var newname = 'Tier'+i;
+                children = document.getElementById(newname).childNodes;
+                temp = children.length - 2;
+                temp = newname + ",\t" +temp+ ",\t"
+                for (j=2;j<children.length;j++){
+                temp = temp + children[j].innerHTML + ",\t"
+                }
+                output = output + temp +"\n"
+                }
+                
+                
+                return output;
+                
+               // window.open("http://compbio.uthsc.edu/BNServer/tier.php?tier="+output,"Ratting","width=950,height=270,0,status=0,");
+                
+}
+
+function getNodesInList(from_div,to_div) {
+                children_from = document.getElementById(from_div).childNodes;
+                children_to = document.getElementById(to_div).childNodes;
+                if(children_from.length == children_to.length){
+                    temp = "";                
+                    for (i=2;i<children_from.length;i++){
+                    temp = temp+children_from[i].innerHTML;
+                    temp = temp+",\t"+children_to[i].innerHTML+",\n";
+                    }
+                  
+    
+
+                 }
+                 else 
+                 {
+                   alert('Error in node list');
+                   temp="";
+                 }
+               return temp;
+}
+
+
+//Functions that get the description of the tiers. 
+function getDescribeTiers(ntiers) {
+              output = "";
+              for (i=1;i<=ntiers;i++) {
+               temp="";
+               var newname = 'int_box2'+i;
+                
+               var temp_id_yes="r_yes_"+newname;
+               var temp_id_no="r_no_"+newname;
+               
+                temp_yes = document.getElementById(temp_id_yes);
+                temp_no = document.getElementById(temp_id_no);
+
+               // temp = temp + temp_yes.value + ",\t"
+                temp = temp + temp_yes.checked + ",\t"
+
+               // temp = temp + temp_no.value + ",\t"
+                temp = temp + temp_no.checked + ",\t"
+ 
+                for (j=1;j<=ntiers;j++) {
+                    if(j!=i)
+                    {
+                      var pbox_id="par_"+i+"_"+j;
+                      var cbox_id="child_"+i+"_"+j;
+                      temp_p = document.getElementById(pbox_id);
+                      temp_c = document.getElementById(cbox_id); 
+  
+                      temp = temp + temp_p.checked + ",\t"
+
+                      temp = temp + temp_c.checked + ",\t"
+
+                      
+                     }
+                }   
+               // alert(temp); 
+                
+                output = output + temp +"\n"
+               
+}
+              
+
+              //  window.open("http://compbio.uthsc.edu/BNServer/tierdescription.php?tierdesc="+output,"Ratting","width=950,height=270,0,status=0,");
+              return output;
+                
+}
+
+
+//Combined all three function together and then execute structure learning
+
+function getcombineDescription(ntiers,ban_from,ban_to,white_from,white_to,keyv)
+{
+  var tier=getNodesInTiers(ntiers);
+  var tierdesc=getDescribeTiers(ntiers);
+  var ban=getNodesInList(ban_from,ban_to);
+  var white=getNodesInList(white_from,white_to);
+  window.open("tier_description_processing_gom.php?tier="+tier+"&tierdesc="+tierdesc+"&ban="+ban+"&white="+white +"&My_key="+keyv,'_self',false);
+}
+
+function clearBWLists()
+{
+  var element = document.getElementById('ban_from');
+  var children = element.childNodes;
+  while (children.length>2) {
+    element.removeChild(element.lastChild);
+    var children = element.childNodes;
+  }
+  var element = document.getElementById('ban_to');
+  var children = element.childNodes;
+  while (children.length>2) {
+    element.removeChild(element.lastChild);
+    var children = element.childNodes;
+  }
+  var element = document.getElementById('white_from');
+  var children = element.childNodes;
+  while (children.length>2) {
+    element.removeChild(element.lastChild);
+    var children = element.childNodes;
+  }
+  var element = document.getElementById('white_to');
+  var children = element.childNodes;
+  while (children.length>2) {
+    element.removeChild(element.lastChild);
+    var children = element.childNodes;
+  }
+}
+
+
+
+
+
+</script> 
+</head> 
+
+
+<script type="text/javascript">
+     var nnodes =<?php print($node);?>;
+     var ntiers = <?php print($tier_number);?>;
+</script>
+
+<body onload="loadFunction(nnodes,ntiers)">
+</br>
+        <p><h3>2. Assign variables to tiers:<br></h3>
+         </p>
+        <br>
+        <div id="tier_box">
+        <div id="tiers"></div>
+       
+       </div>
+
+           
+       <div id="outer_tier_desc1">
+       <p><h3>3. Define interactions allowed between tiers:<br></h3> 
+       </p>
+       <br>
+       <div id="int_box1">
+       </div>
+       <br>
+       <div id="int_box2">
+       </div>
+       <br>
+       <div id="int_box3">
+       </div>
+       <br>
+       <div id="int_box4">
+       </div>
+       </div>
+       <br>
+       <br>
+       <br>
+           
+        <div id="outer_box_lists">
+       <p><h3>4. Specify additional constraints:<br></h3>
+       </p>         
+       <br>
+       <div><input type="button" value="Clear lists of banned and required edges" onClick="clearBWLists()"/></div><br>
+        <div id="nodelist2" ondrop="return false"
+        ondragcenter="return false" ondragover="return false" >Nodes<br>
+        </div>
+         
+        <div id="ban_outer">Banned edges<br>
+        <div id="ban_from" class="tier" ondrop="return dropCopy(event)"
+        ondragenter="return false" ondragover="return false">From<br></div>
+        <div id="ban_to" class="tier" ondrop="return dropCopy(event)"
+        ondragenter="return false" ondragover="return false">To<br></div>
+        </div>
+        <div id="white_outer">Required edges<br>
+        <div id="white_from" class="tier" ondrop="return dropCopy(event)"
+        ondragenter="return false" ondragover="return false">From<br></div>
+        <div id="white_to" class="tier" ondrop="return dropCopy(event)"
+        ondragenter="return false" ondragover="return false">To<br></div>
+        </div>
+        </div>
+       
+        <br>
+        <br>
+   
+        
+
+</body> 
+</div>
+</html>
+
diff --git a/sourcecodes/data/Backupfiles/evidencemodified b/sourcecodes/data/Backupfiles/evidencemodified
new file mode 100644
index 00000000..9b3f7563
--- /dev/null
+++ b/sourcecodes/data/Backupfiles/evidencemodified
Binary files differdiff --git a/sourcecodes/data/Backupfiles/initialstructure b/sourcecodes/data/Backupfiles/initialstructure
new file mode 100644
index 00000000..9ecf1bc7
--- /dev/null
+++ b/sourcecodes/data/Backupfiles/initialstructure
Binary files differdiff --git a/sourcecodes/data/Backupfiles/newintervention b/sourcecodes/data/Backupfiles/newintervention
new file mode 100644
index 00000000..d818a943
--- /dev/null
+++ b/sourcecodes/data/Backupfiles/newintervention
Binary files differdiff --git a/sourcecodes/data/Backupfiles/temp_evidence_file b/sourcecodes/data/Backupfiles/temp_evidence_file
new file mode 100644
index 00000000..b687ceaf
--- /dev/null
+++ b/sourcecodes/data/Backupfiles/temp_evidence_file
@@ -0,0 +1,36 @@
+#!/bin/sh
+# script for execution of deployed applications
+#
+# Sets up the MCR environment for the current $ARCH and executes 
+# the specified command.
+#
+exe_name=$0
+exe_dir=`dirname "$0"`
+echo "------------------------------------------"
+if [ "x$1" = "x" ]; then
+  echo Usage:
+  echo    $0 \<deployedMCRroot\> args
+else
+  echo Setting up environment variables
+  MCRROOT="$1"
+  echo ---
+  LD_LIBRARY_PATH=.:${MCRROOT}/runtime/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/bin/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/sys/os/glnxa64;
+	MCRJRE=${MCRROOT}/sys/java/jre/glnxa64/jre/lib/amd64 ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/native_threads ; 
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/server ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/client ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE} ;  
+  XAPPLRESDIR=${MCRROOT}/X11/app-defaults ;
+  export LD_LIBRARY_PATH;
+  export XAPPLRESDIR;
+  echo LD_LIBRARY_PATH is ${LD_LIBRARY_PATH};
+  shift 1
+  args=
+  while [ $# -gt 0 ]; do
+      token=`echo "$1" | sed 's/ /\\\\ /g'`   # Add blackslash before each blank
+      args="${args} ${token}" 
+      shift
+  done
+  "${exe_dir}"/evidencemodified 
\ No newline at end of file
diff --git a/sourcecodes/data/Backupfiles/temp_intervention_file b/sourcecodes/data/Backupfiles/temp_intervention_file
new file mode 100644
index 00000000..cdf5ce0f
--- /dev/null
+++ b/sourcecodes/data/Backupfiles/temp_intervention_file
@@ -0,0 +1,36 @@
+#!/bin/sh
+# script for execution of deployed applications
+#
+# Sets up the MCR environment for the current $ARCH and executes 
+# the specified command.
+#
+exe_name=$0
+exe_dir=`dirname "$0"`
+echo "------------------------------------------"
+if [ "x$1" = "x" ]; then
+  echo Usage:
+  echo    $0 \<deployedMCRroot\> args
+else
+  echo Setting up environment variables
+  MCRROOT="$1"
+  echo ---
+  LD_LIBRARY_PATH=.:${MCRROOT}/runtime/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/bin/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/sys/os/glnxa64;
+	MCRJRE=${MCRROOT}/sys/java/jre/glnxa64/jre/lib/amd64 ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/native_threads ; 
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/server ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/client ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE} ;  
+  XAPPLRESDIR=${MCRROOT}/X11/app-defaults ;
+  export LD_LIBRARY_PATH;
+  export XAPPLRESDIR;
+  echo LD_LIBRARY_PATH is ${LD_LIBRARY_PATH};
+  shift 1
+  args=
+  while [ $# -gt 0 ]; do
+      token=`echo "$1" | sed 's/ /\\\\ /g'`   # Add blackslash before each blank
+      args="${args} ${token}" 
+      shift
+  done
+  "${exe_dir}"/newintervention 
\ No newline at end of file
diff --git a/sourcecodes/data/Backupfiles/temp_shell_file_initial_structure b/sourcecodes/data/Backupfiles/temp_shell_file_initial_structure
new file mode 100644
index 00000000..5d1c323d
--- /dev/null
+++ b/sourcecodes/data/Backupfiles/temp_shell_file_initial_structure
@@ -0,0 +1,36 @@
+#!/bin/sh
+# script for execution of deployed applications
+#
+# Sets up the MCR environment for the current $ARCH and executes 
+# the specified command.
+#
+exe_name=$0
+exe_dir=`dirname "$0"`
+echo "------------------------------------------"
+if [ "x$1" = "x" ]; then
+  echo Usage:
+  echo    $0 \<deployedMCRroot\> args
+else
+  echo Setting up environment variables
+  MCRROOT="$1"
+  echo ---
+  LD_LIBRARY_PATH=.:${MCRROOT}/runtime/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/bin/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/sys/os/glnxa64;
+	MCRJRE=${MCRROOT}/sys/java/jre/glnxa64/jre/lib/amd64 ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/native_threads ; 
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/server ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/client ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE} ;  
+  XAPPLRESDIR=${MCRROOT}/X11/app-defaults ;
+  export LD_LIBRARY_PATH;
+  export XAPPLRESDIR;
+  echo LD_LIBRARY_PATH is ${LD_LIBRARY_PATH};
+  shift 1
+  args=
+  while [ $# -gt 0 ]; do
+      token=`echo "$1" | sed 's/ /\\\\ /g'`   # Add blackslash before each blank
+      args="${args} ${token}" 
+      shift
+  done
+  "${exe_dir}"/initialstructure 
\ No newline at end of file
diff --git a/sourcecodes/data/evidencemodified b/sourcecodes/data/evidencemodified
new file mode 100644
index 00000000..9b3f7563
--- /dev/null
+++ b/sourcecodes/data/evidencemodified
Binary files differdiff --git a/sourcecodes/data/example1/Bqxban.txt b/sourcecodes/data/example1/Bqxban.txt
new file mode 100644
index 00000000..83e81b8b
--- /dev/null
+++ b/sourcecodes/data/example1/Bqxban.txt
@@ -0,0 +1 @@
+From	To
diff --git a/sourcecodes/data/example1/Bqxcontinuous_input.txt b/sourcecodes/data/example1/Bqxcontinuous_input.txt
new file mode 100644
index 00000000..5e296c45
--- /dev/null
+++ b/sourcecodes/data/example1/Bqxcontinuous_input.txt
@@ -0,0 +1,203 @@
+Geno1	Geno2	Trait1	Trait2	Trait3	Trait4	Trait5	Trait6
+2	2	1	1	1	1	1	1
+2	2	0.46259	1.2692	-1.3164	-0.44096	0.5929	-0.75422
+1	1	-0.10011	-0.88834	1.6407	0.99972	0.31288	0.65602
+1	1	-1.0533	-0.55296	1.2715	1.3686	-0.19153	0.37361
+1	2	0.042371	0.13573	-0.72659	-0.66133	0.43157	-1.6715
+1	2	-0.68686	-1.6152	-0.95019	-1.2239	0.12319	-0.79155
+1	1	-0.4558	0.090877	0.94224	1.2354	-0.36356	0.34937
+1	1	0.237	-0.49002	1.8939	1.4399	0.033059	1.3229
+1	2	0.070265	0.22547	-1.4903	-0.069341	-0.16148	-0.01449
+1	1	-0.69146	-0.43461	1.1501	0.21205	-0.18087	0.32746
+1	1	0.31535	-0.9858	0.57816	0.35924	0.12866	1.0553
+2	1	1.2718	0.39314	0.6669	0.90002	-0.30206	1.3376
+1	1	1.1871	-0.45611	0.87227	0.31014	-0.092846	0.81278
+2	1	-1.0168	-0.44286	1.6933	0.72968	0.038808	0.81906
+2	2	-0.25313	0.52468	0.02823	-0.20984	-0.075809	-1.3591
+1	2	-0.58108	-0.3967	-0.11925	-0.61288	0.46778	0.090941
+1	2	-0.88043	-0.28187	-1.1645	-1.2543	-0.28951	-1.039
+1	2	0.54121	0.24395	-1.0043	-1.4483	-0.19839	-2.5407
+2	1	0.47375	1.1319	0.68553	1.035	0.44043	1.3011
+2	1	0.57785	0.69093	1.5941	1.6735	0.19981	0.50708
+1	2	-0.43989	0.0024131	-1.5405	-1.2304	-0.15382	-1.1058
+2	1	0.38035	-0.063535	1.1606	1.3124	-0.38043	0.6277
+1	2	0.70114	-0.41044	-0.39767	-1.5424	0.27477	-0.76183
+1	1	-0.9406	-0.20526	1.3302	1.097	0.16006	1.2988
+1	2	0.52122	0.064793	-0.031492	0.21696	-0.41979	-0.79123
+1	2	-0.53387	-0.71043	-0.52344	-1.5584	-0.09538	-1.5781
+1	1	0.49563	-0.58126	0.7747	1.274	0.19196	0.10624
+2	2	1.1499	1.879	0.43595	0.73474	0.045381	-0.88645
+1	2	0.40705	-0.37647	-0.19815	-1.5366	0.37167	-0.10553
+2	2	0.62526	0.043371	-0.64449	-0.44076	-0.4318	-0.91807
+1	1	-0.61788	-0.62414	0.3169	0.85091	-0.10135	0.79065
+1	1	0.18491	-1.5226	1.1149	0.75046	0.25948	0.42431
+2	2	0.86063	0.92883	-1.1584	-0.099858	-0.55095	-0.064129
+1	2	-0.28946	0.0057533	-0.95703	-0.44018	0.084268	-0.23718
+1	1	-0.073096	0.16452	1.4444	1.1452	0.46025	0.30452
+1	1	0.15637	-0.73137	0.585	-0.046911	0.43881	1.2888
+1	2	0.081142	-0.63691	-0.14883	0.66593	-0.13479	-0.22207
+1	1	0.10876	-0.23383	1.8314	1.3282	0.4362	0.90139
+1	2	-1.0582	-0.97152	-0.57118	-1.2617	0.17115	-0.060679
+2	2	-0.47421	-0.56819	-0.38775	0.035215	0.51982	-1.6309
+2	2	-0.10242	0.8127	0.41773	-1.1308	-0.30719	-0.80758
+1	1	-0.083462	-0.4565	1.1556	0.3299	0.087362	0.31349
+1	2	-0.98158	0.01727	-1.3281	-1.4474	0.54555	-0.10096
+1	1	-0.80604	-0.19415	1.4986	1.3386	-0.16367	0.68271
+1	1	0.80082	-0.57853	1.0716	0.94015	-0.54114	0.032172
+2	2	2.0456	0.97954	-0.45536	-0.14332	-0.25819	-1.0833
+1	1	-0.30148	0.20623	0.64194	0.76414	-0.59067	0.64326
+1	1	-0.55625	-0.26957	1.8447	1.6568	-0.38077	0.58831
+1	2	0.11898	0.80706	-0.025844	-0.57984	-0.23395	-1.1554
+1	2	-0.095497	-1.0637	-0.92583	-0.57928	0.23695	-0.42992
+2	2	0.066154	0.73037	-0.73622	-0.57047	0.39169	0.40928
+1	1	0.81522	0.11381	0.68971	0.29219	0.037792	0.81502
+1	1	-0.65356	-0.20182	0.92089	0.92298	-0.5417	0.49215
+1	1	-0.90826	-0.10979	1.3847	0.75954	-0.20255	0.32975
+1	2	-0.25671	-1.1903	-1.4241	-1.6058	-0.062549	-1.3981
+2	2	-1.8038	-1.4801	-0.94121	-1.6244	0.4817	-0.0029469
+1	2	0.12651	0.028719	-1.5818	-1.0266	0.19779	-0.36357
+1	1	-1.0658	-0.58443	0.68956	0.35467	0.11177	1.5243
+1	2	0.14729	-0.15111	-0.027639	-0.2899	0.11533	-0.60305
+2	2	-0.76889	0.87161	-0.83556	-1.1777	-0.21878	-0.98527
+2	2	0.12252	0.49068	-0.2557	-1.5816	0.25332	-0.78715
+1	1	-0.40287	0.26456	0.62208	0.60909	0.36074	0.092703
+2	1	-0.78301	1.4641	1.3162	1.9448	-0.10841	0.9618
+1	2	-0.25018	-0.32797	-1.113	-1.6123	0.6272	-1.2718
+2	1	0.15804	-0.18147	2.4571	0.59504	-0.34056	0.8691
+2	1	-0.582	0.25738	1.4075	0.92251	-0.40889	0.66381
+1	1	-0.26827	0.58632	0.51883	1.5745	-0.13818	1.0526
+1	2	0.13453	0.18218	-0.51676	-0.54166	-0.36636	-1.206
+2	1	1.1502	0.36164	1.9983	1.0809	0.11272	0.67683
+1	2	0.27812	0.46559	-1.6109	-0.91039	0.3803	-0.71802
+2	1	0.15292	0.61921	0.71009	1.3063	-0.35819	0.8661
+1	2	0.19902	0.48986	-1.4026	-0.8495	0.47158	0.0622
+2	1	0.4838	1.1096	1.4392	1.1438	0.34739	0.084004
+1	1	-0.63609	-0.35105	0.63581	1.1939	-0.062938	0.91353
+1	2	0.64203	-0.5095	-1.7792	-0.88803	0.43482	-0.66314
+1	1	-0.18434	-0.48157	0.69942	0.56942	-0.019967	0.50506
+1	1	0.10168	-1.0928	1.2144	0.28313	0.22159	0.54058
+1	1	-0.18578	-0.45336	1.5468	0.99679	0.11821	1.0476
+1	2	-0.60607	-1.1275	-0.90963	-0.69014	-0.33163	-1.2734
+1	1	-0.35353	-0.42708	0.78989	0.14094	-0.056632	0.80598
+1	1	-0.020221	-1.1235	1.9782	-0.041281	0.19857	1.2488
+1	1	1.2346	-0.37121	1.3325	1.1237	-0.027458	1.0044
+2	2	-0.54489	1.6812	-0.59836	-0.012441	0.41243	-0.58835
+2	1	-0.029577	2.1707	1.3285	1.2109	0.29684	0.90646
+2	2	0.70774	1.0606	-1.3996	-0.020914	-0.60955	-1.2187
+2	1	0.07926	0.52862	1.3994	0.54549	0.55303	0.16155
+1	1	0.041856	-0.92023	0.87269	-0.66601	-0.15945	0.1004
+1	2	0.17665	0.31945	-1.7756	-0.60442	0.020525	-1.0625
+1	1	-0.090238	-0.65111	0.56993	-0.4117	-0.19486	-0.18849
+1	2	0.059166	-0.47194	-0.69068	-0.41022	0.25867	-0.057175
+1	2	0.10473	0.66887	0.082035	-0.55975	-0.28439	-1.468
+1	1	-0.20937	-0.36621	0.09609	0.28164	0.24673	-0.11107
+1	2	-1.2678	0.22369	-0.42201	-0.70103	0.075915	-1.3347
+1	2	-0.35467	0.11166	-0.42144	-0.095223	-0.29936	-0.68322
+2	2	0.84875	1.24	-0.81217	0.084034	-0.32224	-1.6241
+2	1	-0.45939	1.3208	0.97993	1.2991	-0.015791	1.487
+1	2	-0.42254	-0.57928	-0.58529	-2.2375	0.51999	-0.79909
+2	1	0.32092	-0.13796	0.67098	0.24639	-0.36066	-0.032948
+1	2	-1.2408	-0.94836	0.026276	-0.37981	-0.02237	-0.38777
+2	2	0.20959	2.1466	-1.7027	-1.3169	-0.16515	-1.046
+2	2	-0.10482	1.3773	-1.2998	-0.014223	0.34065	-0.35362
+1	2	-0.66188	-1.2477	-0.62084	0.27682	0.1674	-0.8918
+1	1	-0.97246	-0.73017	1.3843	1.5549	0.1067	0.85754
+1	1	0.74567	-0.032694	1.1153	0.97318	-0.0033905	0.85059
+2	2	0.29324	-0.090608	-0.4945	-1.0484	-0.14987	-1.0141
+2	1	-0.86818	0.44948	1.8531	0.51896	-0.021141	1.8486
+1	2	0.362	-0.29749	-0.66525	0.21709	-0.15594	-1.4087
+1	2	-0.17675	0.36465	-0.45423	-1.262	0.22968	-1.246
+1	2	-0.34633	-0.16067	-1.2216	-1.3019	-0.040891	-1.2935
+1	2	0.44608	-0.57732	0.25606	-1.1664	0.54705	-0.19859
+1	2	0.45398	-0.55214	-0.33433	-0.085418	-0.10094	-0.48509
+1	2	0.12407	0.022419	-1.0312	-0.47727	0.20924	-1.2961
+1	1	-0.76644	-1.1794	1.2345	0.84756	0.1532	0.77648
+1	2	-0.10329	-0.53768	-0.67677	-0.58708	-0.014634	-0.036347
+1	1	0.2378	0.15372	0.49652	0.29193	0.19047	1.152
+1	2	0.024605	-0.38937	-0.89907	-0.42106	0.16921	-0.80893
+1	2	0.28812	0.26265	-0.94234	-0.88527	-0.49803	0.48254
+1	1	0.85086	0.11783	1.5014	1.2382	0.24441	1.3649
+2	2	0.86172	0.14894	-0.4846	-1.3488	-0.41844	-1.1372
+1	2	0.67971	-0.27488	-0.50687	-0.79153	-0.093399	-1.391
+1	1	-0.91977	-0.66099	0.5801	0.46587	-0.2263	1.43
+1	2	0.88213	-0.48674	-0.42406	-1.2762	0.28981	-1.0813
+2	1	-0.36583	0.51518	1.4491	1.4995	-0.073755	1.1218
+1	1	-0.54006	-0.59443	0.81263	0.65809	-0.15621	1.2508
+2	2	1.2125	-0.012648	-0.92657	-0.81972	-0.1536	-1.0176
+1	2	0.42493	0.34558	-1.7672	-1.3503	-0.045928	0.37449
+1	1	0.17097	-0.86593	-0.13424	1.0257	0.058014	0.91044
+2	1	-1.393	0.5338	1.8514	2.291	0.15305	0.30028
+1	1	-0.58552	-1.5337	1.5133	0.9976	0.64638	1.4428
+1	2	0.046272	-0.56387	-0.86063	-1.0462	0.014457	-1.3038
+1	2	0.34933	-0.16796	-0.27854	-0.27327	-0.0040928	-0.17912
+1	1	-1.0672	0.3979	1.208	0.50111	-0.013978	0.015097
+1	2	0.31052	-0.46723	-1.1237	0.59267	0.30978	-1.0169
+1	2	-0.55337	-0.42776	-0.12612	-0.41838	-0.56558	-0.58189
+2	2	0.3925	0.15644	-0.72963	-0.66601	-0.10837	-0.27787
+1	2	-0.48513	-1.4119	-0.16889	-0.19646	-0.068098	-0.084247
+2	2	0.16692	1.5447	-1.3064	-1.3338	-0.25668	-0.48832
+1	2	-0.36092	0.31518	-0.44815	-1.4019	-0.47505	-0.37187
+1	1	-1.8192	-0.57745	1.1304	0.262	-0.3595	0.58577
+1	1	-0.065383	0.07156	1.4931	2.3215	0.85149	1.4585
+2	1	-1.119	0.70896	1.0498	0.74334	0.75838	1.6107
+2	2	-0.17682	-0.21029	-0.74465	-0.83806	0.10827	-1.2829
+1	2	0.69834	-0.082402	0.64008	-0.83119	-0.26766	0.36961
+2	2	-0.28266	1.1929	-0.15174	0.098554	-0.33989	-0.6376
+2	2	1.5369	1.8434	0.0030761	-0.59703	0.14497	-1.5165
+1	2	0.35023	-0.28475	-0.93594	-1.0937	-0.46614	-2.188
+2	1	0.62308	1.0873	-0.0037182	0.86847	-0.48699	-0.10105
+1	1	-1.0408	-0.99866	2.0799	1.1634	0.092516	0.30401
+1	1	-0.87125	-0.88987	1.0278	1.0157	-0.23725	1.2377
+1	2	-0.020591	-0.03398	-0.024834	-1.3588	-0.045961	-0.89693
+1	1	0.9213	-0.57037	1.044	1.2994	0.046517	0.66563
+1	2	-0.87288	-0.96382	-0.704	-1.2184	0.046903	-0.30008
+1	2	0.77586	-0.34168	-0.09867	-0.37744	-0.24309	-0.13441
+2	1	0.19521	0.67595	1.4533	1.5115	0.19553	0.79596
+2	1	-1.3273	1.0891	1.2544	0.98928	0.045725	0.54963
+2	2	0.59176	0.65915	-0.84578	-0.080229	-0.26961	0.24045
+1	2	-0.66958	-1.042	-1.2138	-0.7612	-0.22775	-0.40062
+1	2	1.1154	-0.57069	-0.6592	-2.1961	-0.013175	0.46007
+1	2	-0.5254	0.0031225	-0.77758	0.8169	0.13224	-0.65572
+2	1	0.24551	1.5078	0.10719	1.1454	0.70578	0.59051
+1	2	0.29875	-0.11455	-1.0497	-0.77881	0.080708	-0.48337
+1	1	-0.1047	0.011628	1.2504	0.41776	-0.20102	1.2252
+1	2	0.44808	-0.8165	-0.080134	-0.49618	0.051011	-0.71722
+2	1	2.0365	1.5592	1.3257	1.2472	-0.47899	0.10943
+1	1	-0.16507	-0.66011	0.98739	0.58519	0.245	-0.43277
+1	2	-0.028366	-0.16961	-1.3266	0.14248	-0.24634	-1.1154
+2	1	0.92842	1.8842	1.3169	1.0358	-0.20988	0.88021
+2	2	0.33158	0.32463	-0.50924	0.40233	0.54391	-0.24309
+1	2	1.2555	0.1928	-0.487	0.048779	-0.23483	-1.477
+2	1	0.75021	0.85943	-0.2323	0.10748	-0.68906	0.84276
+2	2	0.6297	1.7397	-1.6136	-0.43268	-0.21442	-0.77462
+2	1	0.53168	1.0807	1.0853	0.62304	0.44036	0.48087
+1	2	-0.31256	-0.69771	-0.88556	-1.333	0.038614	-1.5744
+1	2	-0.039695	-0.52447	0.91401	-0.93272	0.53434	-0.080746
+2	1	-0.16596	0.56821	0.76008	0.45442	0.10286	0.6539
+1	2	-0.4331	-0.89669	-1.3097	-1.2157	0.1065	-0.8512
+1	2	-0.34708	-0.51457	-1.012	-0.39437	-0.55374	-1.144
+2	2	0.024082	0.7128	-1.3702	-1.4492	-0.10228	-0.59071
+1	2	-0.0037109	-0.68845	-0.649	-0.91581	0.066805	-0.98583
+2	1	0.68706	0.067424	0.87139	0.7938	-0.099645	1.529
+2	2	-0.31183	0.57814	-0.80815	-0.66724	-0.31919	-0.61319
+1	2	-0.11153	-0.6246	-0.27979	-0.18363	0.83639	0.014919
+2	2	0.20406	1.5838	-0.96334	-1.1228	-0.17808	-1.2123
+2	2	-0.1134	0.63358	-0.53321	-0.84276	-0.27657	-0.36992
+1	2	0.25517	0.67006	-0.1349	0.18275	0.40982	-0.62487
+1	1	-1.2684	0.31042	0.91155	0.66143	0.2483	-0.12434
+1	1	-0.97542	-0.85419	0.7663	0.16362	-0.18737	0.67266
+1	2	-0.043882	-0.62746	-0.82816	-0.40626	-0.051048	-0.61297
+1	1	0.59605	-0.45852	1.2962	0.78156	-0.48154	0.17778
+2	2	-0.06266	1.1144	-0.80524	-0.3189	-0.16038	-0.96372
+1	2	-1.1821	1.0798	-1.3407	-0.52643	0.12458	-0.7871
+2	2	0.59446	0.89186	-0.97856	-0.64658	0.2712	-1.5538
+1	2	0.15067	0.41827	-1.0487	-1.0551	0.19143	-1.4537
+1	2	-1.073	0.022587	-1.7088	-1.3777	0.1964	-0.84025
+2	1	0.20928	1.8026	1.2073	2.78	0.15131	0.3448
+1	2	-1.1317	-0.6359	-0.70457	-1.676	-0.22886	-0.58769
+1	1	-0.039428	-0.58746	0.56	0.7896	-0.052581	0.99511
+1	2	0.55023	-0.20403	0.138	-0.70518	0.66927	-0.28861
+2	2	0.57423	1.1886	0.092876	0.025677	-0.41099	-1.2858
+2	2	-0.14179	1.5827	-0.94328	0.7703	-0.43967	-0.50448
+2	2	0.14666	1.0492	-0.0030259	-0.62418	-0.087515	-0.048386
+
diff --git a/sourcecodes/data/example1/Bqxgraphviz.txt b/sourcecodes/data/example1/Bqxgraphviz.txt
new file mode 100644
index 00000000..498a5fd8
--- /dev/null
+++ b/sourcecodes/data/example1/Bqxgraphviz.txt
@@ -0,0 +1,12 @@
+digraph G {
+size="10,10";  ratio = fill;
+node [shape=square,width=1.5];
+Geno1 -> Trait2;
+Geno2 -> Trait3;
+Geno2 -> Trait4;
+Geno2 -> Trait6;
+Trait2 -> Trait1;
+Trait2 -> Trait4;
+Trait3 -> Trait4;
+Trait6 -> Trait3;
+}
\ No newline at end of file
diff --git a/sourcecodes/data/example1/Bqxk.txt b/sourcecodes/data/example1/Bqxk.txt
new file mode 100644
index 00000000..d00491fd
--- /dev/null
+++ b/sourcecodes/data/example1/Bqxk.txt
@@ -0,0 +1 @@
+1
diff --git a/sourcecodes/data/example1/Bqxmap.txt b/sourcecodes/data/example1/Bqxmap.txt
new file mode 100644
index 00000000..032b8928
--- /dev/null
+++ b/sourcecodes/data/example1/Bqxmap.txt
@@ -0,0 +1,8 @@
+Geno1	1	0.473175	1.335000
+Geno2	2	0.496318	1.570000
+Trait1	1	0.668009	-0.023903
+Trait2	1	0.796873	0.038552
+Trait3	2	1.036694	0.068708
+Trait4	1	0.984008	-0.010125
+Trait5	1	0.316471	0.008911
+Trait6	1	0.904542	-0.114267
diff --git a/sourcecodes/data/example1/Bqxmapdata.txt b/sourcecodes/data/example1/Bqxmapdata.txt
new file mode 100644
index 00000000..42b2fd9c
--- /dev/null
+++ b/sourcecodes/data/example1/Bqxmapdata.txt
@@ -0,0 +1 @@
+Trait5	Geno2	Trait6	Trait3	Geno1	Trait2	Trait4	Trait1
diff --git a/sourcecodes/data/example1/Bqxname.txt b/sourcecodes/data/example1/Bqxname.txt
new file mode 100644
index 00000000..8f42b468
--- /dev/null
+++ b/sourcecodes/data/example1/Bqxname.txt
@@ -0,0 +1 @@
+Geno1	Geno2	Trait1	Trait2	Trait3	Trait4	Trait5	Trait6
diff --git a/sourcecodes/data/example1/Bqxnet_figure.txt b/sourcecodes/data/example1/Bqxnet_figure.txt
new file mode 100644
index 00000000..11113895
--- /dev/null
+++ b/sourcecodes/data/example1/Bqxnet_figure.txt
@@ -0,0 +1,652 @@
+8
+1200	1200	
+Trait5	0	0
+Geno2	300	0
+Trait6	220	240
+Trait3	100	480
+Geno1	600	0
+Trait2	620	240
+Trait4	420	720
+Trait1	500	480
+Trait5	1
+250	150
+0
+0
+-3.2055	0.0025
+-3.1368	0.0030
+-3.0681	0.0038
+-2.9994	0.0046
+-2.9308	0.0057
+-2.8621	0.0069
+-2.7934	0.0083
+-2.7247	0.0101
+-2.6561	0.0121
+-2.5874	0.0144
+-2.5187	0.0172
+-2.4500	0.0203
+-2.3813	0.0240
+-2.3127	0.0281
+-2.2440	0.0328
+-2.1753	0.0381
+-2.1066	0.0441
+-2.0379	0.0508
+-1.9693	0.0582
+-1.9006	0.0664
+-1.8319	0.0754
+-1.7632	0.0852
+-1.6945	0.0958
+-1.6259	0.1073
+-1.5572	0.1195
+-1.4885	0.1326
+-1.4198	0.1463
+-1.3511	0.1608
+-1.2825	0.1758
+-1.2138	0.1914
+-1.1451	0.2074
+-1.0764	0.2237
+-1.0078	0.2401
+-0.9391	0.2565
+-0.8704	0.2728
+-0.8017	0.2888
+-0.7330	0.3042
+-0.6644	0.3190
+-0.5957	0.3330
+-0.5270	0.3460
+-0.4583	0.3578
+-0.3896	0.3682
+-0.3210	0.3772
+-0.2523	0.3846
+-0.1836	0.3904
+-0.1149	0.3944
+-0.0462	0.3965
+0.0224	0.3969
+0.0911	0.3953
+0.1598	0.3920
+0.2285	0.3868
+0.2971	0.3800
+0.3658	0.3715
+0.4345	0.3615
+0.5032	0.3502
+0.5719	0.3376
+0.6405	0.3240
+0.7092	0.3095
+0.7779	0.2942
+0.8466	0.2784
+0.9153	0.2622
+0.9839	0.2458
+1.0526	0.2294
+1.1213	0.2130
+1.1900	0.1969
+1.2587	0.1812
+1.3273	0.1659
+1.3960	0.1513
+1.4647	0.1373
+1.5334	0.1240
+1.6021	0.1114
+1.6707	0.0997
+1.7394	0.0888
+1.8081	0.0787
+1.8768	0.0694
+1.9454	0.0610
+2.0141	0.0533
+2.0828	0.0464
+2.1515	0.0401
+2.2202	0.0346
+2.2888	0.0297
+2.3575	0.0253
+2.4262	0.0215
+2.4949	0.0182
+2.5636	0.0153
+2.6322	0.0129
+2.7009	0.0107
+2.7696	0.0089
+2.8383	0.0074
+2.9070	0.0061
+2.9756	0.0050
+3.0443	0.0040
+3.1130	0.0033
+3.1817	0.0026
+3.2503	0.0021
+3.3190	0.0017
+3.3877	0.0014
+3.4564	0.0011
+3.5251	0.0008
+3.5937	0.0007
+3.6624	0.0005
+Geno2	2
+250	150
+0
+3	3	4	7
+1	0.4300
+2	0.5700
+Trait6	1
+250	150
+1	2
+1	4
+-3.6825	0.0005
+-3.6140	0.0006
+-3.5455	0.0008
+-3.4769	0.0010
+-3.4084	0.0013
+-3.3399	0.0016
+-3.2713	0.0020
+-3.2028	0.0025
+-3.1343	0.0031
+-3.0658	0.0038
+-2.9972	0.0046
+-2.9287	0.0057
+-2.8602	0.0069
+-2.7917	0.0084
+-2.7231	0.0101
+-2.6546	0.0121
+-2.5861	0.0145
+-2.5176	0.0172
+-2.4490	0.0204
+-2.3805	0.0240
+-2.3120	0.0282
+-2.2435	0.0329
+-2.1749	0.0382
+-2.1064	0.0441
+-2.0379	0.0508
+-1.9694	0.0582
+-1.9008	0.0664
+-1.8323	0.0753
+-1.7638	0.0851
+-1.6953	0.0957
+-1.6267	0.1071
+-1.5582	0.1193
+-1.4897	0.1323
+-1.4212	0.1461
+-1.3526	0.1605
+-1.2841	0.1755
+-1.2156	0.1910
+-1.1471	0.2069
+-1.0785	0.2232
+-1.0100	0.2396
+-0.9415	0.2560
+-0.8730	0.2722
+-0.8044	0.2881
+-0.7359	0.3036
+-0.6674	0.3184
+-0.5989	0.3324
+-0.5303	0.3454
+-0.4618	0.3572
+-0.3933	0.3677
+-0.3248	0.3768
+-0.2562	0.3843
+-0.1877	0.3901
+-0.1192	0.3942
+-0.0507	0.3965
+0.0179	0.3969
+0.0864	0.3955
+0.1549	0.3923
+0.2234	0.3873
+0.2920	0.3806
+0.3605	0.3722
+0.4290	0.3624
+0.4975	0.3512
+0.5661	0.3387
+0.6346	0.3252
+0.7031	0.3108
+0.7716	0.2956
+0.8402	0.2799
+0.9087	0.2638
+0.9772	0.2474
+1.0457	0.2310
+1.1143	0.2147
+1.1828	0.1986
+1.2513	0.1829
+1.3198	0.1676
+1.3884	0.1529
+1.4569	0.1388
+1.5254	0.1255
+1.5939	0.1129
+1.6625	0.1011
+1.7310	0.0901
+1.7995	0.0799
+1.8680	0.0706
+1.9366	0.0620
+2.0051	0.0542
+2.0736	0.0472
+2.1421	0.0409
+2.2107	0.0353
+2.2792	0.0303
+2.3477	0.0259
+2.4162	0.0221
+2.4848	0.0187
+2.5533	0.0157
+2.6218	0.0132
+2.6903	0.0110
+2.7589	0.0092
+2.8274	0.0076
+2.8959	0.0062
+2.9644	0.0051
+3.0330	0.0042
+3.1015	0.0034
+3.1700	0.0027
+Trait3	1
+250	150
+2	2	3
+1	7
+-2.7825	0.0086
+-2.7216	0.0101
+-2.6608	0.0119
+-2.5999	0.0140
+-2.5390	0.0163
+-2.4782	0.0190
+-2.4173	0.0220
+-2.3565	0.0254
+-2.2956	0.0292
+-2.2347	0.0335
+-2.1739	0.0383
+-2.1130	0.0435
+-2.0521	0.0494
+-1.9913	0.0558
+-1.9304	0.0628
+-1.8695	0.0704
+-1.8087	0.0786
+-1.7478	0.0875
+-1.6870	0.0970
+-1.6261	0.1072
+-1.5652	0.1181
+-1.5044	0.1295
+-1.4435	0.1415
+-1.3826	0.1541
+-1.3218	0.1672
+-1.2609	0.1807
+-1.2000	0.1946
+-1.1392	0.2088
+-1.0783	0.2232
+-1.0175	0.2378
+-0.9566	0.2524
+-0.8957	0.2668
+-0.8349	0.2811
+-0.7740	0.2951
+-0.7131	0.3086
+-0.6523	0.3216
+-0.5914	0.3338
+-0.5305	0.3453
+-0.4697	0.3559
+-0.4088	0.3654
+-0.3480	0.3738
+-0.2871	0.3811
+-0.2262	0.3870
+-0.1654	0.3916
+-0.1045	0.3948
+-0.0436	0.3966
+0.0172	0.3969
+0.0781	0.3957
+0.1389	0.3932
+0.1998	0.3892
+0.2607	0.3838
+0.3215	0.3771
+0.3824	0.3692
+0.4433	0.3601
+0.5041	0.3500
+0.5650	0.3389
+0.6259	0.3270
+0.6867	0.3143
+0.7476	0.3010
+0.8084	0.2872
+0.8693	0.2731
+0.9302	0.2587
+0.9910	0.2441
+1.0519	0.2295
+1.1128	0.2150
+1.1736	0.2007
+1.2345	0.1867
+1.2954	0.1730
+1.3562	0.1597
+1.4171	0.1469
+1.4779	0.1346
+1.5388	0.1229
+1.5997	0.1119
+1.6605	0.1014
+1.7214	0.0916
+1.7823	0.0824
+1.8431	0.0739
+1.9040	0.0660
+1.9649	0.0587
+2.0257	0.0521
+2.0866	0.0460
+2.1474	0.0405
+2.2083	0.0355
+2.2692	0.0310
+2.3300	0.0270
+2.3909	0.0234
+2.4518	0.0203
+2.5126	0.0174
+2.5735	0.0150
+2.6344	0.0128
+2.6952	0.0109
+2.7561	0.0092
+2.8169	0.0078
+2.8778	0.0066
+2.9387	0.0055
+2.9995	0.0046
+3.0604	0.0038
+3.1213	0.0032
+3.1821	0.0026
+3.2430	0.0022
+3.3039	0.0018
+Geno1	2
+250	150
+0
+1	6
+1	0.6650
+2	0.3350
+Trait2	1
+250	150
+1	5
+2	7	8
+-3.0753	0.0037
+-3.0078	0.0045
+-2.9403	0.0055
+-2.8728	0.0067
+-2.8053	0.0081
+-2.7378	0.0097
+-2.6702	0.0116
+-2.6027	0.0139
+-2.5352	0.0165
+-2.4677	0.0195
+-2.4002	0.0229
+-2.3327	0.0268
+-2.2652	0.0313
+-2.1977	0.0363
+-2.1302	0.0420
+-2.0627	0.0483
+-1.9951	0.0553
+-1.9276	0.0631
+-1.8601	0.0716
+-1.7926	0.0809
+-1.7251	0.0910
+-1.6576	0.1019
+-1.5901	0.1135
+-1.5226	0.1260
+-1.4551	0.1392
+-1.3876	0.1530
+-1.3201	0.1675
+-1.2525	0.1826
+-1.1850	0.1981
+-1.1175	0.2139
+-1.0500	0.2300
+-0.9825	0.2462
+-0.9150	0.2623
+-0.8475	0.2782
+-0.7800	0.2937
+-0.7125	0.3088
+-0.6450	0.3231
+-0.5775	0.3366
+-0.5099	0.3490
+-0.4424	0.3603
+-0.3749	0.3703
+-0.3074	0.3788
+-0.2399	0.3858
+-0.1724	0.3912
+-0.1049	0.3948
+-0.0374	0.3967
+0.0301	0.3968
+0.0976	0.3951
+0.1652	0.3916
+0.2327	0.3865
+0.3002	0.3796
+0.3677	0.3713
+0.4352	0.3614
+0.5027	0.3503
+0.5702	0.3379
+0.6377	0.3246
+0.7052	0.3103
+0.7727	0.2954
+0.8402	0.2799
+0.9078	0.2640
+0.9753	0.2479
+1.0428	0.2317
+1.1103	0.2156
+1.1778	0.1998
+1.2453	0.1842
+1.3128	0.1691
+1.3803	0.1546
+1.4478	0.1406
+1.5153	0.1274
+1.5829	0.1148
+1.6504	0.1031
+1.7179	0.0921
+1.7854	0.0819
+1.8529	0.0725
+1.9204	0.0640
+1.9879	0.0561
+2.0554	0.0490
+2.1229	0.0426
+2.1904	0.0369
+2.2579	0.0318
+2.3255	0.0273
+2.3930	0.0233
+2.4605	0.0198
+2.5280	0.0168
+2.5955	0.0141
+2.6630	0.0119
+2.7305	0.0099
+2.7980	0.0082
+2.8655	0.0068
+2.9330	0.0056
+3.0005	0.0046
+3.0681	0.0038
+3.1356	0.0031
+3.2031	0.0025
+3.2706	0.0020
+3.3381	0.0016
+3.4056	0.0013
+3.4731	0.0010
+3.5406	0.0008
+3.6081	0.0006
+3.6756	0.0005
+Trait4	1
+250	150
+3	2	4	6
+0
+-3.2636	0.0025
+-3.1926	0.0031
+-3.1216	0.0039
+-3.0506	0.0048
+-2.9796	0.0059
+-2.9086	0.0071
+-2.8376	0.0086
+-2.7666	0.0104
+-2.6957	0.0125
+-2.6247	0.0150
+-2.5537	0.0178
+-2.4827	0.0211
+-2.4117	0.0248
+-2.3407	0.0291
+-2.2697	0.0340
+-2.1987	0.0395
+-2.1277	0.0456
+-2.0567	0.0525
+-1.9857	0.0601
+-1.9148	0.0685
+-1.8438	0.0777
+-1.7728	0.0877
+-1.7018	0.0986
+-1.6308	0.1102
+-1.5598	0.1226
+-1.4888	0.1358
+-1.4178	0.1497
+-1.3468	0.1643
+-1.2758	0.1794
+-1.2049	0.1949
+-1.1339	0.2108
+-1.0629	0.2270
+-0.9919	0.2432
+-0.9209	0.2593
+-0.8499	0.2751
+-0.7789	0.2906
+-0.7079	0.3055
+-0.6369	0.3196
+-0.5659	0.3328
+-0.4949	0.3448
+-0.4240	0.3557
+-0.3530	0.3651
+-0.2820	0.3730
+-0.2110	0.3792
+-0.1400	0.3838
+-0.0690	0.3865
+0.0020	0.3874
+0.0730	0.3865
+0.1440	0.3838
+0.2150	0.3792
+0.2859	0.3730
+0.3569	0.3651
+0.4279	0.3557
+0.4989	0.3448
+0.5699	0.3328
+0.6409	0.3196
+0.7119	0.3055
+0.7829	0.2906
+0.8539	0.2752
+0.9249	0.2593
+0.9959	0.2432
+1.0668	0.2270
+1.1378	0.2109
+1.2088	0.1950
+1.2798	0.1794
+1.3508	0.1643
+1.4218	0.1498
+1.4928	0.1359
+1.5638	0.1227
+1.6348	0.1102
+1.7058	0.0986
+1.7767	0.0877
+1.8477	0.0777
+1.9187	0.0685
+1.9897	0.0601
+2.0607	0.0525
+2.1317	0.0456
+2.2027	0.0395
+2.2737	0.0340
+2.3447	0.0291
+2.4157	0.0248
+2.4867	0.0211
+2.5576	0.0178
+2.6286	0.0150
+2.6996	0.0125
+2.7706	0.0104
+2.8416	0.0086
+2.9126	0.0071
+2.9836	0.0059
+3.0546	0.0048
+3.1256	0.0039
+3.1966	0.0031
+3.2675	0.0025
+3.3385	0.0020
+3.4095	0.0016
+3.4805	0.0013
+3.5515	0.0010
+3.6225	0.0008
+3.6935	0.0006
+3.7645	0.0005
+3.8355	0.0004
+Trait1	1
+250	150
+1	6
+0
+-3.6875	0.0005
+-3.6097	0.0006
+-3.5318	0.0008
+-3.4540	0.0011
+-3.3761	0.0014
+-3.2983	0.0018
+-3.2204	0.0024
+-3.1425	0.0030
+-3.0647	0.0038
+-2.9868	0.0048
+-2.9090	0.0061
+-2.8311	0.0076
+-2.7533	0.0094
+-2.6754	0.0115
+-2.5976	0.0141
+-2.5197	0.0172
+-2.4418	0.0208
+-2.3640	0.0251
+-2.2861	0.0300
+-2.2083	0.0356
+-2.1304	0.0421
+-2.0526	0.0495
+-1.9747	0.0577
+-1.8969	0.0670
+-1.8190	0.0773
+-1.7411	0.0887
+-1.6633	0.1011
+-1.5854	0.1145
+-1.5076	0.1290
+-1.4297	0.1444
+-1.3519	0.1608
+-1.2740	0.1778
+-1.1962	0.1956
+-1.1183	0.2138
+-1.0404	0.2323
+-0.9626	0.2509
+-0.8847	0.2694
+-0.8069	0.2875
+-0.7290	0.3050
+-0.6512	0.3216
+-0.5733	0.3371
+-0.4955	0.3513
+-0.4176	0.3639
+-0.3397	0.3746
+-0.2619	0.3834
+-0.1840	0.3900
+-0.1062	0.3944
+-0.0283	0.3964
+0.0495	0.3961
+0.1274	0.3934
+0.2052	0.3884
+0.2831	0.3812
+0.3610	0.3719
+0.4388	0.3606
+0.5167	0.3476
+0.5945	0.3330
+0.6724	0.3172
+0.7502	0.3003
+0.8281	0.2826
+0.9059	0.2644
+0.9838	0.2458
+1.0617	0.2272
+1.1395	0.2088
+1.2174	0.1907
+1.2952	0.1731
+1.3731	0.1562
+1.4509	0.1401
+1.5288	0.1250
+1.6066	0.1108
+1.6845	0.0976
+1.7624	0.0855
+1.8402	0.0744
+1.9181	0.0644
+1.9959	0.0554
+2.0738	0.0474
+2.1516	0.0403
+2.2295	0.0340
+2.3073	0.0286
+2.3852	0.0238
+2.4631	0.0198
+2.5409	0.0163
+2.6188	0.0134
+2.6966	0.0109
+2.7745	0.0088
+2.8523	0.0071
+2.9302	0.0057
+3.0080	0.0045
+3.0859	0.0036
+3.1638	0.0028
+3.2416	0.0022
+3.3195	0.0017
+3.3973	0.0013
+3.4752	0.0010
+3.5530	0.0008
+3.6309	0.0006
+3.7087	0.0004
+3.7866	0.0003
+3.8645	0.0002
+3.9423	0.0002
+4.0202	0.0001
+4.0980	0.0001
diff --git a/sourcecodes/data/example1/Bqxnlevels.txt b/sourcecodes/data/example1/Bqxnlevels.txt
new file mode 100644
index 00000000..32457058
--- /dev/null
+++ b/sourcecodes/data/example1/Bqxnlevels.txt
@@ -0,0 +1,4 @@
+Geno1	1	2
+Geno2	1	2
+
+
diff --git a/sourcecodes/data/example1/Bqxnnode.txt b/sourcecodes/data/example1/Bqxnnode.txt
new file mode 100644
index 00000000..45a4fb75
--- /dev/null
+++ b/sourcecodes/data/example1/Bqxnnode.txt
@@ -0,0 +1 @@
+8
diff --git a/sourcecodes/data/example1/Bqxnrows.txt b/sourcecodes/data/example1/Bqxnrows.txt
new file mode 100644
index 00000000..3bc92d44
--- /dev/null
+++ b/sourcecodes/data/example1/Bqxnrows.txt
@@ -0,0 +1 @@
+201
diff --git a/sourcecodes/data/example1/Bqxparent.txt b/sourcecodes/data/example1/Bqxparent.txt
new file mode 100644
index 00000000..b8626c4c
--- /dev/null
+++ b/sourcecodes/data/example1/Bqxparent.txt
@@ -0,0 +1 @@
+4
diff --git a/sourcecodes/data/example1/Bqxrun_initialstructure.sh b/sourcecodes/data/example1/Bqxrun_initialstructure.sh
new file mode 100644
index 00000000..a8a8ebe0
--- /dev/null
+++ b/sourcecodes/data/example1/Bqxrun_initialstructure.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+# script for execution of deployed applications
+#
+# Sets up the MCR environment for the current $ARCH and executes 
+# the specified command.
+#
+exe_name=$0
+exe_dir=`dirname "$0"`
+echo "------------------------------------------"
+if [ "x$1" = "x" ]; then
+  echo Usage:
+  echo    $0 \<deployedMCRroot\> args
+else
+  echo Setting up environment variables
+  MCRROOT="$1"
+  echo ---
+  LD_LIBRARY_PATH=.:${MCRROOT}/runtime/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/bin/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/sys/os/glnxa64;
+	MCRJRE=${MCRROOT}/sys/java/jre/glnxa64/jre/lib/amd64 ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/native_threads ; 
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/server ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/client ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE} ;  
+  XAPPLRESDIR=${MCRROOT}/X11/app-defaults ;
+  export LD_LIBRARY_PATH;
+  export XAPPLRESDIR;
+  echo LD_LIBRARY_PATH is ${LD_LIBRARY_PATH};
+  shift 1
+  args=
+  while [ $# -gt 0 ]; do
+      token=`echo "$1" | sed 's/ /\\\\ /g'`   # Add blackslash before each blank
+      args="${args} ${token}" 
+      shift
+  done
+  "${exe_dir}"/initialstructure Bqx
+fi
+exit
diff --git a/sourcecodes/data/example1/Bqxstructure_input.txt b/sourcecodes/data/example1/Bqxstructure_input.txt
new file mode 100644
index 00000000..09955440
--- /dev/null
+++ b/sourcecodes/data/example1/Bqxstructure_input.txt
@@ -0,0 +1,9 @@
+Geno1	Geno2	Trait1	Trait2	Trait3	Trait4	Trait5	Trait6	
+0	0	0	1	0	0	0	0	
+0	0	0	0	1	1	0	1	
+0	0	0	0	0	0	0	0	
+0	0	1	0	0	1	0	0	
+0	0	0	0	0	1	0	0	
+0	0	0	0	0	0	0	0	
+0	0	0	0	0	0	0	0	
+0	0	0	0	1	0	0	0	
diff --git a/sourcecodes/data/example1/Bqxstructure_input_temp.txt b/sourcecodes/data/example1/Bqxstructure_input_temp.txt
new file mode 100644
index 00000000..fc815603
--- /dev/null
+++ b/sourcecodes/data/example1/Bqxstructure_input_temp.txt
@@ -0,0 +1,9 @@
+Geno1	Geno2	Trait1	Trait2	Trait3	Trait4	Trait5	Trait6	
+0.000000	0.000000	0.000000	1.000000	0.000000	0.000000	0.000000	0.000000	
+0.000000	0.000000	0.000000	0.000000	1.000000	1.000000	0.000000	1.000000	
+0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	
+0.000000	0.000000	1.000000	0.000000	0.000000	1.000000	0.000000	0.000000	
+0.000000	0.000000	0.000000	0.000000	0.000000	1.000000	0.000000	0.000000	
+0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	
+0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	
+0.000000	0.000000	0.000000	0.000000	1.000000	0.000000	0.000000	0.000000	
diff --git a/sourcecodes/data/example1/Bqxstructure_old.txt b/sourcecodes/data/example1/Bqxstructure_old.txt
new file mode 100644
index 00000000..7749d17e
--- /dev/null
+++ b/sourcecodes/data/example1/Bqxstructure_old.txt
@@ -0,0 +1,7 @@
+Geno1	0.6650	0.3350
+Trait2	0.0037	0.0045	0.0055	0.0067	0.0081	0.0097	0.0116	0.0139	0.0165	0.0195	0.0229	0.0268	0.0313	0.0363	0.0420	0.0483	0.0553	0.0631	0.0716	0.0809	0.0910	0.1019	0.1135	0.1260	0.1392	0.1530	0.1675	0.1826	0.1981	0.2139	0.2300	0.2462	0.2623	0.2782	0.2937	0.3088	0.3231	0.3366	0.3490	0.3603	0.3703	0.3788	0.3858	0.3912	0.3948	0.3967	0.3968	0.3951	0.3916	0.3865	0.3796	0.3713	0.3614	0.3503	0.3379	0.3246	0.3103	0.2954	0.2799	0.2640	0.2479	0.2317	0.2156	0.1998	0.1842	0.1691	0.1546	0.1406	0.1274	0.1148	0.1031	0.0921	0.0819	0.0725	0.0640	0.0561	0.0490	0.0426	0.0369	0.0318	0.0273	0.0233	0.0198	0.0168	0.0141	0.0119	0.0099	0.0082	0.0068	0.0056	0.0046	0.0038	0.0031	0.0025	0.0020	0.0016	0.0013	0.0010	0.0008	0.0006	0.0005
+Geno2	0.4300	0.5700
+Trait3	0.0086	0.0101	0.0119	0.0140	0.0163	0.0190	0.0220	0.0254	0.0292	0.0335	0.0383	0.0435	0.0494	0.0558	0.0628	0.0704	0.0786	0.0875	0.0970	0.1072	0.1181	0.1295	0.1415	0.1541	0.1672	0.1807	0.1946	0.2088	0.2232	0.2378	0.2524	0.2668	0.2811	0.2951	0.3086	0.3216	0.3338	0.3453	0.3559	0.3654	0.3738	0.3811	0.3870	0.3916	0.3948	0.3966	0.3969	0.3957	0.3932	0.3892	0.3838	0.3771	0.3692	0.3601	0.3500	0.3389	0.3270	0.3143	0.3010	0.2872	0.2731	0.2587	0.2441	0.2295	0.2150	0.2007	0.1867	0.1730	0.1597	0.1469	0.1346	0.1229	0.1119	0.1014	0.0916	0.0824	0.0739	0.0660	0.0587	0.0521	0.0460	0.0405	0.0355	0.0310	0.0270	0.0234	0.0203	0.0174	0.0150	0.0128	0.0109	0.0092	0.0078	0.0066	0.0055	0.0046	0.0038	0.0032	0.0026	0.0022	0.0018
+Trait4	0.0025	0.0031	0.0039	0.0048	0.0059	0.0071	0.0086	0.0104	0.0125	0.0150	0.0178	0.0211	0.0248	0.0291	0.0340	0.0395	0.0456	0.0525	0.0601	0.0685	0.0777	0.0877	0.0986	0.1102	0.1226	0.1358	0.1497	0.1643	0.1794	0.1949	0.2108	0.2270	0.2432	0.2593	0.2751	0.2906	0.3055	0.3196	0.3328	0.3448	0.3557	0.3651	0.3730	0.3792	0.3838	0.3865	0.3874	0.3865	0.3838	0.3792	0.3730	0.3651	0.3557	0.3448	0.3328	0.3196	0.3055	0.2906	0.2752	0.2593	0.2432	0.2270	0.2109	0.1950	0.1794	0.1643	0.1498	0.1359	0.1227	0.1102	0.0986	0.0877	0.0777	0.0685	0.0601	0.0525	0.0456	0.0395	0.0340	0.0291	0.0248	0.0211	0.0178	0.0150	0.0125	0.0104	0.0086	0.0071	0.0059	0.0048	0.0039	0.0031	0.0025	0.0020	0.0016	0.0013	0.0010	0.0008	0.0006	0.0005	0.0004
+Trait6	0.0005	0.0006	0.0008	0.0010	0.0013	0.0016	0.0020	0.0025	0.0031	0.0038	0.0046	0.0057	0.0069	0.0084	0.0101	0.0121	0.0145	0.0172	0.0204	0.0240	0.0282	0.0329	0.0382	0.0441	0.0508	0.0582	0.0664	0.0753	0.0851	0.0957	0.1071	0.1193	0.1323	0.1461	0.1605	0.1755	0.1910	0.2069	0.2232	0.2396	0.2560	0.2722	0.2881	0.3036	0.3184	0.3324	0.3454	0.3572	0.3677	0.3768	0.3843	0.3901	0.3942	0.3965	0.3969	0.3955	0.3923	0.3873	0.3806	0.3722	0.3624	0.3512	0.3387	0.3252	0.3108	0.2956	0.2799	0.2638	0.2474	0.2310	0.2147	0.1986	0.1829	0.1676	0.1529	0.1388	0.1255	0.1129	0.1011	0.0901	0.0799	0.0706	0.0620	0.0542	0.0472	0.0409	0.0353	0.0303	0.0259	0.0221	0.0187	0.0157	0.0132	0.0110	0.0092	0.0076	0.0062	0.0051	0.0042	0.0034	0.0027
+Trait1	0.0005	0.0006	0.0008	0.0011	0.0014	0.0018	0.0024	0.0030	0.0038	0.0048	0.0061	0.0076	0.0094	0.0115	0.0141	0.0172	0.0208	0.0251	0.0300	0.0356	0.0421	0.0495	0.0577	0.0670	0.0773	0.0887	0.1011	0.1145	0.1290	0.1444	0.1608	0.1778	0.1956	0.2138	0.2323	0.2509	0.2694	0.2875	0.3050	0.3216	0.3371	0.3513	0.3639	0.3746	0.3834	0.3900	0.3944	0.3964	0.3961	0.3934	0.3884	0.3812	0.3719	0.3606	0.3476	0.3330	0.3172	0.3003	0.2826	0.2644	0.2458	0.2272	0.2088	0.1907	0.1731	0.1562	0.1401	0.1250	0.1108	0.0976	0.0855	0.0744	0.0644	0.0554	0.0474	0.0403	0.0340	0.0286	0.0238	0.0198	0.0163	0.0134	0.0109	0.0088	0.0071	0.0057	0.0045	0.0036	0.0028	0.0022	0.0017	0.0013	0.0010	0.0008	0.0006	0.0004	0.0003	0.0002	0.0002	0.0001	0.0001
diff --git a/sourcecodes/data/example1/Bqxthr.txt b/sourcecodes/data/example1/Bqxthr.txt
new file mode 100644
index 00000000..2eb3c4fe
--- /dev/null
+++ b/sourcecodes/data/example1/Bqxthr.txt
@@ -0,0 +1 @@
+0.5
diff --git a/sourcecodes/data/example1/Bqxtier.txt b/sourcecodes/data/example1/Bqxtier.txt
new file mode 100644
index 00000000..bc94239b
--- /dev/null
+++ b/sourcecodes/data/example1/Bqxtier.txt
@@ -0,0 +1 @@
+3,Tier1,0,Tier2,0,Tier3,0,
\ No newline at end of file
diff --git a/sourcecodes/data/example1/Bqxtype.txt b/sourcecodes/data/example1/Bqxtype.txt
new file mode 100644
index 00000000..285a68af
--- /dev/null
+++ b/sourcecodes/data/example1/Bqxtype.txt
@@ -0,0 +1,2 @@
+Geno1	Geno2	Trait1	Trait2	Trait3	Trait4	Trait5	Trait6
+2	2	1	1	1	1	1	1	
diff --git a/sourcecodes/data/example1/Bqxwhite.txt b/sourcecodes/data/example1/Bqxwhite.txt
new file mode 100644
index 00000000..83e81b8b
--- /dev/null
+++ b/sourcecodes/data/example1/Bqxwhite.txt
@@ -0,0 +1 @@
+From	To
diff --git a/sourcecodes/data/example1/standardized_data.txt b/sourcecodes/data/example1/standardized_data.txt
new file mode 100644
index 00000000..743e8b02
--- /dev/null
+++ b/sourcecodes/data/example1/standardized_data.txt
@@ -0,0 +1,201 @@
+Trait5	Geno2	Trait6	Trait3	Geno1	Trait2	Trait4	Trait1	
+1.8453	2	-0.70749	-1.3361	2	1.5443	-0.43784	0.72827
+0.9605	1	0.85158	1.5164	1	-1.1632	1.0263	-0.11408
+-0.63336	1	0.53936	1.1602	1	-0.74229	1.4011	-1.541
+1.3355	2	-1.7216	-0.76715	1	0.12195	-0.66179	0.099211
+0.36111	2	-0.74876	-0.98283	1	-2.0753	-1.2335	-0.99244
+-1.177	1	0.51257	0.84261	1	0.065663	1.2658	-0.64654
+0.076305	1	1.5888	1.7606	1	-0.66331	1.4736	0.39057
+-0.53841	2	0.11031	-1.5038	1	0.23456	-0.060179	0.14097
+-0.59968	1	0.48834	1.0431	1	-0.59377	0.22579	-0.99932
+0.37839	1	1.293	0.49142	1	-1.2855	0.37537	0.50786
+-0.98262	1	1.6051	0.57702	2	0.44497	0.92494	1.9396
+-0.32154	1	1.0249	0.77512	1	-0.62075	0.32547	1.8129
+0.094471	1	1.0318	1.5671	2	-0.60413	0.75183	-1.4864
+-0.2677	2	-1.3762	-0.039045	2	0.61004	-0.20296	-0.34315
+1.45	2	0.22686	-0.18131	1	-0.5462	-0.61255	-0.83409
+-0.94296	2	-1.0223	-1.1896	1	-0.4021	-1.2644	-1.2822
+-0.65504	2	-2.6825	-1.035	1	0.25776	-1.4615	0.84597
+1.3635	1	1.5647	0.59499	2	1.372	1.0621	0.74498
+0.60321	1	0.68692	1.4714	2	0.81867	1.711	0.90082
+-0.5142	2	-1.0962	-1.5522	1	-0.04535	-1.2401	-0.62273
+-1.2303	1	0.82027	1.0532	2	-0.12811	1.344	0.60516
+0.84008	2	-0.7159	-0.44987	1	-0.56344	-1.5572	1.0854
+0.47761	1	1.5622	1.2168	1	-0.30596	1.1251	-1.3723
+-1.3546	2	-0.7484	-0.096654	1	0.03293	0.23078	0.81604
+-0.32954	2	-1.6183	-0.57119	1	-0.9399	-1.5734	-0.76341
+0.57841	1	0.24378	0.681	1	-0.7778	1.305	0.77773
+0.11524	2	-0.85367	0.35424	2	2.3096	0.75697	1.7572
+1.1463	2	0.0096586	-0.25741	1	-0.52081	-1.5513	0.64513
+-1.3926	2	-0.88863	-0.68795	2	0.0060478	-0.43763	0.97179
+-0.34841	1	1.0004	0.23941	1	-0.83161	0.87503	-0.88918
+0.79176	1	0.59541	1.0092	1	-1.9591	0.77295	0.31259
+-1.7691	2	0.055429	-1.1837	2	1.1172	-0.091192	1.3241
+0.23812	2	-0.13588	-0.98943	1	-0.041159	-0.43704	-0.39754
+1.4262	1	0.46298	1.327	1	0.15808	1.1741	-0.073642
+1.3584	1	1.5511	0.49802	1	-0.96618	-0.037384	0.26987
+-0.45407	2	-0.11918	-0.20984	1	-0.84764	0.68704	0.15725
+1.3502	1	1.1228	1.7003	1	-0.34181	1.3601	0.19859
+0.51265	2	0.059243	-0.61724	1	-1.2675	-1.2719	-1.5483
+1.6144	2	-1.6767	-0.4403	2	-0.7614	0.046076	-0.6741
+-0.99883	2	-0.76648	0.33667	2	0.97148	-1.1389	-0.11754
+0.24789	1	0.4729	1.0484	1	-0.62124	0.34555	-0.08916
+1.6957	2	0.014711	-1.3474	1	-0.026706	-1.4606	-1.4336
+-0.54533	1	0.88108	1.3793	1	-0.29202	1.3706	-1.1708
+-1.7381	1	0.16189	0.96739	1	-0.77438	0.96572	1.2346
+-0.844	2	-1.0713	-0.50552	2	1.1809	-0.13536	3.098
+-1.8946	1	0.83747	0.55294	1	0.21042	0.78685	-0.41553
+-1.2313	1	0.77672	1.7131	1	-0.38666	1.694	-0.79692
+-0.7674	2	-1.151	-0.091205	1	0.9644	-0.57897	0.21389
+0.72057	2	-0.34897	-0.95934	1	-1.3832	-0.57841	-0.10718
+1.2095	2	0.5788	-0.77644	2	0.86817	-0.56945	0.13481
+0.09126	1	1.0274	0.59902	1	0.094442	0.30723	1.2562
+-1.7398	1	0.67041	0.82202	1	-0.30164	0.94827	-0.94259
+-0.66818	1	0.49087	1.2694	1	-0.18615	0.78217	-1.3239
+-0.2258	2	-1.4193	-1.44	1	-1.5421	-1.6216	-0.34851
+1.4939	2	0.12307	-0.97417	2	-1.9058	-1.6405	-2.6645
+0.59683	2	-0.27561	-1.5921	1	-0.012339	-1.033	0.22517
+0.32502	1	1.8115	0.59888	1	-0.78178	0.37072	-1.5597
+0.33627	2	-0.54037	-0.092937	1	-0.23801	-0.28432	0.25627
+-0.71947	2	-0.96292	-0.87226	2	1.0454	-1.1866	-1.1152
+0.7723	2	-0.74389	-0.31293	2	0.56738	-1.597	0.21919
+1.1117	1	0.22881	0.53378	1	0.28362	0.62928	-0.56731
+-0.37072	1	1.1896	1.2033	2	1.7889	1.9867	-1.1364
+1.9537	2	-1.2797	-1.1399	1	-0.45995	-1.6282	-0.33873
+-1.1043	1	1.0871	2.3039	2	-0.27611	0.615	0.27237
+-1.3202	1	0.86019	1.2914	2	0.27461	0.94779	-0.83546
+-0.46478	1	1.29	0.43419	1	0.6874	1.6104	-0.36581
+-1.1858	2	-1.2069	-0.56475	1	0.18024	-0.54017	0.23717
+0.32802	1	0.87458	1.8613	2	0.40544	1.1088	1.7576
+1.1735	2	-0.66747	-1.6202	1	0.53589	-0.9149	0.45212
+-1.16	1	1.0838	0.61868	2	0.72867	1.3378	0.2647
+1.462	2	0.19509	-1.4192	1	0.56635	-0.85302	0.33371
+1.0695	1	0.21919	1.322	2	1.3441	1.1727	0.76002
+-0.22703	1	1.1363	0.54703	1	-0.48891	1.2236	-0.91644
+1.3458	2	-0.6068	-1.7825	1	-0.68775	-0.89217	0.99689
+-0.091249	1	0.68469	0.60839	1	-0.6527	0.58896	-0.24017
+0.67203	1	0.72395	1.1051	1	-1.4197	0.29802	0.188
+0.34537	1	1.2845	1.4258	1	-0.6173	1.0233	-0.24233
+-1.0761	2	-1.2815	-0.94371	1	-1.4633	-0.69107	-0.8715
+-0.20711	1	1.0174	0.69566	1	-0.58432	0.15352	-0.49345
+0.59929	1	1.5069	1.8419	1	-1.4583	-0.031663	0.0055113
+-0.11492	1	1.2367	1.2191	1	-0.51421	1.1523	1.884
+1.2751	2	-0.52411	-0.64346	2	2.0614	-0.0023541	-0.77991
+0.90981	1	1.1284	1.2152	2	2.6756	1.2409	-0.0084945
+-1.9542	2	-1.221	-1.4163	2	1.2826	-0.010965	1.0953
+1.7193	1	0.30492	1.2836	2	0.61499	0.56464	0.15443
+-0.53199	1	0.23732	0.77552	1	-1.2032	-0.66655	0.09844
+0.036699	2	-1.0483	-1.779	1	0.3525	-0.60395	0.30022
+-0.64389	1	-0.082056	0.48348	1	-0.86546	-0.4081	-0.099303
+0.7892	2	0.063117	-0.73251	1	-0.64062	-0.4066	0.12435
+-0.92679	2	-1.4966	0.012855	1	0.79099	-0.55856	0.19256
+0.75147	1	0.0035339	0.026413	1	-0.50794	0.29651	-0.27764
+0.21172	2	-1.3492	-0.47335	1	0.23233	-0.70213	-1.8621
+-0.97409	2	-0.629	-0.4728	1	0.091744	-0.086481	-0.49515
+-1.0464	2	-1.6692	-0.8497	2	1.5077	0.095689	1.3063
+-0.078054	1	1.7703	0.87897	2	1.6091	1.3305	-0.65192
+1.6149	2	-0.75709	-0.63085	1	-0.77532	-2.2636	-0.59675
+-1.1678	1	0.0899	0.58095	2	-0.22151	0.26068	0.51619
+-0.098842	2	-0.30237	-0.04093	1	-1.2385	-0.37569	-1.8217
+-0.55001	2	-1.0301	-1.7087	2	2.6454	-1.328	0.34954
+1.0482	2	-0.26461	-1.3201	2	1.68	-0.0041651	-0.12113
+0.5008	2	-0.85959	-0.66514	1	-1.6141	0.29161	-0.95504
+0.309	1	1.0744	1.269	1	-0.96467	1.5905	-1.42
+-0.03887	1	1.0667	1.0095	1	-0.089407	0.99929	1.152
+-0.50172	2	-0.99479	-0.54327	2	-0.16208	-1.0551	0.47476
+-0.094959	1	2.17	1.7212	2	0.51568	0.53768	-1.2639
+-0.5209	2	-1.431	-0.70798	1	-0.4217	0.23091	0.57769
+0.6976	2	-1.2512	-0.50443	1	0.40922	-1.2722	-0.22881
+-0.15737	2	-1.3037	-1.2446	1	-0.25	-1.3128	-0.48267
+1.7004	2	-0.093222	0.18072	1	-0.77286	-1.1751	0.70356
+-0.34711	2	-0.40996	-0.38877	1	-0.74126	-0.076517	0.71538
+0.63301	2	-1.3066	-1.061	1	-0.020245	-0.47474	0.22151
+0.45593	1	0.98475	1.1245	1	-1.5284	0.87162	-1.1116
+-0.074398	2	0.086143	-0.71909	1	-0.72312	-0.58633	-0.11884
+0.5737	1	1.3999	0.41267	1	0.14453	0.30696	0.39177
+0.50652	2	-0.76797	-0.93352	1	-0.537	-0.41761	0.072615
+-1.6019	2	0.65979	-0.97526	1	0.28122	-0.88937	0.46709
+0.74414	1	1.6353	1.382	1	0.099487	1.2686	1.3095
+-1.3504	2	-1.1309	-0.53372	2	0.13853	-1.3604	1.3258
+-0.32328	2	-1.4115	-0.55521	1	-0.39333	-0.7941	1.0533
+-0.74323	1	1.7072	0.49329	1	-0.87786	0.48373	-1.3411
+0.8876	2	-1.0691	-0.47533	1	-0.65919	-1.2867	1.3563
+-0.26121	1	1.3665	1.3315	2	0.59812	1.5342	-0.51186
+-0.52176	1	1.5091	0.71759	1	-0.79433	0.67907	-0.77268
+-0.51351	2	-0.99866	-0.96005	2	-0.064251	-0.82275	1.8509
+-0.17328	2	0.54034	-1.7709	1	0.38529	-1.362	0.6719
+0.15516	1	1.1328	-0.19576	1	-1.135	1.0527	0.29172
+0.45546	1	0.45829	1.7196	2	0.62149	2.3385	-2.0495
+2.0143	1	1.7214	1.3935	1	-1.973	1.0241	-0.84073
+0.017525	2	-1.3151	-0.89644	1	-0.75598	-1.0529	0.10505
+-0.041089	2	-0.071698	-0.33496	1	-0.25915	-0.26742	0.55872
+-0.072325	1	0.14302	1.099	1	0.45095	0.51954	-1.5618
+0.9507	2	-0.99789	-1.1502	1	-0.63471	0.61259	0.50063
+-1.8153	2	-0.51697	-0.18793	1	-0.58518	-0.41489	-0.79261
+-0.37059	2	-0.18087	-0.77008	2	0.14794	-0.66655	0.62335
+-0.24334	2	0.033188	-0.22919	1	-1.8202	-0.18936	-0.69045
+-0.83923	2	-0.41353	-1.3264	2	1.8901	-1.3452	0.28566
+-1.5292	2	-0.28479	-0.49856	1	0.34714	-1.4144	-0.50451
+-1.1641	1	0.77391	1.0241	1	-0.77302	0.27655	-2.6875
+2.6624	1	1.7387	1.374	1	0.041422	2.3695	-0.062096
+2.3682	1	1.907	0.94637	2	0.8413	0.76571	-1.6393
+0.31396	2	-1.292	-0.78457	2	-0.31227	-0.84139	-0.22892
+-0.87392	2	0.53494	0.55115	1	-0.15179	-0.83441	1.0812
+-1.1022	2	-0.57856	-0.21265	2	1.4486	0.11044	-0.38736
+0.42993	2	-1.5502	-0.063309	2	2.2649	-0.59644	2.3365
+-1.5011	2	-2.2926	-0.96909	1	-0.40571	-1.1012	0.56007
+-1.567	1	0.014611	-0.069863	2	1.3161	0.89287	0.96852
+0.26418	1	0.46242	1.94	1	-1.3016	1.1926	-1.5223
+-0.77783	1	1.4946	0.92514	1	-1.1651	1.0425	-1.2685
+-0.17339	2	-0.86526	-0.090231	1	-0.09102	-1.3706	0.0049574
+0.11883	1	0.8622	0.94077	1	-0.76414	1.3308	1.415
+0.12005	2	-0.20542	-0.74536	1	-1.2579	-1.2279	-1.2709
+-0.79628	2	-0.022269	-0.16145	1	-0.47715	-0.37329	1.1972
+0.58969	1	1.0063	1.3356	2	0.79987	1.5464	0.32801
+0.11633	1	0.73396	1.1437	2	1.3183	1.0156	-1.9512
+-0.88008	2	0.39215	-0.88212	2	0.77879	-0.071244	0.92164
+-0.74781	2	-0.31657	-1.2371	1	-1.356	-0.76328	-0.96657
+-0.069788	2	0.63495	-0.70214	1	-0.76454	-2.2215	1.7055
+0.3897	2	-0.59859	-0.81633	1	-0.04446	0.84047	-0.75073
+2.202	1	0.77915	0.03712	2	1.8438	1.1743	0.40331
+0.22687	2	-0.40806	-1.0788	1	-0.19213	-0.78118	0.48301
+-0.66335	1	1.4808	1.1399	1	-0.033787	0.43484	-0.12095
+0.13303	2	-0.66658	-0.14357	1	-1.073	-0.49395	0.70655
+-1.5417	1	0.2473	1.2125	2	1.9083	1.2778	3.0844
+0.74601	1	-0.35212	0.88616	1	-0.87675	0.60499	-0.21133
+-0.80655	2	-1.1068	-1.3459	1	-0.26122	0.15508	-0.0066816
+-0.69135	1	1.0994	1.204	2	2.3161	1.0629	1.4256
+1.6905	2	-0.14242	-0.55749	2	0.359	0.41916	0.53215
+-0.77018	2	-1.5065	-0.53604	1	0.19357	0.059861	1.9152
+-2.2055	1	1.058	-0.29035	2	1.0301	0.11952	1.1588
+-0.70569	2	-0.73004	-1.6228	2	2.1348	-0.42942	0.97843
+1.3633	1	0.65794	0.98061	2	1.3078	0.64345	0.8317
+0.093858	2	-1.6142	-0.92049	1	-0.92394	-1.3444	-0.43212
+1.6603	2	0.037058	0.81538	1	-0.70654	-0.93759	-0.023641
+0.29687	1	0.84923	0.6669	2	0.66467	0.47209	-0.21266
+0.30837	2	-0.8147	-1.3296	1	-1.1736	-1.2252	-0.61256
+-1.7779	2	-1.1384	-1.0425	1	-0.69411	-0.39049	-0.48379
+-0.35135	2	-0.52672	-1.388	2	0.84612	-1.4625	0.071832
+0.18294	2	-0.96354	-0.6923	1	-0.91232	-0.9204	0.030227
+-0.34302	1	1.8167	0.77427	2	0.036232	0.81699	1.0643
+-1.0367	2	-0.55158	-0.84582	2	0.67713	-0.66779	-0.43102
+2.6147	2	0.14282	-0.33616	1	-0.83219	-0.17633	-0.13118
+-0.59086	2	-1.2139	-0.99552	2	1.9391	-1.1308	0.34126
+-0.90208	2	-0.28263	-0.58061	2	0.7467	-0.84617	-0.13398
+1.2668	2	-0.56449	-0.1964	1	0.79248	0.19601	0.41777
+0.75643	1	-0.011136	0.81301	1	0.34117	0.68247	-1.863
+-0.62022	1	0.86997	0.6729	1	-1.1203	0.17657	-1.4244
+-0.18946	2	-0.55133	-0.86512	1	-0.83578	-0.40257	-0.029909
+-1.5498	1	0.32287	1.184	1	-0.62378	0.80455	0.92806
+-0.53493	2	-0.9391	-0.84301	2	1.3501	-0.31379	-0.058019
+0.3655	2	-0.74384	-1.3595	1	1.3067	-0.5247	-1.7338
+0.82879	2	-1.5915	-1.0102	2	1.0708	-0.6468	0.92568
+0.57673	2	-1.4808	-1.0779	1	0.47651	-1.062	0.26133
+0.59244	2	-0.8026	-1.7146	1	-0.020034	-1.3898	-1.5705
+0.44996	1	0.50751	1.0983	2	2.2137	2.8355	0.34907
+-0.75132	2	-0.52338	-0.74591	1	-0.84637	-1.6929	-1.6584
+-0.1943	1	1.2265	0.4739	1	-0.78558	0.81272	-0.023241
+2.0866	2	-0.19274	0.066839	1	-0.30442	-0.70635	0.85947
+-1.3268	2	-1.2952	0.023312	2	1.4432	0.036383	0.8954
+-1.4174	2	-0.43139	-0.97617	2	1.9378	0.79311	-0.17648
+-0.30469	2	0.072833	-0.069195	2	1.2683	-0.62404	0.25533
diff --git a/sourcecodes/data/example2/hQGban.txt b/sourcecodes/data/example2/hQGban.txt
new file mode 100644
index 00000000..83e81b8b
--- /dev/null
+++ b/sourcecodes/data/example2/hQGban.txt
@@ -0,0 +1 @@
+From	To
diff --git a/sourcecodes/data/example2/hQGcontinuous_input.txt b/sourcecodes/data/example2/hQGcontinuous_input.txt
new file mode 100644
index 00000000..5e296c45
--- /dev/null
+++ b/sourcecodes/data/example2/hQGcontinuous_input.txt
@@ -0,0 +1,203 @@
+Geno1	Geno2	Trait1	Trait2	Trait3	Trait4	Trait5	Trait6
+2	2	1	1	1	1	1	1
+2	2	0.46259	1.2692	-1.3164	-0.44096	0.5929	-0.75422
+1	1	-0.10011	-0.88834	1.6407	0.99972	0.31288	0.65602
+1	1	-1.0533	-0.55296	1.2715	1.3686	-0.19153	0.37361
+1	2	0.042371	0.13573	-0.72659	-0.66133	0.43157	-1.6715
+1	2	-0.68686	-1.6152	-0.95019	-1.2239	0.12319	-0.79155
+1	1	-0.4558	0.090877	0.94224	1.2354	-0.36356	0.34937
+1	1	0.237	-0.49002	1.8939	1.4399	0.033059	1.3229
+1	2	0.070265	0.22547	-1.4903	-0.069341	-0.16148	-0.01449
+1	1	-0.69146	-0.43461	1.1501	0.21205	-0.18087	0.32746
+1	1	0.31535	-0.9858	0.57816	0.35924	0.12866	1.0553
+2	1	1.2718	0.39314	0.6669	0.90002	-0.30206	1.3376
+1	1	1.1871	-0.45611	0.87227	0.31014	-0.092846	0.81278
+2	1	-1.0168	-0.44286	1.6933	0.72968	0.038808	0.81906
+2	2	-0.25313	0.52468	0.02823	-0.20984	-0.075809	-1.3591
+1	2	-0.58108	-0.3967	-0.11925	-0.61288	0.46778	0.090941
+1	2	-0.88043	-0.28187	-1.1645	-1.2543	-0.28951	-1.039
+1	2	0.54121	0.24395	-1.0043	-1.4483	-0.19839	-2.5407
+2	1	0.47375	1.1319	0.68553	1.035	0.44043	1.3011
+2	1	0.57785	0.69093	1.5941	1.6735	0.19981	0.50708
+1	2	-0.43989	0.0024131	-1.5405	-1.2304	-0.15382	-1.1058
+2	1	0.38035	-0.063535	1.1606	1.3124	-0.38043	0.6277
+1	2	0.70114	-0.41044	-0.39767	-1.5424	0.27477	-0.76183
+1	1	-0.9406	-0.20526	1.3302	1.097	0.16006	1.2988
+1	2	0.52122	0.064793	-0.031492	0.21696	-0.41979	-0.79123
+1	2	-0.53387	-0.71043	-0.52344	-1.5584	-0.09538	-1.5781
+1	1	0.49563	-0.58126	0.7747	1.274	0.19196	0.10624
+2	2	1.1499	1.879	0.43595	0.73474	0.045381	-0.88645
+1	2	0.40705	-0.37647	-0.19815	-1.5366	0.37167	-0.10553
+2	2	0.62526	0.043371	-0.64449	-0.44076	-0.4318	-0.91807
+1	1	-0.61788	-0.62414	0.3169	0.85091	-0.10135	0.79065
+1	1	0.18491	-1.5226	1.1149	0.75046	0.25948	0.42431
+2	2	0.86063	0.92883	-1.1584	-0.099858	-0.55095	-0.064129
+1	2	-0.28946	0.0057533	-0.95703	-0.44018	0.084268	-0.23718
+1	1	-0.073096	0.16452	1.4444	1.1452	0.46025	0.30452
+1	1	0.15637	-0.73137	0.585	-0.046911	0.43881	1.2888
+1	2	0.081142	-0.63691	-0.14883	0.66593	-0.13479	-0.22207
+1	1	0.10876	-0.23383	1.8314	1.3282	0.4362	0.90139
+1	2	-1.0582	-0.97152	-0.57118	-1.2617	0.17115	-0.060679
+2	2	-0.47421	-0.56819	-0.38775	0.035215	0.51982	-1.6309
+2	2	-0.10242	0.8127	0.41773	-1.1308	-0.30719	-0.80758
+1	1	-0.083462	-0.4565	1.1556	0.3299	0.087362	0.31349
+1	2	-0.98158	0.01727	-1.3281	-1.4474	0.54555	-0.10096
+1	1	-0.80604	-0.19415	1.4986	1.3386	-0.16367	0.68271
+1	1	0.80082	-0.57853	1.0716	0.94015	-0.54114	0.032172
+2	2	2.0456	0.97954	-0.45536	-0.14332	-0.25819	-1.0833
+1	1	-0.30148	0.20623	0.64194	0.76414	-0.59067	0.64326
+1	1	-0.55625	-0.26957	1.8447	1.6568	-0.38077	0.58831
+1	2	0.11898	0.80706	-0.025844	-0.57984	-0.23395	-1.1554
+1	2	-0.095497	-1.0637	-0.92583	-0.57928	0.23695	-0.42992
+2	2	0.066154	0.73037	-0.73622	-0.57047	0.39169	0.40928
+1	1	0.81522	0.11381	0.68971	0.29219	0.037792	0.81502
+1	1	-0.65356	-0.20182	0.92089	0.92298	-0.5417	0.49215
+1	1	-0.90826	-0.10979	1.3847	0.75954	-0.20255	0.32975
+1	2	-0.25671	-1.1903	-1.4241	-1.6058	-0.062549	-1.3981
+2	2	-1.8038	-1.4801	-0.94121	-1.6244	0.4817	-0.0029469
+1	2	0.12651	0.028719	-1.5818	-1.0266	0.19779	-0.36357
+1	1	-1.0658	-0.58443	0.68956	0.35467	0.11177	1.5243
+1	2	0.14729	-0.15111	-0.027639	-0.2899	0.11533	-0.60305
+2	2	-0.76889	0.87161	-0.83556	-1.1777	-0.21878	-0.98527
+2	2	0.12252	0.49068	-0.2557	-1.5816	0.25332	-0.78715
+1	1	-0.40287	0.26456	0.62208	0.60909	0.36074	0.092703
+2	1	-0.78301	1.4641	1.3162	1.9448	-0.10841	0.9618
+1	2	-0.25018	-0.32797	-1.113	-1.6123	0.6272	-1.2718
+2	1	0.15804	-0.18147	2.4571	0.59504	-0.34056	0.8691
+2	1	-0.582	0.25738	1.4075	0.92251	-0.40889	0.66381
+1	1	-0.26827	0.58632	0.51883	1.5745	-0.13818	1.0526
+1	2	0.13453	0.18218	-0.51676	-0.54166	-0.36636	-1.206
+2	1	1.1502	0.36164	1.9983	1.0809	0.11272	0.67683
+1	2	0.27812	0.46559	-1.6109	-0.91039	0.3803	-0.71802
+2	1	0.15292	0.61921	0.71009	1.3063	-0.35819	0.8661
+1	2	0.19902	0.48986	-1.4026	-0.8495	0.47158	0.0622
+2	1	0.4838	1.1096	1.4392	1.1438	0.34739	0.084004
+1	1	-0.63609	-0.35105	0.63581	1.1939	-0.062938	0.91353
+1	2	0.64203	-0.5095	-1.7792	-0.88803	0.43482	-0.66314
+1	1	-0.18434	-0.48157	0.69942	0.56942	-0.019967	0.50506
+1	1	0.10168	-1.0928	1.2144	0.28313	0.22159	0.54058
+1	1	-0.18578	-0.45336	1.5468	0.99679	0.11821	1.0476
+1	2	-0.60607	-1.1275	-0.90963	-0.69014	-0.33163	-1.2734
+1	1	-0.35353	-0.42708	0.78989	0.14094	-0.056632	0.80598
+1	1	-0.020221	-1.1235	1.9782	-0.041281	0.19857	1.2488
+1	1	1.2346	-0.37121	1.3325	1.1237	-0.027458	1.0044
+2	2	-0.54489	1.6812	-0.59836	-0.012441	0.41243	-0.58835
+2	1	-0.029577	2.1707	1.3285	1.2109	0.29684	0.90646
+2	2	0.70774	1.0606	-1.3996	-0.020914	-0.60955	-1.2187
+2	1	0.07926	0.52862	1.3994	0.54549	0.55303	0.16155
+1	1	0.041856	-0.92023	0.87269	-0.66601	-0.15945	0.1004
+1	2	0.17665	0.31945	-1.7756	-0.60442	0.020525	-1.0625
+1	1	-0.090238	-0.65111	0.56993	-0.4117	-0.19486	-0.18849
+1	2	0.059166	-0.47194	-0.69068	-0.41022	0.25867	-0.057175
+1	2	0.10473	0.66887	0.082035	-0.55975	-0.28439	-1.468
+1	1	-0.20937	-0.36621	0.09609	0.28164	0.24673	-0.11107
+1	2	-1.2678	0.22369	-0.42201	-0.70103	0.075915	-1.3347
+1	2	-0.35467	0.11166	-0.42144	-0.095223	-0.29936	-0.68322
+2	2	0.84875	1.24	-0.81217	0.084034	-0.32224	-1.6241
+2	1	-0.45939	1.3208	0.97993	1.2991	-0.015791	1.487
+1	2	-0.42254	-0.57928	-0.58529	-2.2375	0.51999	-0.79909
+2	1	0.32092	-0.13796	0.67098	0.24639	-0.36066	-0.032948
+1	2	-1.2408	-0.94836	0.026276	-0.37981	-0.02237	-0.38777
+2	2	0.20959	2.1466	-1.7027	-1.3169	-0.16515	-1.046
+2	2	-0.10482	1.3773	-1.2998	-0.014223	0.34065	-0.35362
+1	2	-0.66188	-1.2477	-0.62084	0.27682	0.1674	-0.8918
+1	1	-0.97246	-0.73017	1.3843	1.5549	0.1067	0.85754
+1	1	0.74567	-0.032694	1.1153	0.97318	-0.0033905	0.85059
+2	2	0.29324	-0.090608	-0.4945	-1.0484	-0.14987	-1.0141
+2	1	-0.86818	0.44948	1.8531	0.51896	-0.021141	1.8486
+1	2	0.362	-0.29749	-0.66525	0.21709	-0.15594	-1.4087
+1	2	-0.17675	0.36465	-0.45423	-1.262	0.22968	-1.246
+1	2	-0.34633	-0.16067	-1.2216	-1.3019	-0.040891	-1.2935
+1	2	0.44608	-0.57732	0.25606	-1.1664	0.54705	-0.19859
+1	2	0.45398	-0.55214	-0.33433	-0.085418	-0.10094	-0.48509
+1	2	0.12407	0.022419	-1.0312	-0.47727	0.20924	-1.2961
+1	1	-0.76644	-1.1794	1.2345	0.84756	0.1532	0.77648
+1	2	-0.10329	-0.53768	-0.67677	-0.58708	-0.014634	-0.036347
+1	1	0.2378	0.15372	0.49652	0.29193	0.19047	1.152
+1	2	0.024605	-0.38937	-0.89907	-0.42106	0.16921	-0.80893
+1	2	0.28812	0.26265	-0.94234	-0.88527	-0.49803	0.48254
+1	1	0.85086	0.11783	1.5014	1.2382	0.24441	1.3649
+2	2	0.86172	0.14894	-0.4846	-1.3488	-0.41844	-1.1372
+1	2	0.67971	-0.27488	-0.50687	-0.79153	-0.093399	-1.391
+1	1	-0.91977	-0.66099	0.5801	0.46587	-0.2263	1.43
+1	2	0.88213	-0.48674	-0.42406	-1.2762	0.28981	-1.0813
+2	1	-0.36583	0.51518	1.4491	1.4995	-0.073755	1.1218
+1	1	-0.54006	-0.59443	0.81263	0.65809	-0.15621	1.2508
+2	2	1.2125	-0.012648	-0.92657	-0.81972	-0.1536	-1.0176
+1	2	0.42493	0.34558	-1.7672	-1.3503	-0.045928	0.37449
+1	1	0.17097	-0.86593	-0.13424	1.0257	0.058014	0.91044
+2	1	-1.393	0.5338	1.8514	2.291	0.15305	0.30028
+1	1	-0.58552	-1.5337	1.5133	0.9976	0.64638	1.4428
+1	2	0.046272	-0.56387	-0.86063	-1.0462	0.014457	-1.3038
+1	2	0.34933	-0.16796	-0.27854	-0.27327	-0.0040928	-0.17912
+1	1	-1.0672	0.3979	1.208	0.50111	-0.013978	0.015097
+1	2	0.31052	-0.46723	-1.1237	0.59267	0.30978	-1.0169
+1	2	-0.55337	-0.42776	-0.12612	-0.41838	-0.56558	-0.58189
+2	2	0.3925	0.15644	-0.72963	-0.66601	-0.10837	-0.27787
+1	2	-0.48513	-1.4119	-0.16889	-0.19646	-0.068098	-0.084247
+2	2	0.16692	1.5447	-1.3064	-1.3338	-0.25668	-0.48832
+1	2	-0.36092	0.31518	-0.44815	-1.4019	-0.47505	-0.37187
+1	1	-1.8192	-0.57745	1.1304	0.262	-0.3595	0.58577
+1	1	-0.065383	0.07156	1.4931	2.3215	0.85149	1.4585
+2	1	-1.119	0.70896	1.0498	0.74334	0.75838	1.6107
+2	2	-0.17682	-0.21029	-0.74465	-0.83806	0.10827	-1.2829
+1	2	0.69834	-0.082402	0.64008	-0.83119	-0.26766	0.36961
+2	2	-0.28266	1.1929	-0.15174	0.098554	-0.33989	-0.6376
+2	2	1.5369	1.8434	0.0030761	-0.59703	0.14497	-1.5165
+1	2	0.35023	-0.28475	-0.93594	-1.0937	-0.46614	-2.188
+2	1	0.62308	1.0873	-0.0037182	0.86847	-0.48699	-0.10105
+1	1	-1.0408	-0.99866	2.0799	1.1634	0.092516	0.30401
+1	1	-0.87125	-0.88987	1.0278	1.0157	-0.23725	1.2377
+1	2	-0.020591	-0.03398	-0.024834	-1.3588	-0.045961	-0.89693
+1	1	0.9213	-0.57037	1.044	1.2994	0.046517	0.66563
+1	2	-0.87288	-0.96382	-0.704	-1.2184	0.046903	-0.30008
+1	2	0.77586	-0.34168	-0.09867	-0.37744	-0.24309	-0.13441
+2	1	0.19521	0.67595	1.4533	1.5115	0.19553	0.79596
+2	1	-1.3273	1.0891	1.2544	0.98928	0.045725	0.54963
+2	2	0.59176	0.65915	-0.84578	-0.080229	-0.26961	0.24045
+1	2	-0.66958	-1.042	-1.2138	-0.7612	-0.22775	-0.40062
+1	2	1.1154	-0.57069	-0.6592	-2.1961	-0.013175	0.46007
+1	2	-0.5254	0.0031225	-0.77758	0.8169	0.13224	-0.65572
+2	1	0.24551	1.5078	0.10719	1.1454	0.70578	0.59051
+1	2	0.29875	-0.11455	-1.0497	-0.77881	0.080708	-0.48337
+1	1	-0.1047	0.011628	1.2504	0.41776	-0.20102	1.2252
+1	2	0.44808	-0.8165	-0.080134	-0.49618	0.051011	-0.71722
+2	1	2.0365	1.5592	1.3257	1.2472	-0.47899	0.10943
+1	1	-0.16507	-0.66011	0.98739	0.58519	0.245	-0.43277
+1	2	-0.028366	-0.16961	-1.3266	0.14248	-0.24634	-1.1154
+2	1	0.92842	1.8842	1.3169	1.0358	-0.20988	0.88021
+2	2	0.33158	0.32463	-0.50924	0.40233	0.54391	-0.24309
+1	2	1.2555	0.1928	-0.487	0.048779	-0.23483	-1.477
+2	1	0.75021	0.85943	-0.2323	0.10748	-0.68906	0.84276
+2	2	0.6297	1.7397	-1.6136	-0.43268	-0.21442	-0.77462
+2	1	0.53168	1.0807	1.0853	0.62304	0.44036	0.48087
+1	2	-0.31256	-0.69771	-0.88556	-1.333	0.038614	-1.5744
+1	2	-0.039695	-0.52447	0.91401	-0.93272	0.53434	-0.080746
+2	1	-0.16596	0.56821	0.76008	0.45442	0.10286	0.6539
+1	2	-0.4331	-0.89669	-1.3097	-1.2157	0.1065	-0.8512
+1	2	-0.34708	-0.51457	-1.012	-0.39437	-0.55374	-1.144
+2	2	0.024082	0.7128	-1.3702	-1.4492	-0.10228	-0.59071
+1	2	-0.0037109	-0.68845	-0.649	-0.91581	0.066805	-0.98583
+2	1	0.68706	0.067424	0.87139	0.7938	-0.099645	1.529
+2	2	-0.31183	0.57814	-0.80815	-0.66724	-0.31919	-0.61319
+1	2	-0.11153	-0.6246	-0.27979	-0.18363	0.83639	0.014919
+2	2	0.20406	1.5838	-0.96334	-1.1228	-0.17808	-1.2123
+2	2	-0.1134	0.63358	-0.53321	-0.84276	-0.27657	-0.36992
+1	2	0.25517	0.67006	-0.1349	0.18275	0.40982	-0.62487
+1	1	-1.2684	0.31042	0.91155	0.66143	0.2483	-0.12434
+1	1	-0.97542	-0.85419	0.7663	0.16362	-0.18737	0.67266
+1	2	-0.043882	-0.62746	-0.82816	-0.40626	-0.051048	-0.61297
+1	1	0.59605	-0.45852	1.2962	0.78156	-0.48154	0.17778
+2	2	-0.06266	1.1144	-0.80524	-0.3189	-0.16038	-0.96372
+1	2	-1.1821	1.0798	-1.3407	-0.52643	0.12458	-0.7871
+2	2	0.59446	0.89186	-0.97856	-0.64658	0.2712	-1.5538
+1	2	0.15067	0.41827	-1.0487	-1.0551	0.19143	-1.4537
+1	2	-1.073	0.022587	-1.7088	-1.3777	0.1964	-0.84025
+2	1	0.20928	1.8026	1.2073	2.78	0.15131	0.3448
+1	2	-1.1317	-0.6359	-0.70457	-1.676	-0.22886	-0.58769
+1	1	-0.039428	-0.58746	0.56	0.7896	-0.052581	0.99511
+1	2	0.55023	-0.20403	0.138	-0.70518	0.66927	-0.28861
+2	2	0.57423	1.1886	0.092876	0.025677	-0.41099	-1.2858
+2	2	-0.14179	1.5827	-0.94328	0.7703	-0.43967	-0.50448
+2	2	0.14666	1.0492	-0.0030259	-0.62418	-0.087515	-0.048386
+
diff --git a/sourcecodes/data/example2/hQGgraphviz.txt b/sourcecodes/data/example2/hQGgraphviz.txt
new file mode 100644
index 00000000..7f279843
--- /dev/null
+++ b/sourcecodes/data/example2/hQGgraphviz.txt
@@ -0,0 +1,11 @@
+digraph G {
+size="10,10";  ratio = fill;
+node [shape=square,width=1.5];
+Geno1 -> Trait2;
+Geno2 -> Trait3;
+Geno2 -> Trait4;
+Geno2 -> Trait6;
+Trait2 -> Trait1;
+Trait2 -> Trait4;
+Trait3 -> Trait4;
+}
\ No newline at end of file
diff --git a/sourcecodes/data/example2/hQGk.txt b/sourcecodes/data/example2/hQGk.txt
new file mode 100644
index 00000000..29d6383b
--- /dev/null
+++ b/sourcecodes/data/example2/hQGk.txt
@@ -0,0 +1 @@
+100
diff --git a/sourcecodes/data/example2/hQGmap.txt b/sourcecodes/data/example2/hQGmap.txt
new file mode 100644
index 00000000..032b8928
--- /dev/null
+++ b/sourcecodes/data/example2/hQGmap.txt
@@ -0,0 +1,8 @@
+Geno1	1	0.473175	1.335000
+Geno2	2	0.496318	1.570000
+Trait1	1	0.668009	-0.023903
+Trait2	1	0.796873	0.038552
+Trait3	2	1.036694	0.068708
+Trait4	1	0.984008	-0.010125
+Trait5	1	0.316471	0.008911
+Trait6	1	0.904542	-0.114267
diff --git a/sourcecodes/data/example2/hQGmapdata.txt b/sourcecodes/data/example2/hQGmapdata.txt
new file mode 100644
index 00000000..42b2fd9c
--- /dev/null
+++ b/sourcecodes/data/example2/hQGmapdata.txt
@@ -0,0 +1 @@
+Trait5	Geno2	Trait6	Trait3	Geno1	Trait2	Trait4	Trait1
diff --git a/sourcecodes/data/example2/hQGname.txt b/sourcecodes/data/example2/hQGname.txt
new file mode 100644
index 00000000..8f42b468
--- /dev/null
+++ b/sourcecodes/data/example2/hQGname.txt
@@ -0,0 +1 @@
+Geno1	Geno2	Trait1	Trait2	Trait3	Trait4	Trait5	Trait6
diff --git a/sourcecodes/data/example2/hQGnet_figure.txt b/sourcecodes/data/example2/hQGnet_figure.txt
new file mode 100644
index 00000000..893f9f14
--- /dev/null
+++ b/sourcecodes/data/example2/hQGnet_figure.txt
@@ -0,0 +1,652 @@
+8
+1200	1200	
+Trait5	0	0
+Geno2	300	0
+Trait6	120	300
+Trait3	420	300
+Geno1	600	0
+Trait2	720	300
+Trait4	100	600
+Trait1	500	600
+Trait5	1
+250	150
+0
+0
+-3.2055	0.0025
+-3.1368	0.0030
+-3.0681	0.0038
+-2.9994	0.0046
+-2.9308	0.0057
+-2.8621	0.0069
+-2.7934	0.0083
+-2.7247	0.0101
+-2.6561	0.0121
+-2.5874	0.0144
+-2.5187	0.0172
+-2.4500	0.0203
+-2.3813	0.0240
+-2.3127	0.0281
+-2.2440	0.0328
+-2.1753	0.0381
+-2.1066	0.0441
+-2.0379	0.0508
+-1.9693	0.0582
+-1.9006	0.0664
+-1.8319	0.0754
+-1.7632	0.0852
+-1.6945	0.0958
+-1.6259	0.1073
+-1.5572	0.1195
+-1.4885	0.1326
+-1.4198	0.1463
+-1.3511	0.1608
+-1.2825	0.1758
+-1.2138	0.1914
+-1.1451	0.2074
+-1.0764	0.2237
+-1.0078	0.2401
+-0.9391	0.2565
+-0.8704	0.2728
+-0.8017	0.2888
+-0.7330	0.3042
+-0.6644	0.3190
+-0.5957	0.3330
+-0.5270	0.3460
+-0.4583	0.3578
+-0.3896	0.3682
+-0.3210	0.3772
+-0.2523	0.3846
+-0.1836	0.3904
+-0.1149	0.3944
+-0.0462	0.3965
+0.0224	0.3969
+0.0911	0.3953
+0.1598	0.3920
+0.2285	0.3868
+0.2971	0.3800
+0.3658	0.3715
+0.4345	0.3615
+0.5032	0.3502
+0.5719	0.3376
+0.6405	0.3240
+0.7092	0.3095
+0.7779	0.2942
+0.8466	0.2784
+0.9153	0.2622
+0.9839	0.2458
+1.0526	0.2294
+1.1213	0.2130
+1.1900	0.1969
+1.2587	0.1812
+1.3273	0.1659
+1.3960	0.1513
+1.4647	0.1373
+1.5334	0.1240
+1.6021	0.1114
+1.6707	0.0997
+1.7394	0.0888
+1.8081	0.0787
+1.8768	0.0694
+1.9454	0.0610
+2.0141	0.0533
+2.0828	0.0464
+2.1515	0.0401
+2.2202	0.0346
+2.2888	0.0297
+2.3575	0.0253
+2.4262	0.0215
+2.4949	0.0182
+2.5636	0.0153
+2.6322	0.0129
+2.7009	0.0107
+2.7696	0.0089
+2.8383	0.0074
+2.9070	0.0061
+2.9756	0.0050
+3.0443	0.0040
+3.1130	0.0033
+3.1817	0.0026
+3.2503	0.0021
+3.3190	0.0017
+3.3877	0.0014
+3.4564	0.0011
+3.5251	0.0008
+3.5937	0.0007
+3.6624	0.0005
+Geno2	2
+250	150
+0
+3	3	4	7
+1	0.4300
+2	0.5700
+Trait6	1
+250	150
+1	2
+0
+-3.6825	0.0005
+-3.6140	0.0006
+-3.5455	0.0008
+-3.4769	0.0010
+-3.4084	0.0013
+-3.3399	0.0016
+-3.2713	0.0020
+-3.2028	0.0025
+-3.1343	0.0031
+-3.0658	0.0038
+-2.9972	0.0046
+-2.9287	0.0057
+-2.8602	0.0069
+-2.7917	0.0084
+-2.7231	0.0101
+-2.6546	0.0121
+-2.5861	0.0145
+-2.5176	0.0172
+-2.4490	0.0204
+-2.3805	0.0240
+-2.3120	0.0282
+-2.2435	0.0329
+-2.1749	0.0382
+-2.1064	0.0441
+-2.0379	0.0508
+-1.9694	0.0582
+-1.9008	0.0664
+-1.8323	0.0753
+-1.7638	0.0851
+-1.6953	0.0957
+-1.6267	0.1071
+-1.5582	0.1193
+-1.4897	0.1323
+-1.4212	0.1461
+-1.3526	0.1605
+-1.2841	0.1755
+-1.2156	0.1910
+-1.1471	0.2069
+-1.0785	0.2232
+-1.0100	0.2396
+-0.9415	0.2560
+-0.8730	0.2722
+-0.8044	0.2881
+-0.7359	0.3036
+-0.6674	0.3184
+-0.5989	0.3324
+-0.5303	0.3454
+-0.4618	0.3572
+-0.3933	0.3677
+-0.3248	0.3768
+-0.2562	0.3843
+-0.1877	0.3901
+-0.1192	0.3942
+-0.0507	0.3965
+0.0179	0.3969
+0.0864	0.3955
+0.1549	0.3923
+0.2234	0.3873
+0.2920	0.3806
+0.3605	0.3722
+0.4290	0.3624
+0.4975	0.3512
+0.5661	0.3387
+0.6346	0.3252
+0.7031	0.3108
+0.7716	0.2956
+0.8402	0.2799
+0.9087	0.2638
+0.9772	0.2474
+1.0457	0.2310
+1.1143	0.2147
+1.1828	0.1986
+1.2513	0.1829
+1.3198	0.1676
+1.3884	0.1529
+1.4569	0.1388
+1.5254	0.1255
+1.5939	0.1129
+1.6625	0.1011
+1.7310	0.0901
+1.7995	0.0799
+1.8680	0.0706
+1.9366	0.0620
+2.0051	0.0542
+2.0736	0.0472
+2.1421	0.0409
+2.2107	0.0353
+2.2792	0.0303
+2.3477	0.0259
+2.4162	0.0221
+2.4848	0.0187
+2.5533	0.0157
+2.6218	0.0132
+2.6903	0.0110
+2.7589	0.0092
+2.8274	0.0076
+2.8959	0.0062
+2.9644	0.0051
+3.0330	0.0042
+3.1015	0.0034
+3.1700	0.0027
+Trait3	1
+250	150
+1	2
+1	7
+-2.7825	0.0086
+-2.7216	0.0101
+-2.6608	0.0119
+-2.5999	0.0140
+-2.5390	0.0163
+-2.4782	0.0190
+-2.4173	0.0220
+-2.3565	0.0254
+-2.2956	0.0292
+-2.2347	0.0335
+-2.1739	0.0383
+-2.1130	0.0435
+-2.0521	0.0494
+-1.9913	0.0558
+-1.9304	0.0627
+-1.8695	0.0704
+-1.8087	0.0786
+-1.7478	0.0875
+-1.6870	0.0970
+-1.6261	0.1072
+-1.5652	0.1180
+-1.5044	0.1295
+-1.4435	0.1415
+-1.3826	0.1541
+-1.3218	0.1672
+-1.2609	0.1807
+-1.2000	0.1946
+-1.1392	0.2088
+-1.0783	0.2232
+-1.0175	0.2378
+-0.9566	0.2524
+-0.8957	0.2668
+-0.8349	0.2811
+-0.7740	0.2951
+-0.7131	0.3086
+-0.6523	0.3216
+-0.5914	0.3338
+-0.5305	0.3453
+-0.4697	0.3559
+-0.4088	0.3654
+-0.3480	0.3739
+-0.2871	0.3811
+-0.2262	0.3870
+-0.1654	0.3916
+-0.1045	0.3948
+-0.0436	0.3966
+0.0172	0.3969
+0.0781	0.3958
+0.1389	0.3932
+0.1998	0.3892
+0.2607	0.3838
+0.3215	0.3772
+0.3824	0.3692
+0.4433	0.3602
+0.5041	0.3500
+0.5650	0.3389
+0.6259	0.3270
+0.6867	0.3143
+0.7476	0.3010
+0.8084	0.2872
+0.8693	0.2731
+0.9302	0.2587
+0.9910	0.2441
+1.0519	0.2295
+1.1128	0.2150
+1.1736	0.2007
+1.2345	0.1867
+1.2954	0.1730
+1.3562	0.1597
+1.4171	0.1469
+1.4779	0.1346
+1.5388	0.1229
+1.5997	0.1118
+1.6605	0.1014
+1.7214	0.0916
+1.7823	0.0824
+1.8431	0.0739
+1.9040	0.0660
+1.9649	0.0587
+2.0257	0.0521
+2.0866	0.0460
+2.1474	0.0405
+2.2083	0.0355
+2.2692	0.0310
+2.3300	0.0270
+2.3909	0.0234
+2.4518	0.0202
+2.5126	0.0174
+2.5735	0.0150
+2.6344	0.0128
+2.6952	0.0109
+2.7561	0.0092
+2.8169	0.0078
+2.8778	0.0066
+2.9387	0.0055
+2.9995	0.0046
+3.0604	0.0038
+3.1213	0.0032
+3.1821	0.0026
+3.2430	0.0022
+3.3039	0.0018
+Geno1	2
+250	150
+0
+1	6
+1	0.6650
+2	0.3350
+Trait2	1
+250	150
+1	5
+2	7	8
+-3.0753	0.0037
+-3.0078	0.0045
+-2.9403	0.0055
+-2.8728	0.0067
+-2.8053	0.0081
+-2.7378	0.0097
+-2.6702	0.0116
+-2.6027	0.0139
+-2.5352	0.0165
+-2.4677	0.0195
+-2.4002	0.0229
+-2.3327	0.0268
+-2.2652	0.0313
+-2.1977	0.0363
+-2.1302	0.0420
+-2.0627	0.0483
+-1.9951	0.0553
+-1.9276	0.0631
+-1.8601	0.0716
+-1.7926	0.0809
+-1.7251	0.0910
+-1.6576	0.1019
+-1.5901	0.1135
+-1.5226	0.1260
+-1.4551	0.1392
+-1.3876	0.1530
+-1.3201	0.1675
+-1.2525	0.1826
+-1.1850	0.1981
+-1.1175	0.2139
+-1.0500	0.2300
+-0.9825	0.2462
+-0.9150	0.2623
+-0.8475	0.2782
+-0.7800	0.2937
+-0.7125	0.3088
+-0.6450	0.3231
+-0.5775	0.3366
+-0.5099	0.3490
+-0.4424	0.3603
+-0.3749	0.3703
+-0.3074	0.3788
+-0.2399	0.3858
+-0.1724	0.3912
+-0.1049	0.3948
+-0.0374	0.3967
+0.0301	0.3968
+0.0976	0.3951
+0.1652	0.3916
+0.2327	0.3865
+0.3002	0.3796
+0.3677	0.3713
+0.4352	0.3614
+0.5027	0.3503
+0.5702	0.3379
+0.6377	0.3246
+0.7052	0.3103
+0.7727	0.2954
+0.8402	0.2799
+0.9078	0.2640
+0.9753	0.2479
+1.0428	0.2317
+1.1103	0.2156
+1.1778	0.1998
+1.2453	0.1842
+1.3128	0.1691
+1.3803	0.1546
+1.4478	0.1406
+1.5153	0.1274
+1.5829	0.1148
+1.6504	0.1031
+1.7179	0.0921
+1.7854	0.0819
+1.8529	0.0725
+1.9204	0.0640
+1.9879	0.0561
+2.0554	0.0490
+2.1229	0.0426
+2.1904	0.0369
+2.2579	0.0318
+2.3255	0.0273
+2.3930	0.0233
+2.4605	0.0198
+2.5280	0.0168
+2.5955	0.0141
+2.6630	0.0119
+2.7305	0.0099
+2.7980	0.0082
+2.8655	0.0068
+2.9330	0.0056
+3.0005	0.0046
+3.0681	0.0038
+3.1356	0.0031
+3.2031	0.0025
+3.2706	0.0020
+3.3381	0.0016
+3.4056	0.0013
+3.4731	0.0010
+3.5406	0.0008
+3.6081	0.0006
+3.6756	0.0005
+Trait4	1
+250	150
+3	2	4	6
+0
+-3.2636	0.0025
+-3.1926	0.0031
+-3.1216	0.0039
+-3.0506	0.0048
+-2.9796	0.0059
+-2.9086	0.0071
+-2.8376	0.0086
+-2.7666	0.0104
+-2.6957	0.0125
+-2.6247	0.0150
+-2.5537	0.0178
+-2.4827	0.0211
+-2.4117	0.0248
+-2.3407	0.0291
+-2.2697	0.0340
+-2.1987	0.0395
+-2.1277	0.0456
+-2.0567	0.0525
+-1.9857	0.0601
+-1.9148	0.0685
+-1.8438	0.0777
+-1.7728	0.0877
+-1.7018	0.0986
+-1.6308	0.1102
+-1.5598	0.1226
+-1.4888	0.1358
+-1.4178	0.1497
+-1.3468	0.1643
+-1.2758	0.1794
+-1.2049	0.1949
+-1.1339	0.2108
+-1.0629	0.2270
+-0.9919	0.2432
+-0.9209	0.2593
+-0.8499	0.2751
+-0.7789	0.2906
+-0.7079	0.3055
+-0.6369	0.3196
+-0.5659	0.3328
+-0.4949	0.3448
+-0.4240	0.3557
+-0.3530	0.3651
+-0.2820	0.3730
+-0.2110	0.3792
+-0.1400	0.3838
+-0.0690	0.3865
+0.0020	0.3874
+0.0730	0.3865
+0.1440	0.3838
+0.2150	0.3792
+0.2859	0.3730
+0.3569	0.3651
+0.4279	0.3557
+0.4989	0.3448
+0.5699	0.3328
+0.6409	0.3196
+0.7119	0.3055
+0.7829	0.2906
+0.8539	0.2752
+0.9249	0.2593
+0.9959	0.2432
+1.0668	0.2270
+1.1378	0.2109
+1.2088	0.1950
+1.2798	0.1794
+1.3508	0.1643
+1.4218	0.1498
+1.4928	0.1358
+1.5638	0.1227
+1.6348	0.1102
+1.7058	0.0986
+1.7767	0.0877
+1.8477	0.0777
+1.9187	0.0685
+1.9897	0.0601
+2.0607	0.0525
+2.1317	0.0456
+2.2027	0.0395
+2.2737	0.0340
+2.3447	0.0291
+2.4157	0.0248
+2.4867	0.0211
+2.5576	0.0178
+2.6286	0.0150
+2.6996	0.0125
+2.7706	0.0104
+2.8416	0.0086
+2.9126	0.0071
+2.9836	0.0059
+3.0546	0.0048
+3.1256	0.0039
+3.1966	0.0031
+3.2675	0.0025
+3.3385	0.0020
+3.4095	0.0016
+3.4805	0.0013
+3.5515	0.0010
+3.6225	0.0008
+3.6935	0.0006
+3.7645	0.0005
+3.8355	0.0004
+Trait1	1
+250	150
+1	6
+0
+-3.6875	0.0005
+-3.6097	0.0006
+-3.5318	0.0008
+-3.4540	0.0011
+-3.3761	0.0014
+-3.2983	0.0018
+-3.2204	0.0024
+-3.1425	0.0030
+-3.0647	0.0038
+-2.9868	0.0048
+-2.9090	0.0061
+-2.8311	0.0076
+-2.7533	0.0094
+-2.6754	0.0115
+-2.5976	0.0141
+-2.5197	0.0172
+-2.4418	0.0208
+-2.3640	0.0251
+-2.2861	0.0300
+-2.2083	0.0356
+-2.1304	0.0421
+-2.0526	0.0495
+-1.9747	0.0577
+-1.8969	0.0670
+-1.8190	0.0773
+-1.7411	0.0887
+-1.6633	0.1011
+-1.5854	0.1145
+-1.5076	0.1290
+-1.4297	0.1444
+-1.3519	0.1608
+-1.2740	0.1778
+-1.1962	0.1956
+-1.1183	0.2138
+-1.0404	0.2323
+-0.9626	0.2509
+-0.8847	0.2694
+-0.8069	0.2875
+-0.7290	0.3050
+-0.6512	0.3216
+-0.5733	0.3371
+-0.4955	0.3513
+-0.4176	0.3639
+-0.3397	0.3746
+-0.2619	0.3834
+-0.1840	0.3900
+-0.1062	0.3944
+-0.0283	0.3964
+0.0495	0.3961
+0.1274	0.3934
+0.2052	0.3884
+0.2831	0.3812
+0.3610	0.3719
+0.4388	0.3606
+0.5167	0.3476
+0.5945	0.3330
+0.6724	0.3172
+0.7502	0.3003
+0.8281	0.2826
+0.9059	0.2644
+0.9838	0.2458
+1.0617	0.2272
+1.1395	0.2088
+1.2174	0.1907
+1.2952	0.1731
+1.3731	0.1562
+1.4509	0.1401
+1.5288	0.1250
+1.6066	0.1108
+1.6845	0.0976
+1.7624	0.0855
+1.8402	0.0744
+1.9181	0.0644
+1.9959	0.0554
+2.0738	0.0474
+2.1516	0.0403
+2.2295	0.0340
+2.3073	0.0286
+2.3852	0.0238
+2.4631	0.0198
+2.5409	0.0163
+2.6188	0.0134
+2.6966	0.0109
+2.7745	0.0088
+2.8523	0.0071
+2.9302	0.0057
+3.0080	0.0045
+3.0859	0.0036
+3.1638	0.0028
+3.2416	0.0022
+3.3195	0.0017
+3.3973	0.0013
+3.4752	0.0010
+3.5530	0.0008
+3.6309	0.0006
+3.7087	0.0004
+3.7866	0.0003
+3.8645	0.0002
+3.9423	0.0002
+4.0202	0.0001
+4.0980	0.0001
diff --git a/sourcecodes/data/example2/hQGnlevels.txt b/sourcecodes/data/example2/hQGnlevels.txt
new file mode 100644
index 00000000..32457058
--- /dev/null
+++ b/sourcecodes/data/example2/hQGnlevels.txt
@@ -0,0 +1,4 @@
+Geno1	1	2
+Geno2	1	2
+
+
diff --git a/sourcecodes/data/example2/hQGnnode.txt b/sourcecodes/data/example2/hQGnnode.txt
new file mode 100644
index 00000000..45a4fb75
--- /dev/null
+++ b/sourcecodes/data/example2/hQGnnode.txt
@@ -0,0 +1 @@
+8
diff --git a/sourcecodes/data/example2/hQGnrows.txt b/sourcecodes/data/example2/hQGnrows.txt
new file mode 100644
index 00000000..3bc92d44
--- /dev/null
+++ b/sourcecodes/data/example2/hQGnrows.txt
@@ -0,0 +1 @@
+201
diff --git a/sourcecodes/data/example2/hQGparent.txt b/sourcecodes/data/example2/hQGparent.txt
new file mode 100644
index 00000000..b8626c4c
--- /dev/null
+++ b/sourcecodes/data/example2/hQGparent.txt
@@ -0,0 +1 @@
+4
diff --git a/sourcecodes/data/example2/hQGrun_initialstructure.sh b/sourcecodes/data/example2/hQGrun_initialstructure.sh
new file mode 100644
index 00000000..7d4cbfea
--- /dev/null
+++ b/sourcecodes/data/example2/hQGrun_initialstructure.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+# script for execution of deployed applications
+#
+# Sets up the MCR environment for the current $ARCH and executes 
+# the specified command.
+#
+exe_name=$0
+exe_dir=`dirname "$0"`
+echo "------------------------------------------"
+if [ "x$1" = "x" ]; then
+  echo Usage:
+  echo    $0 \<deployedMCRroot\> args
+else
+  echo Setting up environment variables
+  MCRROOT="$1"
+  echo ---
+  LD_LIBRARY_PATH=.:${MCRROOT}/runtime/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/bin/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/sys/os/glnxa64;
+	MCRJRE=${MCRROOT}/sys/java/jre/glnxa64/jre/lib/amd64 ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/native_threads ; 
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/server ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/client ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE} ;  
+  XAPPLRESDIR=${MCRROOT}/X11/app-defaults ;
+  export LD_LIBRARY_PATH;
+  export XAPPLRESDIR;
+  echo LD_LIBRARY_PATH is ${LD_LIBRARY_PATH};
+  shift 1
+  args=
+  while [ $# -gt 0 ]; do
+      token=`echo "$1" | sed 's/ /\\\\ /g'`   # Add blackslash before each blank
+      args="${args} ${token}" 
+      shift
+  done
+  "${exe_dir}"/initialstructure hQG
+fi
+exit
diff --git a/sourcecodes/data/example2/hQGstructure_input.txt b/sourcecodes/data/example2/hQGstructure_input.txt
new file mode 100644
index 00000000..410c0fa4
--- /dev/null
+++ b/sourcecodes/data/example2/hQGstructure_input.txt
@@ -0,0 +1,9 @@
+Geno1	Geno2	Trait1	Trait2	Trait3	Trait4	Trait5	Trait6	
+0	0	0	1	0	0	0	0	
+0	0	0	0	1	1	0	1	
+0	0	0	0	0	0	0	0	
+0	0	1	0	0	1	0	0	
+0	0	0	0	0	1	0	0	
+0	0	0	0	0	0	0	0	
+0	0	0	0	0	0	0	0	
+0	0	0	0	0	0	0	0	
diff --git a/sourcecodes/data/example2/hQGstructure_input_temp.txt b/sourcecodes/data/example2/hQGstructure_input_temp.txt
new file mode 100644
index 00000000..63380a62
--- /dev/null
+++ b/sourcecodes/data/example2/hQGstructure_input_temp.txt
@@ -0,0 +1,9 @@
+Geno1	Geno2	Trait1	Trait2	Trait3	Trait4	Trait5	Trait6	
+0.000000	0.000000	0.000000	1.000000	0.000000	0.000000	0.350069	0.000000	
+0.030654	0.000000	0.049399	0.000000	1.000000	1.000000	0.000000	1.000000	
+0.000000	0.000000	0.000000	0.000000	0.025163	0.000000	0.123845	0.000000	
+0.000000	0.000000	1.000000	0.000000	0.000000	1.000000	0.053585	0.000000	
+0.000000	0.000000	0.000000	0.108604	0.000000	1.000000	0.010570	0.000000	
+0.000000	0.000000	0.013713	0.000000	0.000000	0.000000	0.011282	0.000000	
+0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.137567	
+0.000000	0.000000	0.136004	0.056792	0.457123	0.029978	0.000000	0.000000	
diff --git a/sourcecodes/data/example2/hQGstructure_old.txt b/sourcecodes/data/example2/hQGstructure_old.txt
new file mode 100644
index 00000000..f979ea93
--- /dev/null
+++ b/sourcecodes/data/example2/hQGstructure_old.txt
@@ -0,0 +1,7 @@
+Geno1	0.6650	0.3350
+Trait2	0.0037	0.0045	0.0055	0.0067	0.0081	0.0097	0.0116	0.0139	0.0165	0.0195	0.0229	0.0268	0.0313	0.0363	0.0420	0.0483	0.0553	0.0631	0.0716	0.0809	0.0910	0.1019	0.1135	0.1260	0.1392	0.1530	0.1675	0.1826	0.1981	0.2139	0.2300	0.2462	0.2623	0.2782	0.2937	0.3088	0.3231	0.3366	0.3490	0.3603	0.3703	0.3788	0.3858	0.3912	0.3948	0.3967	0.3968	0.3951	0.3916	0.3865	0.3796	0.3713	0.3614	0.3503	0.3379	0.3246	0.3103	0.2954	0.2799	0.2640	0.2479	0.2317	0.2156	0.1998	0.1842	0.1691	0.1546	0.1406	0.1274	0.1148	0.1031	0.0921	0.0819	0.0725	0.0640	0.0561	0.0490	0.0426	0.0369	0.0318	0.0273	0.0233	0.0198	0.0168	0.0141	0.0119	0.0099	0.0082	0.0068	0.0056	0.0046	0.0038	0.0031	0.0025	0.0020	0.0016	0.0013	0.0010	0.0008	0.0006	0.0005
+Geno2	0.4300	0.5700
+Trait3	0.0086	0.0101	0.0119	0.0140	0.0163	0.0190	0.0220	0.0254	0.0292	0.0335	0.0383	0.0435	0.0494	0.0558	0.0627	0.0704	0.0786	0.0875	0.0970	0.1072	0.1180	0.1295	0.1415	0.1541	0.1672	0.1807	0.1946	0.2088	0.2232	0.2378	0.2524	0.2668	0.2811	0.2951	0.3086	0.3216	0.3338	0.3453	0.3559	0.3654	0.3739	0.3811	0.3870	0.3916	0.3948	0.3966	0.3969	0.3958	0.3932	0.3892	0.3838	0.3772	0.3692	0.3602	0.3500	0.3389	0.3270	0.3143	0.3010	0.2872	0.2731	0.2587	0.2441	0.2295	0.2150	0.2007	0.1867	0.1730	0.1597	0.1469	0.1346	0.1229	0.1118	0.1014	0.0916	0.0824	0.0739	0.0660	0.0587	0.0521	0.0460	0.0405	0.0355	0.0310	0.0270	0.0234	0.0202	0.0174	0.0150	0.0128	0.0109	0.0092	0.0078	0.0066	0.0055	0.0046	0.0038	0.0032	0.0026	0.0022	0.0018
+Trait4	0.0025	0.0031	0.0039	0.0048	0.0059	0.0071	0.0086	0.0104	0.0125	0.0150	0.0178	0.0211	0.0248	0.0291	0.0340	0.0395	0.0456	0.0525	0.0601	0.0685	0.0777	0.0877	0.0986	0.1102	0.1226	0.1358	0.1497	0.1643	0.1794	0.1949	0.2108	0.2270	0.2432	0.2593	0.2751	0.2906	0.3055	0.3196	0.3328	0.3448	0.3557	0.3651	0.3730	0.3792	0.3838	0.3865	0.3874	0.3865	0.3838	0.3792	0.3730	0.3651	0.3557	0.3448	0.3328	0.3196	0.3055	0.2906	0.2752	0.2593	0.2432	0.2270	0.2109	0.1950	0.1794	0.1643	0.1498	0.1358	0.1227	0.1102	0.0986	0.0877	0.0777	0.0685	0.0601	0.0525	0.0456	0.0395	0.0340	0.0291	0.0248	0.0211	0.0178	0.0150	0.0125	0.0104	0.0086	0.0071	0.0059	0.0048	0.0039	0.0031	0.0025	0.0020	0.0016	0.0013	0.0010	0.0008	0.0006	0.0005	0.0004
+Trait6	0.0005	0.0006	0.0008	0.0010	0.0013	0.0016	0.0020	0.0025	0.0031	0.0038	0.0046	0.0057	0.0069	0.0084	0.0101	0.0121	0.0145	0.0172	0.0204	0.0240	0.0282	0.0329	0.0382	0.0441	0.0508	0.0582	0.0664	0.0753	0.0851	0.0957	0.1071	0.1193	0.1323	0.1461	0.1605	0.1755	0.1910	0.2069	0.2232	0.2396	0.2560	0.2722	0.2881	0.3036	0.3184	0.3324	0.3454	0.3572	0.3677	0.3768	0.3843	0.3901	0.3942	0.3965	0.3969	0.3955	0.3923	0.3873	0.3806	0.3722	0.3624	0.3512	0.3387	0.3252	0.3108	0.2956	0.2799	0.2638	0.2474	0.2310	0.2147	0.1986	0.1829	0.1676	0.1529	0.1388	0.1255	0.1129	0.1011	0.0901	0.0799	0.0706	0.0620	0.0542	0.0472	0.0409	0.0353	0.0303	0.0259	0.0221	0.0187	0.0157	0.0132	0.0110	0.0092	0.0076	0.0062	0.0051	0.0042	0.0034	0.0027
+Trait1	0.0005	0.0006	0.0008	0.0011	0.0014	0.0018	0.0024	0.0030	0.0038	0.0048	0.0061	0.0076	0.0094	0.0115	0.0141	0.0172	0.0208	0.0251	0.0300	0.0356	0.0421	0.0495	0.0577	0.0670	0.0773	0.0887	0.1011	0.1145	0.1290	0.1444	0.1608	0.1778	0.1956	0.2138	0.2323	0.2509	0.2694	0.2875	0.3050	0.3216	0.3371	0.3513	0.3639	0.3746	0.3834	0.3900	0.3944	0.3964	0.3961	0.3934	0.3884	0.3812	0.3719	0.3606	0.3476	0.3330	0.3172	0.3003	0.2826	0.2644	0.2458	0.2272	0.2088	0.1907	0.1731	0.1562	0.1401	0.1250	0.1108	0.0976	0.0855	0.0744	0.0644	0.0554	0.0474	0.0403	0.0340	0.0286	0.0238	0.0198	0.0163	0.0134	0.0109	0.0088	0.0071	0.0057	0.0045	0.0036	0.0028	0.0022	0.0017	0.0013	0.0010	0.0008	0.0006	0.0004	0.0003	0.0002	0.0002	0.0001	0.0001
diff --git a/sourcecodes/data/example2/hQGthr.txt b/sourcecodes/data/example2/hQGthr.txt
new file mode 100644
index 00000000..2eb3c4fe
--- /dev/null
+++ b/sourcecodes/data/example2/hQGthr.txt
@@ -0,0 +1 @@
+0.5
diff --git a/sourcecodes/data/example2/hQGtier.txt b/sourcecodes/data/example2/hQGtier.txt
new file mode 100644
index 00000000..bc94239b
--- /dev/null
+++ b/sourcecodes/data/example2/hQGtier.txt
@@ -0,0 +1 @@
+3,Tier1,0,Tier2,0,Tier3,0,
\ No newline at end of file
diff --git a/sourcecodes/data/example2/hQGtype.txt b/sourcecodes/data/example2/hQGtype.txt
new file mode 100644
index 00000000..285a68af
--- /dev/null
+++ b/sourcecodes/data/example2/hQGtype.txt
@@ -0,0 +1,2 @@
+Geno1	Geno2	Trait1	Trait2	Trait3	Trait4	Trait5	Trait6
+2	2	1	1	1	1	1	1	
diff --git a/sourcecodes/data/example2/hQGwhite.txt b/sourcecodes/data/example2/hQGwhite.txt
new file mode 100644
index 00000000..83e81b8b
--- /dev/null
+++ b/sourcecodes/data/example2/hQGwhite.txt
@@ -0,0 +1 @@
+From	To
diff --git a/sourcecodes/data/example2/standardized_data.txt b/sourcecodes/data/example2/standardized_data.txt
new file mode 100644
index 00000000..743e8b02
--- /dev/null
+++ b/sourcecodes/data/example2/standardized_data.txt
@@ -0,0 +1,201 @@
+Trait5	Geno2	Trait6	Trait3	Geno1	Trait2	Trait4	Trait1	
+1.8453	2	-0.70749	-1.3361	2	1.5443	-0.43784	0.72827
+0.9605	1	0.85158	1.5164	1	-1.1632	1.0263	-0.11408
+-0.63336	1	0.53936	1.1602	1	-0.74229	1.4011	-1.541
+1.3355	2	-1.7216	-0.76715	1	0.12195	-0.66179	0.099211
+0.36111	2	-0.74876	-0.98283	1	-2.0753	-1.2335	-0.99244
+-1.177	1	0.51257	0.84261	1	0.065663	1.2658	-0.64654
+0.076305	1	1.5888	1.7606	1	-0.66331	1.4736	0.39057
+-0.53841	2	0.11031	-1.5038	1	0.23456	-0.060179	0.14097
+-0.59968	1	0.48834	1.0431	1	-0.59377	0.22579	-0.99932
+0.37839	1	1.293	0.49142	1	-1.2855	0.37537	0.50786
+-0.98262	1	1.6051	0.57702	2	0.44497	0.92494	1.9396
+-0.32154	1	1.0249	0.77512	1	-0.62075	0.32547	1.8129
+0.094471	1	1.0318	1.5671	2	-0.60413	0.75183	-1.4864
+-0.2677	2	-1.3762	-0.039045	2	0.61004	-0.20296	-0.34315
+1.45	2	0.22686	-0.18131	1	-0.5462	-0.61255	-0.83409
+-0.94296	2	-1.0223	-1.1896	1	-0.4021	-1.2644	-1.2822
+-0.65504	2	-2.6825	-1.035	1	0.25776	-1.4615	0.84597
+1.3635	1	1.5647	0.59499	2	1.372	1.0621	0.74498
+0.60321	1	0.68692	1.4714	2	0.81867	1.711	0.90082
+-0.5142	2	-1.0962	-1.5522	1	-0.04535	-1.2401	-0.62273
+-1.2303	1	0.82027	1.0532	2	-0.12811	1.344	0.60516
+0.84008	2	-0.7159	-0.44987	1	-0.56344	-1.5572	1.0854
+0.47761	1	1.5622	1.2168	1	-0.30596	1.1251	-1.3723
+-1.3546	2	-0.7484	-0.096654	1	0.03293	0.23078	0.81604
+-0.32954	2	-1.6183	-0.57119	1	-0.9399	-1.5734	-0.76341
+0.57841	1	0.24378	0.681	1	-0.7778	1.305	0.77773
+0.11524	2	-0.85367	0.35424	2	2.3096	0.75697	1.7572
+1.1463	2	0.0096586	-0.25741	1	-0.52081	-1.5513	0.64513
+-1.3926	2	-0.88863	-0.68795	2	0.0060478	-0.43763	0.97179
+-0.34841	1	1.0004	0.23941	1	-0.83161	0.87503	-0.88918
+0.79176	1	0.59541	1.0092	1	-1.9591	0.77295	0.31259
+-1.7691	2	0.055429	-1.1837	2	1.1172	-0.091192	1.3241
+0.23812	2	-0.13588	-0.98943	1	-0.041159	-0.43704	-0.39754
+1.4262	1	0.46298	1.327	1	0.15808	1.1741	-0.073642
+1.3584	1	1.5511	0.49802	1	-0.96618	-0.037384	0.26987
+-0.45407	2	-0.11918	-0.20984	1	-0.84764	0.68704	0.15725
+1.3502	1	1.1228	1.7003	1	-0.34181	1.3601	0.19859
+0.51265	2	0.059243	-0.61724	1	-1.2675	-1.2719	-1.5483
+1.6144	2	-1.6767	-0.4403	2	-0.7614	0.046076	-0.6741
+-0.99883	2	-0.76648	0.33667	2	0.97148	-1.1389	-0.11754
+0.24789	1	0.4729	1.0484	1	-0.62124	0.34555	-0.08916
+1.6957	2	0.014711	-1.3474	1	-0.026706	-1.4606	-1.4336
+-0.54533	1	0.88108	1.3793	1	-0.29202	1.3706	-1.1708
+-1.7381	1	0.16189	0.96739	1	-0.77438	0.96572	1.2346
+-0.844	2	-1.0713	-0.50552	2	1.1809	-0.13536	3.098
+-1.8946	1	0.83747	0.55294	1	0.21042	0.78685	-0.41553
+-1.2313	1	0.77672	1.7131	1	-0.38666	1.694	-0.79692
+-0.7674	2	-1.151	-0.091205	1	0.9644	-0.57897	0.21389
+0.72057	2	-0.34897	-0.95934	1	-1.3832	-0.57841	-0.10718
+1.2095	2	0.5788	-0.77644	2	0.86817	-0.56945	0.13481
+0.09126	1	1.0274	0.59902	1	0.094442	0.30723	1.2562
+-1.7398	1	0.67041	0.82202	1	-0.30164	0.94827	-0.94259
+-0.66818	1	0.49087	1.2694	1	-0.18615	0.78217	-1.3239
+-0.2258	2	-1.4193	-1.44	1	-1.5421	-1.6216	-0.34851
+1.4939	2	0.12307	-0.97417	2	-1.9058	-1.6405	-2.6645
+0.59683	2	-0.27561	-1.5921	1	-0.012339	-1.033	0.22517
+0.32502	1	1.8115	0.59888	1	-0.78178	0.37072	-1.5597
+0.33627	2	-0.54037	-0.092937	1	-0.23801	-0.28432	0.25627
+-0.71947	2	-0.96292	-0.87226	2	1.0454	-1.1866	-1.1152
+0.7723	2	-0.74389	-0.31293	2	0.56738	-1.597	0.21919
+1.1117	1	0.22881	0.53378	1	0.28362	0.62928	-0.56731
+-0.37072	1	1.1896	1.2033	2	1.7889	1.9867	-1.1364
+1.9537	2	-1.2797	-1.1399	1	-0.45995	-1.6282	-0.33873
+-1.1043	1	1.0871	2.3039	2	-0.27611	0.615	0.27237
+-1.3202	1	0.86019	1.2914	2	0.27461	0.94779	-0.83546
+-0.46478	1	1.29	0.43419	1	0.6874	1.6104	-0.36581
+-1.1858	2	-1.2069	-0.56475	1	0.18024	-0.54017	0.23717
+0.32802	1	0.87458	1.8613	2	0.40544	1.1088	1.7576
+1.1735	2	-0.66747	-1.6202	1	0.53589	-0.9149	0.45212
+-1.16	1	1.0838	0.61868	2	0.72867	1.3378	0.2647
+1.462	2	0.19509	-1.4192	1	0.56635	-0.85302	0.33371
+1.0695	1	0.21919	1.322	2	1.3441	1.1727	0.76002
+-0.22703	1	1.1363	0.54703	1	-0.48891	1.2236	-0.91644
+1.3458	2	-0.6068	-1.7825	1	-0.68775	-0.89217	0.99689
+-0.091249	1	0.68469	0.60839	1	-0.6527	0.58896	-0.24017
+0.67203	1	0.72395	1.1051	1	-1.4197	0.29802	0.188
+0.34537	1	1.2845	1.4258	1	-0.6173	1.0233	-0.24233
+-1.0761	2	-1.2815	-0.94371	1	-1.4633	-0.69107	-0.8715
+-0.20711	1	1.0174	0.69566	1	-0.58432	0.15352	-0.49345
+0.59929	1	1.5069	1.8419	1	-1.4583	-0.031663	0.0055113
+-0.11492	1	1.2367	1.2191	1	-0.51421	1.1523	1.884
+1.2751	2	-0.52411	-0.64346	2	2.0614	-0.0023541	-0.77991
+0.90981	1	1.1284	1.2152	2	2.6756	1.2409	-0.0084945
+-1.9542	2	-1.221	-1.4163	2	1.2826	-0.010965	1.0953
+1.7193	1	0.30492	1.2836	2	0.61499	0.56464	0.15443
+-0.53199	1	0.23732	0.77552	1	-1.2032	-0.66655	0.09844
+0.036699	2	-1.0483	-1.779	1	0.3525	-0.60395	0.30022
+-0.64389	1	-0.082056	0.48348	1	-0.86546	-0.4081	-0.099303
+0.7892	2	0.063117	-0.73251	1	-0.64062	-0.4066	0.12435
+-0.92679	2	-1.4966	0.012855	1	0.79099	-0.55856	0.19256
+0.75147	1	0.0035339	0.026413	1	-0.50794	0.29651	-0.27764
+0.21172	2	-1.3492	-0.47335	1	0.23233	-0.70213	-1.8621
+-0.97409	2	-0.629	-0.4728	1	0.091744	-0.086481	-0.49515
+-1.0464	2	-1.6692	-0.8497	2	1.5077	0.095689	1.3063
+-0.078054	1	1.7703	0.87897	2	1.6091	1.3305	-0.65192
+1.6149	2	-0.75709	-0.63085	1	-0.77532	-2.2636	-0.59675
+-1.1678	1	0.0899	0.58095	2	-0.22151	0.26068	0.51619
+-0.098842	2	-0.30237	-0.04093	1	-1.2385	-0.37569	-1.8217
+-0.55001	2	-1.0301	-1.7087	2	2.6454	-1.328	0.34954
+1.0482	2	-0.26461	-1.3201	2	1.68	-0.0041651	-0.12113
+0.5008	2	-0.85959	-0.66514	1	-1.6141	0.29161	-0.95504
+0.309	1	1.0744	1.269	1	-0.96467	1.5905	-1.42
+-0.03887	1	1.0667	1.0095	1	-0.089407	0.99929	1.152
+-0.50172	2	-0.99479	-0.54327	2	-0.16208	-1.0551	0.47476
+-0.094959	1	2.17	1.7212	2	0.51568	0.53768	-1.2639
+-0.5209	2	-1.431	-0.70798	1	-0.4217	0.23091	0.57769
+0.6976	2	-1.2512	-0.50443	1	0.40922	-1.2722	-0.22881
+-0.15737	2	-1.3037	-1.2446	1	-0.25	-1.3128	-0.48267
+1.7004	2	-0.093222	0.18072	1	-0.77286	-1.1751	0.70356
+-0.34711	2	-0.40996	-0.38877	1	-0.74126	-0.076517	0.71538
+0.63301	2	-1.3066	-1.061	1	-0.020245	-0.47474	0.22151
+0.45593	1	0.98475	1.1245	1	-1.5284	0.87162	-1.1116
+-0.074398	2	0.086143	-0.71909	1	-0.72312	-0.58633	-0.11884
+0.5737	1	1.3999	0.41267	1	0.14453	0.30696	0.39177
+0.50652	2	-0.76797	-0.93352	1	-0.537	-0.41761	0.072615
+-1.6019	2	0.65979	-0.97526	1	0.28122	-0.88937	0.46709
+0.74414	1	1.6353	1.382	1	0.099487	1.2686	1.3095
+-1.3504	2	-1.1309	-0.53372	2	0.13853	-1.3604	1.3258
+-0.32328	2	-1.4115	-0.55521	1	-0.39333	-0.7941	1.0533
+-0.74323	1	1.7072	0.49329	1	-0.87786	0.48373	-1.3411
+0.8876	2	-1.0691	-0.47533	1	-0.65919	-1.2867	1.3563
+-0.26121	1	1.3665	1.3315	2	0.59812	1.5342	-0.51186
+-0.52176	1	1.5091	0.71759	1	-0.79433	0.67907	-0.77268
+-0.51351	2	-0.99866	-0.96005	2	-0.064251	-0.82275	1.8509
+-0.17328	2	0.54034	-1.7709	1	0.38529	-1.362	0.6719
+0.15516	1	1.1328	-0.19576	1	-1.135	1.0527	0.29172
+0.45546	1	0.45829	1.7196	2	0.62149	2.3385	-2.0495
+2.0143	1	1.7214	1.3935	1	-1.973	1.0241	-0.84073
+0.017525	2	-1.3151	-0.89644	1	-0.75598	-1.0529	0.10505
+-0.041089	2	-0.071698	-0.33496	1	-0.25915	-0.26742	0.55872
+-0.072325	1	0.14302	1.099	1	0.45095	0.51954	-1.5618
+0.9507	2	-0.99789	-1.1502	1	-0.63471	0.61259	0.50063
+-1.8153	2	-0.51697	-0.18793	1	-0.58518	-0.41489	-0.79261
+-0.37059	2	-0.18087	-0.77008	2	0.14794	-0.66655	0.62335
+-0.24334	2	0.033188	-0.22919	1	-1.8202	-0.18936	-0.69045
+-0.83923	2	-0.41353	-1.3264	2	1.8901	-1.3452	0.28566
+-1.5292	2	-0.28479	-0.49856	1	0.34714	-1.4144	-0.50451
+-1.1641	1	0.77391	1.0241	1	-0.77302	0.27655	-2.6875
+2.6624	1	1.7387	1.374	1	0.041422	2.3695	-0.062096
+2.3682	1	1.907	0.94637	2	0.8413	0.76571	-1.6393
+0.31396	2	-1.292	-0.78457	2	-0.31227	-0.84139	-0.22892
+-0.87392	2	0.53494	0.55115	1	-0.15179	-0.83441	1.0812
+-1.1022	2	-0.57856	-0.21265	2	1.4486	0.11044	-0.38736
+0.42993	2	-1.5502	-0.063309	2	2.2649	-0.59644	2.3365
+-1.5011	2	-2.2926	-0.96909	1	-0.40571	-1.1012	0.56007
+-1.567	1	0.014611	-0.069863	2	1.3161	0.89287	0.96852
+0.26418	1	0.46242	1.94	1	-1.3016	1.1926	-1.5223
+-0.77783	1	1.4946	0.92514	1	-1.1651	1.0425	-1.2685
+-0.17339	2	-0.86526	-0.090231	1	-0.09102	-1.3706	0.0049574
+0.11883	1	0.8622	0.94077	1	-0.76414	1.3308	1.415
+0.12005	2	-0.20542	-0.74536	1	-1.2579	-1.2279	-1.2709
+-0.79628	2	-0.022269	-0.16145	1	-0.47715	-0.37329	1.1972
+0.58969	1	1.0063	1.3356	2	0.79987	1.5464	0.32801
+0.11633	1	0.73396	1.1437	2	1.3183	1.0156	-1.9512
+-0.88008	2	0.39215	-0.88212	2	0.77879	-0.071244	0.92164
+-0.74781	2	-0.31657	-1.2371	1	-1.356	-0.76328	-0.96657
+-0.069788	2	0.63495	-0.70214	1	-0.76454	-2.2215	1.7055
+0.3897	2	-0.59859	-0.81633	1	-0.04446	0.84047	-0.75073
+2.202	1	0.77915	0.03712	2	1.8438	1.1743	0.40331
+0.22687	2	-0.40806	-1.0788	1	-0.19213	-0.78118	0.48301
+-0.66335	1	1.4808	1.1399	1	-0.033787	0.43484	-0.12095
+0.13303	2	-0.66658	-0.14357	1	-1.073	-0.49395	0.70655
+-1.5417	1	0.2473	1.2125	2	1.9083	1.2778	3.0844
+0.74601	1	-0.35212	0.88616	1	-0.87675	0.60499	-0.21133
+-0.80655	2	-1.1068	-1.3459	1	-0.26122	0.15508	-0.0066816
+-0.69135	1	1.0994	1.204	2	2.3161	1.0629	1.4256
+1.6905	2	-0.14242	-0.55749	2	0.359	0.41916	0.53215
+-0.77018	2	-1.5065	-0.53604	1	0.19357	0.059861	1.9152
+-2.2055	1	1.058	-0.29035	2	1.0301	0.11952	1.1588
+-0.70569	2	-0.73004	-1.6228	2	2.1348	-0.42942	0.97843
+1.3633	1	0.65794	0.98061	2	1.3078	0.64345	0.8317
+0.093858	2	-1.6142	-0.92049	1	-0.92394	-1.3444	-0.43212
+1.6603	2	0.037058	0.81538	1	-0.70654	-0.93759	-0.023641
+0.29687	1	0.84923	0.6669	2	0.66467	0.47209	-0.21266
+0.30837	2	-0.8147	-1.3296	1	-1.1736	-1.2252	-0.61256
+-1.7779	2	-1.1384	-1.0425	1	-0.69411	-0.39049	-0.48379
+-0.35135	2	-0.52672	-1.388	2	0.84612	-1.4625	0.071832
+0.18294	2	-0.96354	-0.6923	1	-0.91232	-0.9204	0.030227
+-0.34302	1	1.8167	0.77427	2	0.036232	0.81699	1.0643
+-1.0367	2	-0.55158	-0.84582	2	0.67713	-0.66779	-0.43102
+2.6147	2	0.14282	-0.33616	1	-0.83219	-0.17633	-0.13118
+-0.59086	2	-1.2139	-0.99552	2	1.9391	-1.1308	0.34126
+-0.90208	2	-0.28263	-0.58061	2	0.7467	-0.84617	-0.13398
+1.2668	2	-0.56449	-0.1964	1	0.79248	0.19601	0.41777
+0.75643	1	-0.011136	0.81301	1	0.34117	0.68247	-1.863
+-0.62022	1	0.86997	0.6729	1	-1.1203	0.17657	-1.4244
+-0.18946	2	-0.55133	-0.86512	1	-0.83578	-0.40257	-0.029909
+-1.5498	1	0.32287	1.184	1	-0.62378	0.80455	0.92806
+-0.53493	2	-0.9391	-0.84301	2	1.3501	-0.31379	-0.058019
+0.3655	2	-0.74384	-1.3595	1	1.3067	-0.5247	-1.7338
+0.82879	2	-1.5915	-1.0102	2	1.0708	-0.6468	0.92568
+0.57673	2	-1.4808	-1.0779	1	0.47651	-1.062	0.26133
+0.59244	2	-0.8026	-1.7146	1	-0.020034	-1.3898	-1.5705
+0.44996	1	0.50751	1.0983	2	2.2137	2.8355	0.34907
+-0.75132	2	-0.52338	-0.74591	1	-0.84637	-1.6929	-1.6584
+-0.1943	1	1.2265	0.4739	1	-0.78558	0.81272	-0.023241
+2.0866	2	-0.19274	0.066839	1	-0.30442	-0.70635	0.85947
+-1.3268	2	-1.2952	0.023312	2	1.4432	0.036383	0.8954
+-1.4174	2	-0.43139	-0.97617	2	1.9378	0.79311	-0.17648
+-0.30469	2	0.072833	-0.069195	2	1.2683	-0.62404	0.25533
diff --git a/sourcecodes/data/example_chl/bWRcontinuous_input.txt b/sourcecodes/data/example_chl/bWRcontinuous_input.txt
new file mode 100644
index 00000000..cf674ffd
--- /dev/null
+++ b/sourcecodes/data/example_chl/bWRcontinuous_input.txt
@@ -0,0 +1,44 @@
+Ctrq3	MAS	Neutrophil	Load	Weight
+2	1	1	1	1
+2	0.969230769	3	3.252367514	1
+2	0.925170068	1.6	2.46322088	1.033472803
+1	0.427272727	33.8	4.206610024	0.831372549
+2	0.877835951	8.3	3.764250875	0.967153285
+2	0.914862915	4.4	3.691700208	1.046025105
+2	0.560334528	4.9	2.604550033	0.98046875
+1	0.383073497	13.1	4.273556814	0.812316716
+1	0.101010101	18.6	5.089640217	0.771929825
+1	0.106719368	18.9	4.915125346	0.80994152
+2	0.894736842	2.5	2.691700208	0.995515695
+1	0.067226891	19.8	4.878194228	0.846153846
+2	0.921022067	2.9	4.127428778	1.03875969
+2	0.938701923	0.7	4.366310867	0.984732824
+1	0.658008658	15.7	4.531121115	0.884210526
+2	0.9	4.8	2.604550033	0.913194444
+2	0.790923825	10.4	2.390670213	0.892857143
+1	0.295539033	8.6	4.24137213	0.85840708
+2	0.317757009	12.2	4.449648073	0.889830508
+1	0.032418953	20.2	5.053428044	0.811320755
+1	0.603960396	23.4	4.283775979	0.805460751
+2	0.939351199	3.6	2.349277527	0.952380952
+1	0.978448276	0.4	3.495405563	0.8875
+1	0.1	23.2	4.675613388	0.766101695
+1	0.036363636	32.6	4.938109253	0.828125
+1	0.660247593	9.2	3.826398782	0.921052632
+1	0.078651685	35.8	4.513630383	0.852112676
+1	0.186915888	20.7	5.048247532	0.779761905
+1	0.071578947	35.6	4.574586809	0.797356828
+1	0.239520958	15.4	4.331548761	0.941176471
+1	0.205741627	24.5	5.058547488	0.774193548
+1	0.062300319	13.4	4.594790195	0.832236842
+2	0.599675851	5	4.18178644	0.969348659
+1	0.324246772	13.5	4.252367514	0.858585859
+1	0.87628866	14.2	2.929061124	0.869863014
+1	0.146103896	15.6	4.579726449	0.9
+1	0.257383966	22.5	5.210214148	0.75
+1	0.033333333	31.1	4.632578756	0.718644068
+1	0.29739777	36.1	3.880756445	0.798353909
+2	0.872979215	4.2	4.097465554	0.856756757
+2	0.909221902	4.3	3.650307523	0.976
+1	0.10041841	28.3	4.46322088	0.757462687
+
diff --git a/sourcecodes/data/example_chl/bWRgraphviz.txt b/sourcecodes/data/example_chl/bWRgraphviz.txt
new file mode 100644
index 00000000..2cd4e8cd
--- /dev/null
+++ b/sourcecodes/data/example_chl/bWRgraphviz.txt
@@ -0,0 +1,11 @@
+digraph G {
+size="10,10";  ratio = fill;
+node [shape=square,width=1.5];
+Ctrq3 -> MAS;
+Ctrq3 -> Neutrophil;
+Ctrq3 -> Load;
+Ctrq3 -> Weight;
+MAS -> Neutrophil;
+MAS -> Load;
+Neutrophil -> Weight;
+}
\ No newline at end of file
diff --git a/sourcecodes/data/example_chl/bWRmap.txt b/sourcecodes/data/example_chl/bWRmap.txt
new file mode 100644
index 00000000..b872d2f0
--- /dev/null
+++ b/sourcecodes/data/example_chl/bWRmap.txt
@@ -0,0 +1,5 @@
+Ctrq3	2	0.487652	1.365854
+MAS	1	0.355012	0.479560
+Neutrophil	1	10.929756	15.048780
+Load	1	0.825354	4.077143
+Weight	1	0.088036	0.877077
diff --git a/sourcecodes/data/example_chl/bWRmapdata.txt b/sourcecodes/data/example_chl/bWRmapdata.txt
new file mode 100644
index 00000000..ce5416ce
--- /dev/null
+++ b/sourcecodes/data/example_chl/bWRmapdata.txt
@@ -0,0 +1 @@
+Ctrq3	MAS	Load	Neutrophil	Weight
diff --git a/sourcecodes/data/example_chl/bWRname.txt b/sourcecodes/data/example_chl/bWRname.txt
new file mode 100644
index 00000000..48018335
--- /dev/null
+++ b/sourcecodes/data/example_chl/bWRname.txt
@@ -0,0 +1 @@
+Ctrq3	MAS	Neutrophil	Load	Weight
diff --git a/sourcecodes/data/example_chl/bWRnet_figure.txt b/sourcecodes/data/example_chl/bWRnet_figure.txt
new file mode 100644
index 00000000..1798da4f
--- /dev/null
+++ b/sourcecodes/data/example_chl/bWRnet_figure.txt
@@ -0,0 +1,433 @@
+5
+1200	1200	
+Ctrq3	200	0
+MAS	320	240
+Load	0	480
+Neutrophil	400	480
+Weight	320	720
+Ctrq3	2
+250	150
+0
+4	2	3	4	5
+1	0.6341
+2	0.3659
+MAS	1
+250	150
+1	1
+2	3	4
+-2.2595	0.0292
+-2.2129	0.0326
+-2.1662	0.0362
+-2.1196	0.0401
+-2.0729	0.0443
+-2.0263	0.0489
+-1.9796	0.0539
+-1.9330	0.0592
+-1.8863	0.0648
+-1.8397	0.0709
+-1.7930	0.0774
+-1.7464	0.0842
+-1.6997	0.0915
+-1.6531	0.0992
+-1.6064	0.1072
+-1.5598	0.1157
+-1.5131	0.1246
+-1.4665	0.1338
+-1.4199	0.1434
+-1.3732	0.1534
+-1.3266	0.1636
+-1.2799	0.1742
+-1.2333	0.1850
+-1.1866	0.1961
+-1.1400	0.2074
+-1.0933	0.2188
+-1.0467	0.2303
+-1.0000	0.2419
+-0.9534	0.2535
+-0.9067	0.2651
+-0.8601	0.2766
+-0.8134	0.2879
+-0.7668	0.2991
+-0.7201	0.3099
+-0.6735	0.3205
+-0.6268	0.3307
+-0.5802	0.3404
+-0.5335	0.3496
+-0.4869	0.3583
+-0.4402	0.3663
+-0.3936	0.3737
+-0.3470	0.3804
+-0.3003	0.3864
+-0.2537	0.3916
+-0.2070	0.3959
+-0.1604	0.3994
+-0.1137	0.4021
+-0.0671	0.4038
+-0.0204	0.4047
+0.0262	0.4046
+0.0729	0.4037
+0.1195	0.4018
+0.1662	0.3991
+0.2128	0.3954
+0.2595	0.3910
+0.3061	0.3857
+0.3528	0.3797
+0.3994	0.3729
+0.4461	0.3654
+0.4927	0.3572
+0.5394	0.3485
+0.5860	0.3392
+0.6327	0.3294
+0.6793	0.3192
+0.7259	0.3086
+0.7726	0.2977
+0.8192	0.2865
+0.8659	0.2752
+0.9125	0.2637
+0.9592	0.2521
+1.0058	0.2405
+1.0525	0.2289
+1.0991	0.2173
+1.1458	0.2059
+1.1924	0.1947
+1.2391	0.1837
+1.2857	0.1729
+1.3324	0.1623
+1.3790	0.1521
+1.4257	0.1422
+1.4723	0.1326
+1.5190	0.1234
+1.5656	0.1146
+1.6123	0.1062
+1.6589	0.0982
+1.7056	0.0906
+1.7522	0.0834
+1.7989	0.0765
+1.8455	0.0701
+1.8921	0.0641
+1.9388	0.0585
+1.9854	0.0532
+2.0321	0.0483
+2.0787	0.0438
+2.1254	0.0396
+2.1720	0.0357
+2.2187	0.0321
+2.2653	0.0288
+2.3120	0.0258
+2.3586	0.0231
+2.4053	0.0206
+Load	1
+250	150
+2	1	2
+0
+-3.0935	0.0030
+-3.0388	0.0036
+-2.9842	0.0043
+-2.9295	0.0050
+-2.8748	0.0059
+-2.8202	0.0069
+-2.7655	0.0081
+-2.7108	0.0094
+-2.6562	0.0110
+-2.6015	0.0127
+-2.5469	0.0147
+-2.4922	0.0169
+-2.4375	0.0194
+-2.3829	0.0222
+-2.3282	0.0253
+-2.2735	0.0287
+-2.2189	0.0326
+-2.1642	0.0368
+-2.1095	0.0415
+-2.0549	0.0466
+-2.0002	0.0522
+-1.9456	0.0583
+-1.8909	0.0649
+-1.8362	0.0720
+-1.7816	0.0797
+-1.7269	0.0879
+-1.6722	0.0966
+-1.6176	0.1059
+-1.5629	0.1158
+-1.5083	0.1261
+-1.4536	0.1370
+-1.3989	0.1484
+-1.3443	0.1602
+-1.2896	0.1724
+-1.2349	0.1850
+-1.1803	0.1979
+-1.1256	0.2111
+-1.0709	0.2244
+-1.0163	0.2379
+-0.9616	0.2514
+-0.9070	0.2649
+-0.8523	0.2782
+-0.7976	0.2914
+-0.7430	0.3042
+-0.6883	0.3166
+-0.6336	0.3285
+-0.5790	0.3398
+-0.5243	0.3504
+-0.4697	0.3603
+-0.4150	0.3693
+-0.3603	0.3774
+-0.3057	0.3845
+-0.2510	0.3905
+-0.1963	0.3954
+-0.1417	0.3992
+-0.0870	0.4017
+-0.0323	0.4031
+0.0223	0.4032
+0.0770	0.4021
+0.1316	0.3997
+0.1863	0.3962
+0.2410	0.3915
+0.2956	0.3857
+0.3503	0.3788
+0.4050	0.3709
+0.4596	0.3620
+0.5143	0.3523
+0.5689	0.3418
+0.6236	0.3306
+0.6783	0.3188
+0.7329	0.3065
+0.7876	0.2937
+0.8423	0.2807
+0.8969	0.2674
+0.9516	0.2539
+1.0063	0.2404
+1.0609	0.2269
+1.1156	0.2135
+1.1702	0.2003
+1.2249	0.1874
+1.2796	0.1747
+1.3342	0.1624
+1.3889	0.1505
+1.4436	0.1391
+1.4982	0.1281
+1.5529	0.1176
+1.6075	0.1077
+1.6622	0.0983
+1.7169	0.0894
+1.7715	0.0811
+1.8262	0.0734
+1.8809	0.0662
+1.9355	0.0595
+1.9902	0.0533
+2.0449	0.0476
+2.0995	0.0424
+2.1542	0.0377
+2.2088	0.0333
+2.2635	0.0294
+2.3182	0.0259
+2.3728	0.0227
+Neutrophil	1
+250	150
+2	1	2
+1	5
+-2.3403	0.0245
+-2.2876	0.0277
+-2.2349	0.0313
+-2.1823	0.0353
+-2.1296	0.0396
+-2.0770	0.0444
+-2.0243	0.0496
+-1.9716	0.0552
+-1.9190	0.0613
+-1.8663	0.0679
+-1.8136	0.0750
+-1.7610	0.0825
+-1.7083	0.0906
+-1.6556	0.0992
+-1.6030	0.1083
+-1.5503	0.1180
+-1.4977	0.1281
+-1.4450	0.1386
+-1.3923	0.1496
+-1.3397	0.1611
+-1.2870	0.1729
+-1.2343	0.1851
+-1.1817	0.1975
+-1.1290	0.2102
+-1.0764	0.2231
+-1.0237	0.2361
+-0.9710	0.2491
+-0.9184	0.2621
+-0.8657	0.2750
+-0.8130	0.2878
+-0.7604	0.3002
+-0.7077	0.3124
+-0.6550	0.3240
+-0.6024	0.3352
+-0.5497	0.3458
+-0.4971	0.3557
+-0.4444	0.3648
+-0.3917	0.3731
+-0.3391	0.3806
+-0.2864	0.3870
+-0.2337	0.3925
+-0.1811	0.3969
+-0.1284	0.4002
+-0.0758	0.4025
+-0.0231	0.4035
+0.0296	0.4035
+0.0822	0.4022
+0.1349	0.3999
+0.1876	0.3964
+0.2402	0.3919
+0.2929	0.3863
+0.3456	0.3797
+0.3982	0.3722
+0.4509	0.3637
+0.5035	0.3545
+0.5562	0.3445
+0.6089	0.3339
+0.6615	0.3226
+0.7142	0.3109
+0.7669	0.2987
+0.8195	0.2862
+0.8722	0.2735
+0.9248	0.2605
+0.9775	0.2475
+1.0302	0.2345
+1.0828	0.2215
+1.1355	0.2086
+1.1882	0.1960
+1.2408	0.1835
+1.2935	0.1714
+1.3462	0.1597
+1.3988	0.1483
+1.4515	0.1373
+1.5041	0.1268
+1.5568	0.1167
+1.6095	0.1072
+1.6621	0.0981
+1.7148	0.0896
+1.7675	0.0816
+1.8201	0.0741
+1.8728	0.0670
+1.9254	0.0605
+1.9781	0.0545
+2.0308	0.0489
+2.0834	0.0438
+2.1361	0.0391
+2.1888	0.0348
+2.2414	0.0308
+2.2941	0.0273
+2.3468	0.0241
+2.3994	0.0212
+2.4521	0.0186
+2.5047	0.0163
+2.5574	0.0142
+2.6101	0.0123
+2.6627	0.0107
+2.7154	0.0093
+2.7681	0.0080
+2.8207	0.0069
+2.8734	0.0059
+2.9260	0.0050
+Weight	1
+250	150
+2	1	4
+0
+-2.7996	0.0076
+-2.7425	0.0089
+-2.6853	0.0105
+-2.6281	0.0122
+-2.5709	0.0142
+-2.5137	0.0164
+-2.4565	0.0190
+-2.3993	0.0218
+-2.3421	0.0250
+-2.2850	0.0286
+-2.2278	0.0326
+-2.1706	0.0370
+-2.1134	0.0419
+-2.0562	0.0473
+-1.9990	0.0531
+-1.9418	0.0596
+-1.8846	0.0665
+-1.8275	0.0741
+-1.7703	0.0822
+-1.7131	0.0909
+-1.6559	0.1002
+-1.5987	0.1101
+-1.5415	0.1206
+-1.4843	0.1316
+-1.4271	0.1432
+-1.3700	0.1553
+-1.3128	0.1678
+-1.2556	0.1808
+-1.1984	0.1941
+-1.1412	0.2076
+-1.0840	0.2215
+-1.0268	0.2354
+-0.9696	0.2494
+-0.9125	0.2633
+-0.8553	0.2772
+-0.7981	0.2907
+-0.7409	0.3040
+-0.6837	0.3168
+-0.6265	0.3290
+-0.5693	0.3406
+-0.5121	0.3514
+-0.4550	0.3614
+-0.3978	0.3704
+-0.3406	0.3784
+-0.2834	0.3853
+-0.2262	0.3910
+-0.1690	0.3955
+-0.1118	0.3988
+-0.0546	0.4007
+0.0025	0.4013
+0.0597	0.4006
+0.1169	0.3985
+0.1741	0.3952
+0.2313	0.3906
+0.2885	0.3847
+0.3457	0.3778
+0.4029	0.3697
+0.4600	0.3605
+0.5172	0.3505
+0.5744	0.3396
+0.6316	0.3280
+0.6888	0.3157
+0.7460	0.3028
+0.8032	0.2896
+0.8603	0.2759
+0.9175	0.2621
+0.9747	0.2481
+1.0319	0.2342
+1.0891	0.2202
+1.1463	0.2064
+1.2035	0.1929
+1.2607	0.1796
+1.3178	0.1667
+1.3750	0.1542
+1.4322	0.1422
+1.4894	0.1306
+1.5466	0.1197
+1.6038	0.1092
+1.6610	0.0994
+1.7182	0.0901
+1.7753	0.0815
+1.8325	0.0734
+1.8897	0.0659
+1.9469	0.0590
+2.0041	0.0526
+2.0613	0.0468
+2.1185	0.0414
+2.1757	0.0366
+2.2328	0.0322
+2.2900	0.0283
+2.3472	0.0247
+2.4044	0.0215
+2.4616	0.0187
+2.5188	0.0162
+2.5760	0.0140
+2.6332	0.0120
+2.6903	0.0103
+2.7475	0.0088
+2.8047	0.0075
+2.8619	0.0064
+2.9191	0.0054
diff --git a/sourcecodes/data/example_chl/bWRnet_figure_new.txt b/sourcecodes/data/example_chl/bWRnet_figure_new.txt
new file mode 100644
index 00000000..9b493660
--- /dev/null
+++ b/sourcecodes/data/example_chl/bWRnet_figure_new.txt
@@ -0,0 +1,433 @@
+1	
+5
+1200	1200	
+Ctrq3	200	0
+MAS	320	240
+Load	0	480
+Neutrophil	400	480
+Weight	320	720
+Ctrq3	2
+250	150
+0
+4	2	3	4	5
+1.0000	1.0000
+MAS	1
+250	150
+1	1
+2	3	4
+-2.2595	0.0066
+-2.2129	0.0085
+-2.1662	0.0109
+-2.1196	0.0138
+-2.0729	0.0174
+-2.0263	0.0219
+-1.9796	0.0272
+-1.9330	0.0336
+-1.8863	0.0412
+-1.8397	0.0501
+-1.7930	0.0606
+-1.7464	0.0728
+-1.6997	0.0868
+-1.6531	0.1027
+-1.6064	0.1208
+-1.5598	0.1410
+-1.5131	0.1635
+-1.4665	0.1882
+-1.4199	0.2151
+-1.3732	0.2442
+-1.3266	0.2752
+-1.2799	0.3080
+-1.2333	0.3423
+-1.1866	0.3777
+-1.1400	0.4139
+-1.0933	0.4503
+-1.0467	0.4866
+-1.0000	0.5221
+-0.9534	0.5562
+-0.9067	0.5884
+-0.8601	0.6182
+-0.8134	0.6448
+-0.7668	0.6679
+-0.7201	0.6870
+-0.6735	0.7017
+-0.6268	0.7116
+-0.5802	0.7167
+-0.5335	0.7167
+-0.4869	0.7117
+-0.4402	0.7018
+-0.3936	0.6871
+-0.3470	0.6681
+-0.3003	0.6450
+-0.2537	0.6184
+-0.2070	0.5887
+-0.1604	0.5565
+-0.1137	0.5223
+-0.0671	0.4869
+-0.0204	0.4506
+0.0262	0.4142
+0.0729	0.3780
+0.1195	0.3425
+0.1662	0.3082
+0.2128	0.2754
+0.2595	0.2444
+0.3061	0.2153
+0.3528	0.1884
+0.3994	0.1637
+0.4461	0.1412
+0.4927	0.1209
+0.5394	0.1029
+0.5860	0.0869
+0.6327	0.0729
+0.6793	0.0607
+0.7259	0.0502
+0.7726	0.0412
+0.8192	0.0336
+0.8659	0.0272
+0.9125	0.0219
+0.9592	0.0175
+1.0058	0.0139
+1.0525	0.0109
+1.0991	0.0085
+1.1458	0.0066
+1.1924	0.0051
+1.2391	0.0039
+1.2857	0.0030
+1.3324	0.0022
+1.3790	0.0017
+1.4257	0.0012
+1.4723	0.0009
+1.5190	0.0007
+1.5656	0.0005
+1.6123	0.0004
+1.6589	0.0003
+1.7056	0.0002
+1.7522	0.0001
+1.7989	0.0001
+1.8455	0.0001
+1.8921	0.0000
+1.9388	0.0000
+1.9854	0.0000
+2.0321	0.0000
+2.0787	0.0000
+2.1254	0.0000
+2.1720	0.0000
+2.2187	0.0000
+2.2653	0.0000
+2.3120	0.0000
+2.3586	0.0000
+2.4053	0.0000
+Load	1
+250	150
+2	1	2
+0
+-3.0935	0.0000
+-3.0388	0.0000
+-2.9842	0.0000
+-2.9295	0.0000
+-2.8748	0.0000
+-2.8202	0.0000
+-2.7655	0.0000
+-2.7108	0.0000
+-2.6562	0.0000
+-2.6015	0.0000
+-2.5469	0.0000
+-2.4922	0.0000
+-2.4375	0.0000
+-2.3829	0.0000
+-2.3282	0.0000
+-2.2735	0.0000
+-2.2189	0.0000
+-2.1642	0.0000
+-2.1095	0.0000
+-2.0549	0.0000
+-2.0002	0.0000
+-1.9456	0.0000
+-1.8909	0.0000
+-1.8362	0.0000
+-1.7816	0.0000
+-1.7269	0.0000
+-1.6722	0.0000
+-1.6176	0.0000
+-1.5629	0.0000
+-1.5083	0.0000
+-1.4536	0.0000
+-1.3989	0.0000
+-1.3443	0.0000
+-1.2896	0.0001
+-1.2349	0.0001
+-1.1803	0.0002
+-1.1256	0.0004
+-1.0709	0.0007
+-1.0163	0.0011
+-0.9616	0.0018
+-0.9070	0.0029
+-0.8523	0.0046
+-0.7976	0.0070
+-0.7430	0.0106
+-0.6883	0.0157
+-0.6336	0.0228
+-0.5790	0.0326
+-0.5243	0.0458
+-0.4697	0.0631
+-0.4150	0.0855
+-0.3603	0.1138
+-0.3057	0.1487
+-0.2510	0.1910
+-0.1963	0.2409
+-0.1417	0.2985
+-0.0870	0.3633
+-0.0323	0.4344
+0.0223	0.5102
+0.0770	0.5887
+0.1316	0.6672
+0.1863	0.7428
+0.2410	0.8124
+0.2956	0.8728
+0.3503	0.9211
+0.4050	0.9548
+0.4596	0.9724
+0.5143	0.9727
+0.5689	0.9558
+0.6236	0.9226
+0.6783	0.8749
+0.7329	0.8149
+0.7876	0.7456
+0.8423	0.6702
+0.8969	0.5917
+0.9516	0.5132
+1.0063	0.4372
+1.0609	0.3659
+1.1156	0.3008
+1.1702	0.2430
+1.2249	0.1927
+1.2796	0.1502
+1.3342	0.1150
+1.3889	0.0865
+1.4436	0.0639
+1.4982	0.0463
+1.5529	0.0330
+1.6075	0.0231
+1.6622	0.0159
+1.7169	0.0107
+1.7715	0.0071
+1.8262	0.0047
+1.8809	0.0030
+1.9355	0.0019
+1.9902	0.0012
+2.0449	0.0007
+2.0995	0.0004
+2.1542	0.0002
+2.2088	0.0001
+2.2635	0.0001
+2.3182	0.0000
+2.3728	0.0000
+Neutrophil	1
+250	150
+2	1	2
+1	5
+-2.3403	0.0002
+-2.2876	0.0002
+-2.2349	0.0003
+-2.1823	0.0004
+-2.1296	0.0005
+-2.0770	0.0007
+-2.0243	0.0009
+-1.9716	0.0012
+-1.9190	0.0015
+-1.8663	0.0020
+-1.8136	0.0025
+-1.7610	0.0032
+-1.7083	0.0040
+-1.6556	0.0051
+-1.6030	0.0063
+-1.5503	0.0079
+-1.4977	0.0097
+-1.4450	0.0120
+-1.3923	0.0146
+-1.3397	0.0178
+-1.2870	0.0215
+-1.2343	0.0259
+-1.1817	0.0310
+-1.1290	0.0369
+-1.0764	0.0437
+-1.0237	0.0514
+-0.9710	0.0602
+-0.9184	0.0702
+-0.8657	0.0813
+-0.8130	0.0937
+-0.7604	0.1074
+-0.7077	0.1224
+-0.6550	0.1388
+-0.6024	0.1565
+-0.5497	0.1755
+-0.4971	0.1957
+-0.4444	0.2171
+-0.3917	0.2396
+-0.3391	0.2629
+-0.2864	0.2870
+-0.2337	0.3116
+-0.1811	0.3364
+-0.1284	0.3613
+-0.0758	0.3859
+-0.0231	0.4099
+0.0296	0.4331
+0.0822	0.4552
+0.1349	0.4757
+0.1876	0.4946
+0.2402	0.5113
+0.2929	0.5258
+0.3456	0.5378
+0.3982	0.5471
+0.4509	0.5535
+0.5035	0.5570
+0.5562	0.5575
+0.6089	0.5549
+0.6615	0.5494
+0.7142	0.5410
+0.7669	0.5299
+0.8195	0.5162
+0.8722	0.5001
+0.9248	0.4819
+0.9775	0.4618
+1.0302	0.4402
+1.0828	0.4173
+1.1355	0.3935
+1.1882	0.3691
+1.2408	0.3443
+1.2935	0.3194
+1.3462	0.2947
+1.3988	0.2704
+1.4515	0.2469
+1.5041	0.2241
+1.5568	0.2023
+1.6095	0.1817
+1.6621	0.1623
+1.7148	0.1442
+1.7675	0.1274
+1.8201	0.1120
+1.8728	0.0979
+1.9254	0.0851
+1.9781	0.0736
+2.0308	0.0632
+2.0834	0.0541
+2.1361	0.0460
+2.1888	0.0389
+2.2414	0.0328
+2.2941	0.0274
+2.3468	0.0228
+2.3994	0.0189
+2.4521	0.0156
+2.5047	0.0127
+2.5574	0.0104
+2.6101	0.0084
+2.6627	0.0068
+2.7154	0.0054
+2.7681	0.0043
+2.8207	0.0034
+2.8734	0.0027
+2.9260	0.0021
+Weight	1
+250	150
+2	1	4
+0
+-2.7996	0.0000
+-2.7425	0.0000
+-2.6853	0.0000
+-2.6281	0.0000
+-2.5709	0.0000
+-2.5137	0.0000
+-2.4565	0.0000
+-2.3993	0.0000
+-2.3421	0.0000
+-2.2850	0.0001
+-2.2278	0.0001
+-2.1706	0.0003
+-2.1134	0.0005
+-2.0562	0.0008
+-1.9990	0.0014
+-1.9418	0.0024
+-1.8846	0.0040
+-1.8275	0.0064
+-1.7703	0.0101
+-1.7131	0.0156
+-1.6559	0.0236
+-1.5987	0.0350
+-1.5415	0.0507
+-1.4843	0.0718
+-1.4271	0.0996
+-1.3700	0.1353
+-1.3128	0.1797
+-1.2556	0.2338
+-1.1984	0.2976
+-1.1412	0.3707
+-1.0840	0.4520
+-1.0268	0.5393
+-0.9696	0.6299
+-0.9125	0.7200
+-0.8553	0.8055
+-0.7981	0.8819
+-0.7409	0.9451
+-0.6837	0.9913
+-0.6265	1.0175
+-0.5693	1.0223
+-0.5121	1.0052
+-0.4550	0.9673
+-0.3978	0.9111
+-0.3406	0.8399
+-0.2834	0.7577
+-0.2262	0.6691
+-0.1690	0.5782
+-0.1118	0.4891
+-0.0546	0.4049
+0.0025	0.3280
+0.0597	0.2601
+0.1169	0.2019
+0.1741	0.1533
+0.2313	0.1140
+0.2885	0.0829
+0.3457	0.0591
+0.4029	0.0412
+0.4600	0.0281
+0.5172	0.0187
+0.5744	0.0122
+0.6316	0.0078
+0.6888	0.0049
+0.7460	0.0030
+0.8032	0.0018
+0.8603	0.0011
+0.9175	0.0006
+0.9747	0.0003
+1.0319	0.0002
+1.0891	0.0001
+1.1463	0.0001
+1.2035	0.0000
+1.2607	0.0000
+1.3178	0.0000
+1.3750	0.0000
+1.4322	0.0000
+1.4894	0.0000
+1.5466	0.0000
+1.6038	0.0000
+1.6610	0.0000
+1.7182	0.0000
+1.7753	0.0000
+1.8325	0.0000
+1.8897	0.0000
+1.9469	0.0000
+2.0041	0.0000
+2.0613	0.0000
+2.1185	0.0000
+2.1757	0.0000
+2.2328	0.0000
+2.2900	0.0000
+2.3472	0.0000
+2.4044	0.0000
+2.4616	0.0000
+2.5188	0.0000
+2.5760	0.0000
+2.6332	0.0000
+2.6903	0.0000
+2.7475	0.0000
+2.8047	0.0000
+2.8619	0.0000
+2.9191	0.0000
diff --git a/sourcecodes/data/example_chl/bWRnlevels.txt b/sourcecodes/data/example_chl/bWRnlevels.txt
new file mode 100644
index 00000000..9f618060
--- /dev/null
+++ b/sourcecodes/data/example_chl/bWRnlevels.txt
@@ -0,0 +1,2 @@
+Ctrq3	1	2
+
diff --git a/sourcecodes/data/example_chl/bWRnnode.txt b/sourcecodes/data/example_chl/bWRnnode.txt
new file mode 100644
index 00000000..7ed6ff82
--- /dev/null
+++ b/sourcecodes/data/example_chl/bWRnnode.txt
@@ -0,0 +1 @@
+5
diff --git a/sourcecodes/data/example_chl/bWRrun_evidencemodified.sh b/sourcecodes/data/example_chl/bWRrun_evidencemodified.sh
new file mode 100644
index 00000000..763a268b
--- /dev/null
+++ b/sourcecodes/data/example_chl/bWRrun_evidencemodified.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+# script for execution of deployed applications
+#
+# Sets up the MCR environment for the current $ARCH and executes 
+# the specified command.
+#
+exe_name=$0
+exe_dir=`dirname "$0"`
+echo "------------------------------------------"
+if [ "x$1" = "x" ]; then
+  echo Usage:
+  echo    $0 \<deployedMCRroot\> args
+else
+  echo Setting up environment variables
+  MCRROOT="$1"
+  echo ---
+  LD_LIBRARY_PATH=.:${MCRROOT}/runtime/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/bin/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/sys/os/glnxa64;
+	MCRJRE=${MCRROOT}/sys/java/jre/glnxa64/jre/lib/amd64 ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/native_threads ; 
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/server ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/client ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE} ;  
+  XAPPLRESDIR=${MCRROOT}/X11/app-defaults ;
+  export LD_LIBRARY_PATH;
+  export XAPPLRESDIR;
+  echo LD_LIBRARY_PATH is ${LD_LIBRARY_PATH};
+  shift 1
+  args=
+  while [ $# -gt 0 ]; do
+      token=`echo "$1" | sed 's/ /\\\\ /g'`   # Add blackslash before each blank
+      args="${args} ${token}" 
+      shift
+  done
+  "${exe_dir}"/evidencemodified bWR
+fi
+exit
diff --git a/sourcecodes/data/example_chl/bWRrun_initialstructure.sh b/sourcecodes/data/example_chl/bWRrun_initialstructure.sh
new file mode 100644
index 00000000..3725f758
--- /dev/null
+++ b/sourcecodes/data/example_chl/bWRrun_initialstructure.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+# script for execution of deployed applications
+#
+# Sets up the MCR environment for the current $ARCH and executes 
+# the specified command.
+#
+exe_name=$0
+exe_dir=`dirname "$0"`
+echo "------------------------------------------"
+if [ "x$1" = "x" ]; then
+  echo Usage:
+  echo    $0 \<deployedMCRroot\> args
+else
+  echo Setting up environment variables
+  MCRROOT="$1"
+  echo ---
+  LD_LIBRARY_PATH=.:${MCRROOT}/runtime/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/bin/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/sys/os/glnxa64;
+	MCRJRE=${MCRROOT}/sys/java/jre/glnxa64/jre/lib/amd64 ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/native_threads ; 
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/server ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/client ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE} ;  
+  XAPPLRESDIR=${MCRROOT}/X11/app-defaults ;
+  export LD_LIBRARY_PATH;
+  export XAPPLRESDIR;
+  echo LD_LIBRARY_PATH is ${LD_LIBRARY_PATH};
+  shift 1
+  args=
+  while [ $# -gt 0 ]; do
+      token=`echo "$1" | sed 's/ /\\\\ /g'`   # Add blackslash before each blank
+      args="${args} ${token}" 
+      shift
+  done
+  "${exe_dir}"/initialstructure bWR
+fi
+exit
diff --git a/sourcecodes/data/example_chl/bWRstructure_input.txt b/sourcecodes/data/example_chl/bWRstructure_input.txt
new file mode 100644
index 00000000..efa98e06
--- /dev/null
+++ b/sourcecodes/data/example_chl/bWRstructure_input.txt
@@ -0,0 +1,7 @@
+Ctrq3	MAS	Neutrophil	Load	Weight
+0	1	1	1	1
+0	0	1	1	0
+0	0	0	0	1
+0	0	0	0	0
+0	0	0	0	0
+
diff --git a/sourcecodes/data/example_chl/bWRstructure_old.txt b/sourcecodes/data/example_chl/bWRstructure_old.txt
new file mode 100644
index 00000000..a6aed858
--- /dev/null
+++ b/sourcecodes/data/example_chl/bWRstructure_old.txt
@@ -0,0 +1,5 @@
+Ctrq3	0.6341	0.3659
+MAS	0.0292	0.0326	0.0362	0.0401	0.0443	0.0489	0.0539	0.0592	0.0648	0.0709	0.0774	0.0842	0.0915	0.0992	0.1072	0.1157	0.1246	0.1338	0.1434	0.1534	0.1636	0.1742	0.1850	0.1961	0.2074	0.2188	0.2303	0.2419	0.2535	0.2651	0.2766	0.2879	0.2991	0.3099	0.3205	0.3307	0.3404	0.3496	0.3583	0.3663	0.3737	0.3804	0.3864	0.3916	0.3959	0.3994	0.4021	0.4038	0.4047	0.4046	0.4037	0.4018	0.3991	0.3954	0.3910	0.3857	0.3797	0.3729	0.3654	0.3572	0.3485	0.3392	0.3294	0.3192	0.3086	0.2977	0.2865	0.2752	0.2637	0.2521	0.2405	0.2289	0.2173	0.2059	0.1947	0.1837	0.1729	0.1623	0.1521	0.1422	0.1326	0.1234	0.1146	0.1062	0.0982	0.0906	0.0834	0.0765	0.0701	0.0641	0.0585	0.0532	0.0483	0.0438	0.0396	0.0357	0.0321	0.0288	0.0258	0.0231	0.0206
+Neutrophil	0.0245	0.0277	0.0313	0.0353	0.0396	0.0444	0.0496	0.0552	0.0613	0.0679	0.0750	0.0825	0.0906	0.0992	0.1083	0.1180	0.1281	0.1386	0.1496	0.1611	0.1729	0.1851	0.1975	0.2102	0.2231	0.2361	0.2491	0.2621	0.2750	0.2878	0.3002	0.3124	0.3240	0.3352	0.3458	0.3557	0.3648	0.3731	0.3806	0.3870	0.3925	0.3969	0.4002	0.4025	0.4035	0.4035	0.4022	0.3999	0.3964	0.3919	0.3863	0.3797	0.3722	0.3637	0.3545	0.3445	0.3339	0.3226	0.3109	0.2987	0.2862	0.2735	0.2605	0.2475	0.2345	0.2215	0.2086	0.1960	0.1835	0.1714	0.1597	0.1483	0.1373	0.1268	0.1167	0.1072	0.0981	0.0896	0.0816	0.0741	0.0670	0.0605	0.0545	0.0489	0.0438	0.0391	0.0348	0.0308	0.0273	0.0241	0.0212	0.0186	0.0163	0.0142	0.0123	0.0107	0.0093	0.0080	0.0069	0.0059	0.0050
+Load	0.0030	0.0036	0.0043	0.0050	0.0059	0.0069	0.0081	0.0094	0.0110	0.0127	0.0147	0.0169	0.0194	0.0222	0.0253	0.0287	0.0326	0.0368	0.0415	0.0466	0.0522	0.0583	0.0649	0.0720	0.0797	0.0879	0.0966	0.1059	0.1158	0.1261	0.1370	0.1484	0.1602	0.1724	0.1850	0.1979	0.2111	0.2244	0.2379	0.2514	0.2649	0.2782	0.2914	0.3042	0.3166	0.3285	0.3398	0.3504	0.3603	0.3693	0.3774	0.3845	0.3905	0.3954	0.3992	0.4017	0.4031	0.4032	0.4021	0.3997	0.3962	0.3915	0.3857	0.3788	0.3709	0.3620	0.3523	0.3418	0.3306	0.3188	0.3065	0.2937	0.2807	0.2674	0.2539	0.2404	0.2269	0.2135	0.2003	0.1874	0.1747	0.1624	0.1505	0.1391	0.1281	0.1176	0.1077	0.0983	0.0894	0.0811	0.0734	0.0662	0.0595	0.0533	0.0476	0.0424	0.0377	0.0333	0.0294	0.0259	0.0227
+Weight	0.0076	0.0089	0.0105	0.0122	0.0142	0.0164	0.0190	0.0218	0.0250	0.0286	0.0326	0.0370	0.0419	0.0473	0.0531	0.0596	0.0665	0.0741	0.0822	0.0909	0.1002	0.1101	0.1206	0.1316	0.1432	0.1553	0.1678	0.1808	0.1941	0.2076	0.2215	0.2354	0.2494	0.2633	0.2772	0.2907	0.3040	0.3168	0.3290	0.3406	0.3514	0.3614	0.3704	0.3784	0.3853	0.3910	0.3955	0.3988	0.4007	0.4013	0.4006	0.3985	0.3952	0.3906	0.3847	0.3778	0.3697	0.3605	0.3505	0.3396	0.3280	0.3157	0.3028	0.2896	0.2759	0.2621	0.2481	0.2342	0.2202	0.2064	0.1929	0.1796	0.1667	0.1542	0.1422	0.1306	0.1197	0.1092	0.0994	0.0901	0.0815	0.0734	0.0659	0.0590	0.0526	0.0468	0.0414	0.0366	0.0322	0.0283	0.0247	0.0215	0.0187	0.0162	0.0140	0.0120	0.0103	0.0088	0.0075	0.0064	0.0054
diff --git a/sourcecodes/data/example_chl/bWRtype.txt b/sourcecodes/data/example_chl/bWRtype.txt
new file mode 100644
index 00000000..03b402ee
--- /dev/null
+++ b/sourcecodes/data/example_chl/bWRtype.txt
@@ -0,0 +1,2 @@
+Ctrq3	MAS	Neutrophil	Load	Weight
+2	1	1	1	1	
diff --git a/sourcecodes/data/example_chl/bWRvar.txt b/sourcecodes/data/example_chl/bWRvar.txt
new file mode 100644
index 00000000..56a6051c
--- /dev/null
+++ b/sourcecodes/data/example_chl/bWRvar.txt
@@ -0,0 +1 @@
+1
\ No newline at end of file
diff --git a/sourcecodes/data/example_chl/bWRvardata.txt b/sourcecodes/data/example_chl/bWRvardata.txt
new file mode 100644
index 00000000..56a6051c
--- /dev/null
+++ b/sourcecodes/data/example_chl/bWRvardata.txt
@@ -0,0 +1 @@
+1
\ No newline at end of file
diff --git a/sourcecodes/data/example_chl/bWRvarname.txt b/sourcecodes/data/example_chl/bWRvarname.txt
new file mode 100644
index 00000000..6ef2df09
--- /dev/null
+++ b/sourcecodes/data/example_chl/bWRvarname.txt
@@ -0,0 +1 @@
+Ctrq3
\ No newline at end of file
diff --git a/sourcecodes/data/example_chr2_spleen/cuLban.txt b/sourcecodes/data/example_chr2_spleen/cuLban.txt
new file mode 100644
index 00000000..fdd12dda
--- /dev/null
+++ b/sourcecodes/data/example_chr2_spleen/cuLban.txt
@@ -0,0 +1,51 @@
+From	To
+Ifih1	rs3664317
+Oas1a	rs3664317
+Parp9	rs3664317
+Dhx58	rs3664317
+Cd1d1	rs3664317
+Irf7	rs3664317
+Oas3	rs3664317
+Pml	rs3664317
+Mx1	rs3664317
+Ifit1	rs3664317
+Trim25	rs3664317
+Oas1g	rs3664317
+Pglyrp3	rs3664317
+Ifih1	rs3664317
+Oas1a	Ifih1
+Parp9	Ifih1
+Dhx58	Ifih1
+Cd1d1	Ifih1
+Irf7	Ifih1
+Oas3	Ifih1
+Pml	Ifih1
+Mx1	Ifih1
+Ifit1	Ifih1
+Trim25	Ifih1
+Oas1g	Ifih1
+Pglyrp3	Ifih1
+Oas1a	rs3664317
+Parp9	rs3664317
+Dhx58	rs3664317
+Cd1d1	rs3664317
+Irf7	rs3664317
+Oas3	rs3664317
+Pml	rs3664317
+Mx1	rs3664317
+Ifit1	rs3664317
+Trim25	rs3664317
+Oas1g	rs3664317
+Pglyrp3	rs3664317
+Oas1a	Ifih1
+Parp9	Ifih1
+Dhx58	Ifih1
+Cd1d1	Ifih1
+Irf7	Ifih1
+Oas3	Ifih1
+Pml	Ifih1
+Mx1	Ifih1
+Ifit1	Ifih1
+Trim25	Ifih1
+Oas1g	Ifih1
+Pglyrp3	Ifih1
diff --git a/sourcecodes/data/example_chr2_spleen/cuLcontinuous_input.txt b/sourcecodes/data/example_chr2_spleen/cuLcontinuous_input.txt
new file mode 100644
index 00000000..ca8ea1e5
--- /dev/null
+++ b/sourcecodes/data/example_chr2_spleen/cuLcontinuous_input.txt
@@ -0,0 +1,76 @@
+rs3664317	Oas1a	Parp9	Dhx58	Cd1d1	Irf7	Oas3	Pml	Mx1	Ifit1	Trim25	Oas1g	Pglyrp3	Ifih1
+2	1	1	1	1	1	1	1	1	1	1	1	1	1
+1	8.34	9.812	8.774	9.79	9.663	8.27	11.036	7.284	8.286	10.395	8.521	6.186	8.83
+1	8.368	9.738	8.566	9.144	9.484	8.818	11.03	6.977	8.294	10.076	8.529	5.968	8.828
+1	8.178	9.57	8.726	9.575	10.106	8.99	10.878	7.205	8.676	10.036	8.61	5.976	9.024
+1	8.116	9.901	8.904	9.959	9.793	8.336	11.105	7.598	8.316	10.292	8.401	5.814	8.836
+2	8.099	9.68	8.876	10.116	9.771	8.379	11.028	7.438	8.541	10.215	8.32	5.917	9.073
+1	8.262	9.59	8.24	10.088	8.938	7.832	10.486	6.752	7.825	9.908	8.196	6.15	8.446
+1	7.915	9.415	8.308	9.707	9.12	8.702	11.102	7.208	8.243	10.034	7.897	6.06	8.892
+2	8.565	10.002	8.96	9.779	10.322	9.24	11.278	7.644	8.893	10.42	8.773	5.914	9.407
+1	8.189	9.774	8.541	9.939	9.134	7.819	10.766	7.122	8.352	10.113	8.492	6.269	9.055
+1	8.476	9.954	8.908	9.476	9.92	8.764	11.134	7.859	8.788	10.17	8.862	6.226	9.17
+2	8.119	9.946	8.876	9.578	10.02	8.734	11.244	7.85	8.838	10.557	8.56	5.98	9.353
+2	8.305	9.713	8.972	9.789	9.839	8.804	10.948	7.682	8.896	10.181	8.854	5.979	9.567
+2	8.654	10	9.306	9.439	10.457	9.223	10.922	7.082	8.942	10.131	9.162	6.01	9.74
+1	8.105	9.748	8.725	10.119	9.782	8.575	11.113	7.63	8.674	10.355	8.59	6.279	8.908
+1	8.247	9.715	8.829	9.646	9.953	9.668	11.112	7.384	9.221	10.19	8.64	6	9.552
+1	8.511	9.994	9.014	9.89	10.266	8.444	10.599	7.331	9.153	10.012	8.837	6.148	9.023
+2	8.947	10.28	9.483	9.398	11.23	9.86	11.324	8.006	9.772	10.524	9.587	5.865	10.067
+1	8.526	9.685	8.921	9.7	10.126	9.373	11.121	7.497	9.003	10.357	8.156	6.334	9.678
+2	8.06	9.745	9.092	9.278	10.231	8.976	10.998	7.578	9.145	10.283	8.611	6.168	9.413
+2	7.93	9.728	8.694	9.512	9.826	9.016	11.276	7.604	8.767	10.378	8.577	5.963	9.264
+2	8.511	9.686	9.014	8.982	10.508	10.108	11.304	7.441	9.133	10.341	9.04	6.2	9.974
+2	8.645	9.997	8.97	9.443	10.393	9.302	11.409	7.785	8.894	10.552	9.051	5.997	9.412
+2	8.293	9.802	9.001	9.524	10.156	9.263	11.212	7.772	8.581	10.433	8.514	6.093	9.177
+1	7.781	9.712	8.97	9.375	10.12	9.484	11.317	7.347	8.972	10.393	8.352	6.193	9.587
+2	8.465	9.88	8.913	9.816	9.965	8.852	11.138	7.537	8.625	10.426	8.617	6.044	9.556
+2	8.657	10.026	9.189	9.691	10.302	9.268	11.194	7.634	9.143	10.378	9.05	6.067	9.679
+2	7.634	9.606	8.36	9.465	8.41	8.605	11.183	6.942	8.174	9.952	7.478	6.09	9.535
+1	7.669	9.494	8.779	9.552	9.362	8.52	11.024	7.131	8.378	10.391	8.114	6.07	8.851
+2	8.618	10.212	9.433	9.672	10.442	9.21	11.328	8.045	9.322	10.5	9.128	5.994	9.656
+2	8.731	10.27	9.342	9.43	10.697	10.117	11.286	7.749	9.734	10.464	9.322	6.156	9.876
+1	7.554	9.524	8.759	9.93	9.52	8.279	10.82	7.32	8.316	10.31	8.186	6.068	9.046
+1	8.262	9.677	8.75	9.444	10.052	8.634	10.888	7.32	8.562	9.893	8.644	6.212	8.918
+1	7.823	9.628	8.66	9.529	9.578	8.736	11.206	7.171	8.408	10.062	8.111	5.838	9.033
+1	8.28	9.572	8.784	9.428	9.862	9.424	11.27	7.288	8.505	10.174	8.642	6.022	9.313
+2	9.09	10.053	9.599	9.469	11.004	9.882	11.436	8.521	9.814	10.562	9.704	6.044	10.061
+1	8.446	9.989	9.297	9.688	10.577	9.129	11.102	7.718	9.484	10.231	9.072	6.17	9.21
+1	8.668	9.858	9.195	9.385	10.695	9.249	11.028	7.765	9.367	10.319	9.179	6.136	9.563
+2	8.574	10.059	9.281	9.233	10.508	9.247	11.145	8.138	9.505	10.402	9.192	5.992	9.848
+2	8.523	10.052	9.131	9.507	10.418	9.413	11.187	7.641	9.304	10.465	9.063	6.095	9.733
+1	7.987	9.748	8.766	9.578	9.781	8.482	11.279	7.52	8.364	10.141	8.207	6.192	9.133
+2	8.466	9.429	8.946	9.395	9.715	9.071	11.388	7.592	8.078	10.32	8.326	6.108	9.021
+1	7.668	9.694	8.493	10.112	9.561	8.394	10.922	7.26	8.19	10.27	7.916	5.892	8.974
+2	8.379	10.037	9.155	9.683	10.281	9.2	10.913	7.173	9.404	10.381	9.097	6.099	9.714
+2	7.805	9.654	8.454	9.198	10.065	9.468	11.217	6.917	8.43	10.459	8.11	6.068	9.068
+1	7.981	9.8	8.553	9.946	9.862	8.901	11.085	7.214	8.393	10.373	8.19	6.05	9.015
+1	7.746	9.688	8.578	9.901	9.358	7.866	10.928	7.354	7.929	10.233	8.066	5.754	8.883
+1	7.997	9.859	8.795	9.867	9.817	8.734	11.109	7.416	8.67	10.247	8.176	6.143	9.081
+1	8.674	9.689	9.06	9.81	10.544	8.995	11.189	7.781	9.219	10.07	8.98	5.992	9.143
+1	8.088	9.49	8.676	9.456	10.184	8.737	10.998	7.222	8.538	10.192	8.441	6.147	8.55
+1	8.001	9.801	8.669	9.977	9.383	8.274	11.055	7.231	7.913	10.272	8.277	5.931	9.009
+2	8.218	9.458	8.781	9.214	9.66	8.87	10.738	7.241	8.289	10.029	8.612	6.125	9.38
+1	7.684	9.56	8.75	10.077	9.686	8.27	11.102	7.206	8.13	10.212	8.07	6.018	8.984
+2	8.326	9.696	8.88	9.714	10.014	9.08	11.055	7.256	8.494	10.054	8.63	6.177	9.162
+2	8.906	10.106	9.412	9.704	11.06	9.854	11.335	7.799	10.103	10.471	9.25	6.033	9.97
+1	8.073	9.793	8.626	9.879	9.262	8.408	10.844	7.108	8.368	9.959	8.261	6.052	8.916
+2	8.527	10.026	9.143	9.244	10.597	9.566	11.108	7.778	9.748	10.351	9.153	6.055	9.698
+2	8.614	10.05	9.202	9.508	10.66	9.63	11.156	7.758	9.789	10.324	9.068	6.15	9.948
+2	8.522	10.158	8.992	9.684	9.992	8.55	11.125	7.914	8.976	10.311	8.574	5.889	9.566
+1	8.086	9.6	8.522	9.544	9.641	8.514	10.99	7.386	8.506	10.194	8.234	6.02	8.736
+1	7.873	9.596	8.452	9.422	9.278	8.509	10.958	7.057	8.081	9.981	7.969	6.136	8.958
+2	8.371	9.99	8.949	9.931	10.195	8.935	10.83	7.694	9.183	10.493	9.124	6.128	9.396
+2	8.476	9.982	9.115	9.639	10.465	9.833	11.105	8.058	9.9	10.351	9.182	6.05	9.884
+1	8.512	9.995	8.846	9.951	9.561	8.558	10.769	7.584	8.901	10.139	8.769	5.959	9.203
+1	8.358	9.858	8.99	9.981	10.123	9.368	10.989	7.463	9.327	9.93	8.54	6.02	9.543
+1	8.23	9.614	8.806	9.919	9.939	9.108	11.184	7.766	8.793	10.174	8.605	5.972	9.068
+2	8.238	9.802	8.926	9.595	10.062	8.77	11.202	7.712	9.131	10.34	8.57	6.05	9.464
+1	8.533	10.108	9.083	10.214	10.514	8.463	11.008	7.356	9.344	10.196	8.736	6.262	9.257
+1	7.866	9.444	8.223	9.865	8.95	8.539	10.935	6.754	7.748	10.177	7.826	6.29	8.716
+2	8.888	10.031	9.158	9.407	10.8	9.547	11.238	7.659	9.602	10.398	9.337	6.028	9.529
+1	8.026	9.682	8.398	9.824	9.202	8.041	10.703	7.322	8.352	10.209	8.196	6.009	9.001
+2	8.974	10.071	9.451	9.348	11.061	9.686	11.255	8.077	10.101	10.323	9.557	6.006	10.072
+1	8.181	9.432	9.045	9.544	10.651	9.18	10.832	7.419	8.742	9.818	8.546	6.33	9.201
+1	8.137	9.676	9.024	9.37	10.206	9.944	10.985	7.226	8.9	10.362	8.918	6.352	9.367
+
diff --git a/sourcecodes/data/example_chr2_spleen/cuLgraphviz.txt b/sourcecodes/data/example_chr2_spleen/cuLgraphviz.txt
new file mode 100644
index 00000000..824e26d5
--- /dev/null
+++ b/sourcecodes/data/example_chr2_spleen/cuLgraphviz.txt
@@ -0,0 +1,32 @@
+digraph G {
+size="10,10";  ratio = fill;
+node [shape=square,width=1.5];
+rs3664317 -> Dhx58;
+rs3664317 -> Cd1d1;
+rs3664317 -> Ifit1;
+rs3664317 -> Oas1g;
+rs3664317 -> Ifih1;
+Parp9 -> Oas1a;
+Dhx58 -> Irf7;
+Dhx58 -> Mx1;
+Dhx58 -> Ifit1;
+Dhx58 -> Trim25;
+Dhx58 -> Oas1g;
+Cd1d1 -> Oas3;
+Cd1d1 -> Trim25;
+Cd1d1 -> Pglyrp3;
+Oas3 -> Pglyrp3;
+Pml -> Oas3;
+Pml -> Pglyrp3;
+Ifit1 -> Irf7;
+Ifit1 -> Mx1;
+Trim25 -> Parp9;
+Trim25 -> Pml;
+Trim25 -> Pglyrp3;
+Ifih1 -> Parp9;
+Ifih1 -> Dhx58;
+Ifih1 -> Cd1d1;
+Ifih1 -> Oas3;
+Ifih1 -> Ifit1;
+Ifih1 -> Trim25;
+}
\ No newline at end of file
diff --git a/sourcecodes/data/example_chr2_spleen/cuLk.txt b/sourcecodes/data/example_chr2_spleen/cuLk.txt
new file mode 100644
index 00000000..29d6383b
--- /dev/null
+++ b/sourcecodes/data/example_chr2_spleen/cuLk.txt
@@ -0,0 +1 @@
+100
diff --git a/sourcecodes/data/example_chr2_spleen/cuLmap.txt b/sourcecodes/data/example_chr2_spleen/cuLmap.txt
new file mode 100644
index 00000000..325f9a8d
--- /dev/null
+++ b/sourcecodes/data/example_chr2_spleen/cuLmap.txt
@@ -0,0 +1,14 @@
+rs3664317	2	0.501140	1.452055
+Oas1a	1	0.347301	8.281466
+Parp9	1	0.216211	9.804164
+Dhx58	1	0.302026	8.891247
+Cd1d1	1	0.268738	9.643644
+Irf7	1	0.548579	10.009315
+Oas3	1	0.548788	8.957397
+Pml	1	0.190985	11.075425
+Mx1	1	0.336795	7.483137
+Ifit1	1	0.569192	8.828521
+Trim25	1	0.176657	10.255192
+Oas1g	1	0.458134	8.632151
+Pglyrp3	1	0.123345	6.070877
+Ifih1	1	0.387383	9.298137
diff --git a/sourcecodes/data/example_chr2_spleen/cuLmapdata.txt b/sourcecodes/data/example_chr2_spleen/cuLmapdata.txt
new file mode 100644
index 00000000..64d3fc62
--- /dev/null
+++ b/sourcecodes/data/example_chr2_spleen/cuLmapdata.txt
@@ -0,0 +1 @@
+rs3664317	Ifih1	Cd1d1	Dhx58	Oas1g	Trim25	Pml	Oas3	Pglyrp3	Parp9	Oas1a	Ifit1	Mx1	Irf7
diff --git a/sourcecodes/data/example_chr2_spleen/cuLname.txt b/sourcecodes/data/example_chr2_spleen/cuLname.txt
new file mode 100644
index 00000000..1cc6fe19
--- /dev/null
+++ b/sourcecodes/data/example_chr2_spleen/cuLname.txt
@@ -0,0 +1 @@
+rs3664317	Oas1a	Parp9	Dhx58	Cd1d1	Irf7	Oas3	Pml	Mx1	Ifit1	Trim25	Oas1g	Pglyrp3	Ifih1
diff --git a/sourcecodes/data/example_chr2_spleen/cuLnet_figure.txt b/sourcecodes/data/example_chr2_spleen/cuLnet_figure.txt
new file mode 100644
index 00000000..79f052a0
--- /dev/null
+++ b/sourcecodes/data/example_chr2_spleen/cuLnet_figure.txt
@@ -0,0 +1,1387 @@
+14
+1200	1400	
+rs3664317	360	0
+Ifih1	480	175
+Cd1d1	160	350
+Dhx58	560	350
+Oas1g	180	525
+Trim25	480	525
+Pml	0	700
+Oas3	280	875
+Pglyrp3	360	1050
+Parp9	240	700
+Oas1a	680	875
+Ifit1	780	525
+Mx1	480	700
+Irf7	720	700
+rs3664317	2
+250	150
+0
+5	2	3	4	5	12
+1	0.5479
+2	0.4521
+Ifih1	1
+250	150
+1	1
+6	3	4	6	8	10	12
+-3.1997	0.0023
+-3.1378	0.0028
+-3.0758	0.0034
+-3.0138	0.0041
+-2.9518	0.0050
+-2.8899	0.0060
+-2.8279	0.0071
+-2.7659	0.0085
+-2.7039	0.0101
+-2.6420	0.0119
+-2.5800	0.0140
+-2.5180	0.0164
+-2.4560	0.0192
+-2.3941	0.0223
+-2.3321	0.0259
+-2.2701	0.0299
+-2.2081	0.0343
+-2.1462	0.0393
+-2.0842	0.0449
+-2.0222	0.0510
+-1.9602	0.0578
+-1.8983	0.0652
+-1.8363	0.0733
+-1.7743	0.0820
+-1.7124	0.0914
+-1.6504	0.1015
+-1.5884	0.1124
+-1.5264	0.1238
+-1.4645	0.1359
+-1.4025	0.1487
+-1.3405	0.1620
+-1.2785	0.1758
+-1.2166	0.1900
+-1.1546	0.2046
+-1.0926	0.2195
+-1.0306	0.2345
+-0.9687	0.2496
+-0.9067	0.2647
+-0.8447	0.2795
+-0.7827	0.2941
+-0.7208	0.3082
+-0.6588	0.3218
+-0.5968	0.3347
+-0.5348	0.3467
+-0.4729	0.3578
+-0.4109	0.3678
+-0.3489	0.3766
+-0.2870	0.3842
+-0.2250	0.3903
+-0.1630	0.3951
+-0.1010	0.3984
+-0.0391	0.4001
+0.0229	0.4003
+0.0849	0.3990
+0.1469	0.3961
+0.2088	0.3917
+0.2708	0.3859
+0.3328	0.3787
+0.3948	0.3702
+0.4567	0.3605
+0.5187	0.3497
+0.5807	0.3379
+0.6427	0.3252
+0.7046	0.3118
+0.7666	0.2978
+0.8286	0.2834
+0.8906	0.2685
+0.9525	0.2535
+1.0145	0.2384
+1.0765	0.2234
+1.1385	0.2084
+1.2004	0.1938
+1.2624	0.1794
+1.3244	0.1655
+1.3863	0.1521
+1.4483	0.1392
+1.5103	0.1269
+1.5723	0.1153
+1.6342	0.1043
+1.6962	0.0940
+1.7582	0.0844
+1.8202	0.0755
+1.8821	0.0672
+1.9441	0.0597
+2.0061	0.0527
+2.0681	0.0464
+2.1300	0.0407
+2.1920	0.0356
+2.2540	0.0310
+2.3160	0.0269
+2.3779	0.0232
+2.4399	0.0200
+2.5019	0.0171
+2.5639	0.0146
+2.6258	0.0124
+2.6878	0.0105
+2.7498	0.0089
+2.8117	0.0075
+2.8737	0.0063
+2.9357	0.0052
+2.9977	0.0043
+Cd1d1	1
+250	150
+2	1	2
+3	6	8	9
+-3.4620	0.0010
+-3.3962	0.0012
+-3.3304	0.0015
+-3.2645	0.0019
+-3.1987	0.0023
+-3.1328	0.0029
+-3.0670	0.0035
+-3.0011	0.0043
+-2.9353	0.0052
+-2.8694	0.0064
+-2.8036	0.0077
+-2.7378	0.0092
+-2.6719	0.0110
+-2.6061	0.0131
+-2.5402	0.0156
+-2.4744	0.0184
+-2.4085	0.0216
+-2.3427	0.0253
+-2.2768	0.0295
+-2.2110	0.0342
+-2.1452	0.0395
+-2.0793	0.0455
+-2.0135	0.0521
+-1.9476	0.0594
+-1.8818	0.0674
+-1.8159	0.0762
+-1.7501	0.0857
+-1.6843	0.0960
+-1.6184	0.1072
+-1.5526	0.1190
+-1.4867	0.1316
+-1.4209	0.1449
+-1.3550	0.1589
+-1.2892	0.1734
+-1.2233	0.1885
+-1.1575	0.2039
+-1.0917	0.2197
+-1.0258	0.2357
+-0.9600	0.2517
+-0.8941	0.2677
+-0.8283	0.2834
+-0.7624	0.2987
+-0.6966	0.3135
+-0.6308	0.3276
+-0.5649	0.3408
+-0.4991	0.3530
+-0.4332	0.3641
+-0.3674	0.3739
+-0.3015	0.3823
+-0.2357	0.3891
+-0.1698	0.3944
+-0.1040	0.3980
+-0.0382	0.3999
+0.0277	0.4000
+0.0935	0.3984
+0.1594	0.3951
+0.2252	0.3901
+0.2911	0.3835
+0.3569	0.3753
+0.4227	0.3658
+0.4886	0.3549
+0.5544	0.3428
+0.6203	0.3297
+0.6861	0.3158
+0.7520	0.3011
+0.8178	0.2858
+0.8837	0.2702
+0.9495	0.2543
+1.0153	0.2382
+1.0812	0.2223
+1.1470	0.2064
+1.2129	0.1909
+1.2787	0.1758
+1.3446	0.1612
+1.4104	0.1471
+1.4763	0.1337
+1.5421	0.1210
+1.6079	0.1090
+1.6738	0.0978
+1.7396	0.0873
+1.8055	0.0776
+1.8713	0.0687
+1.9372	0.0606
+2.0030	0.0532
+2.0688	0.0465
+2.1347	0.0404
+2.2005	0.0350
+2.2664	0.0302
+2.3322	0.0259
+2.3981	0.0222
+2.4639	0.0189
+2.5298	0.0160
+2.5956	0.0135
+2.6614	0.0113
+2.7273	0.0095
+2.7931	0.0079
+2.8590	0.0066
+2.9248	0.0054
+2.9907	0.0044
+3.0565	0.0036
+3.1223	0.0030
+Dhx58	1
+250	150
+2	1	2
+5	5	6	12	13	14
+-3.2125	0.0024
+-3.1470	0.0029
+-3.0814	0.0035
+-3.0159	0.0043
+-2.9503	0.0053
+-2.8848	0.0064
+-2.8192	0.0076
+-2.7536	0.0092
+-2.6881	0.0110
+-2.6225	0.0130
+-2.5570	0.0154
+-2.4914	0.0182
+-2.4258	0.0213
+-2.3603	0.0249
+-2.2947	0.0290
+-2.2292	0.0336
+-2.1636	0.0388
+-2.0980	0.0446
+-2.0325	0.0510
+-1.9669	0.0581
+-1.9014	0.0659
+-1.8358	0.0745
+-1.7702	0.0838
+-1.7047	0.0938
+-1.6391	0.1046
+-1.5736	0.1162
+-1.5080	0.1284
+-1.4425	0.1414
+-1.3769	0.1550
+-1.3113	0.1692
+-1.2458	0.1839
+-1.1802	0.1990
+-1.1147	0.2145
+-1.0491	0.2302
+-0.9835	0.2459
+-0.9180	0.2617
+-0.8524	0.2772
+-0.7869	0.2924
+-0.7213	0.3071
+-0.6557	0.3212
+-0.5902	0.3346
+-0.5246	0.3469
+-0.4591	0.3582
+-0.3935	0.3683
+-0.3280	0.3771
+-0.2624	0.3844
+-0.1968	0.3902
+-0.1313	0.3944
+-0.0657	0.3970
+-0.0002	0.3978
+0.0654	0.3970
+0.1310	0.3944
+0.1965	0.3902
+0.2621	0.3845
+0.3276	0.3771
+0.3932	0.3684
+0.4588	0.3583
+0.5243	0.3470
+0.5899	0.3346
+0.6554	0.3213
+0.7210	0.3072
+0.7866	0.2925
+0.8521	0.2773
+0.9177	0.2617
+0.9832	0.2460
+1.0488	0.2302
+1.1143	0.2146
+1.1799	0.1991
+1.2455	0.1840
+1.3110	0.1693
+1.3766	0.1551
+1.4421	0.1415
+1.5077	0.1285
+1.5733	0.1162
+1.6388	0.1047
+1.7044	0.0939
+1.7699	0.0838
+1.8355	0.0745
+1.9011	0.0660
+1.9666	0.0582
+2.0322	0.0510
+2.0977	0.0446
+2.1633	0.0388
+2.2288	0.0337
+2.2944	0.0290
+2.3600	0.0250
+2.4255	0.0213
+2.4911	0.0182
+2.5566	0.0154
+2.6222	0.0130
+2.6878	0.0110
+2.7533	0.0092
+2.8189	0.0077
+2.8844	0.0064
+2.9500	0.0053
+3.0156	0.0043
+3.0811	0.0035
+3.1467	0.0029
+3.2122	0.0024
+3.2778	0.0019
+3.3434	0.0015
+Oas1g	1
+250	150
+2	1	4
+0
+-3.5192	0.0009
+-3.4507	0.0011
+-3.3821	0.0014
+-3.3135	0.0018
+-3.2449	0.0022
+-3.1763	0.0028
+-3.1077	0.0034
+-3.0391	0.0042
+-2.9705	0.0052
+-2.9019	0.0063
+-2.8334	0.0076
+-2.7648	0.0092
+-2.6962	0.0111
+-2.6276	0.0133
+-2.5590	0.0158
+-2.4904	0.0187
+-2.4218	0.0221
+-2.3532	0.0260
+-2.2847	0.0304
+-2.2161	0.0353
+-2.1475	0.0409
+-2.0789	0.0472
+-2.0103	0.0542
+-1.9417	0.0619
+-1.8731	0.0704
+-1.8045	0.0797
+-1.7359	0.0899
+-1.6674	0.1008
+-1.5988	0.1125
+-1.5302	0.1251
+-1.4616	0.1383
+-1.3930	0.1523
+-1.3244	0.1670
+-1.2558	0.1822
+-1.1872	0.1978
+-1.1186	0.2138
+-1.0501	0.2300
+-0.9815	0.2464
+-0.9129	0.2626
+-0.8443	0.2787
+-0.7757	0.2943
+-0.7071	0.3094
+-0.6385	0.3238
+-0.5699	0.3373
+-0.5014	0.3497
+-0.4328	0.3609
+-0.3642	0.3707
+-0.2956	0.3791
+-0.2270	0.3858
+-0.1584	0.3909
+-0.0898	0.3942
+-0.0212	0.3956
+0.0474	0.3953
+0.1159	0.3931
+0.1845	0.3891
+0.2531	0.3834
+0.3217	0.3761
+0.3903	0.3672
+0.4589	0.3568
+0.5275	0.3451
+0.5961	0.3323
+0.6646	0.3184
+0.7332	0.3038
+0.8018	0.2884
+0.8704	0.2726
+0.9390	0.2565
+1.0076	0.2401
+1.0762	0.2238
+1.1448	0.2077
+1.2134	0.1918
+1.2819	0.1763
+1.3505	0.1613
+1.4191	0.1469
+1.4877	0.1332
+1.5563	0.1202
+1.6249	0.1080
+1.6935	0.0965
+1.7621	0.0859
+1.8307	0.0761
+1.8992	0.0671
+1.9678	0.0589
+2.0364	0.0514
+2.1050	0.0447
+2.1736	0.0387
+2.2422	0.0334
+2.3108	0.0286
+2.3794	0.0244
+2.4479	0.0208
+2.5165	0.0176
+2.5851	0.0148
+2.6537	0.0124
+2.7223	0.0103
+2.7909	0.0086
+2.8595	0.0071
+2.9281	0.0058
+2.9967	0.0048
+3.0652	0.0039
+3.1338	0.0032
+3.2024	0.0025
+3.2710	0.0020
+3.3396	0.0016
+Trim25	1
+250	150
+3	2	3	4
+3	7	9	10
+-3.4748	0.0009
+-3.4127	0.0012
+-3.3506	0.0014
+-3.2885	0.0018
+-3.2263	0.0022
+-3.1642	0.0026
+-3.1021	0.0032
+-3.0400	0.0039
+-2.9779	0.0047
+-2.9158	0.0056
+-2.8536	0.0068
+-2.7915	0.0081
+-2.7294	0.0096
+-2.6673	0.0113
+-2.6052	0.0133
+-2.5431	0.0156
+-2.4810	0.0183
+-2.4188	0.0213
+-2.3567	0.0247
+-2.2946	0.0286
+-2.2325	0.0329
+-2.1704	0.0377
+-2.1083	0.0431
+-2.0461	0.0490
+-1.9840	0.0556
+-1.9219	0.0628
+-1.8598	0.0706
+-1.7977	0.0791
+-1.7356	0.0883
+-1.6735	0.0982
+-1.6113	0.1087
+-1.5492	0.1200
+-1.4871	0.1319
+-1.4250	0.1444
+-1.3629	0.1575
+-1.3008	0.1711
+-1.2386	0.1851
+-1.1765	0.1996
+-1.1144	0.2144
+-1.0523	0.2293
+-0.9902	0.2444
+-0.9281	0.2594
+-0.8660	0.2743
+-0.8038	0.2889
+-0.7417	0.3031
+-0.6796	0.3168
+-0.6175	0.3299
+-0.5554	0.3422
+-0.4933	0.3535
+-0.4311	0.3638
+-0.3690	0.3730
+-0.3069	0.3809
+-0.2448	0.3875
+-0.1827	0.3927
+-0.1206	0.3964
+-0.0585	0.3987
+0.0037	0.3993
+0.0658	0.3985
+0.1279	0.3961
+0.1900	0.3922
+0.2521	0.3868
+0.3142	0.3801
+0.3764	0.3720
+0.4385	0.3627
+0.5006	0.3522
+0.5627	0.3408
+0.6248	0.3284
+0.6869	0.3153
+0.7490	0.3015
+0.8112	0.2872
+0.8733	0.2725
+0.9354	0.2576
+0.9975	0.2426
+1.0596	0.2275
+1.1217	0.2126
+1.1839	0.1979
+1.2460	0.1835
+1.3081	0.1695
+1.3702	0.1559
+1.4323	0.1429
+1.4944	0.1304
+1.5565	0.1186
+1.6187	0.1075
+1.6808	0.0970
+1.7429	0.0872
+1.8050	0.0781
+1.8671	0.0696
+1.9292	0.0619
+1.9914	0.0548
+2.0535	0.0483
+2.1156	0.0424
+2.1777	0.0371
+2.2398	0.0323
+2.3019	0.0281
+2.3640	0.0243
+2.4262	0.0209
+2.4883	0.0180
+2.5504	0.0153
+2.6125	0.0131
+2.6746	0.0111
+2.7367	0.0094
+Pml	1
+250	150
+1	6
+2	8	9
+-4.0862	0.0001
+-4.0165	0.0001
+-3.9468	0.0002
+-3.8770	0.0002
+-3.8073	0.0003
+-3.7375	0.0004
+-3.6678	0.0005
+-3.5980	0.0006
+-3.5283	0.0008
+-3.4586	0.0010
+-3.3888	0.0013
+-3.3191	0.0016
+-3.2493	0.0020
+-3.1796	0.0026
+-3.1098	0.0032
+-3.0401	0.0040
+-2.9704	0.0049
+-2.9006	0.0060
+-2.8309	0.0073
+-2.7611	0.0089
+-2.6914	0.0107
+-2.6217	0.0129
+-2.5519	0.0154
+-2.4822	0.0184
+-2.4124	0.0218
+-2.3427	0.0257
+-2.2729	0.0302
+-2.2032	0.0353
+-2.1335	0.0411
+-2.0637	0.0476
+-1.9940	0.0548
+-1.9242	0.0628
+-1.8545	0.0716
+-1.7847	0.0813
+-1.7150	0.0918
+-1.6453	0.1032
+-1.5755	0.1155
+-1.5058	0.1285
+-1.4360	0.1424
+-1.3663	0.1570
+-1.2966	0.1722
+-1.2268	0.1880
+-1.1571	0.2043
+-1.0873	0.2209
+-1.0176	0.2377
+-0.9478	0.2546
+-0.8781	0.2713
+-0.8084	0.2877
+-0.7386	0.3036
+-0.6689	0.3188
+-0.5991	0.3332
+-0.5294	0.3466
+-0.4596	0.3587
+-0.3899	0.3695
+-0.3202	0.3787
+-0.2504	0.3863
+-0.1807	0.3922
+-0.1109	0.3962
+-0.0412	0.3983
+0.0286	0.3985
+0.0983	0.3967
+0.1680	0.3930
+0.2378	0.3875
+0.3075	0.3802
+0.3773	0.3713
+0.4470	0.3608
+0.5167	0.3489
+0.5865	0.3357
+0.6562	0.3215
+0.7260	0.3064
+0.7957	0.2906
+0.8655	0.2743
+0.9352	0.2576
+1.0049	0.2408
+1.0747	0.2240
+1.1444	0.2073
+1.2142	0.1910
+1.2839	0.1751
+1.3537	0.1597
+1.4234	0.1450
+1.4931	0.1310
+1.5629	0.1178
+1.6326	0.1054
+1.7024	0.0938
+1.7721	0.0831
+1.8418	0.0733
+1.9116	0.0643
+1.9813	0.0562
+2.0511	0.0488
+2.1208	0.0422
+2.1906	0.0363
+2.2603	0.0311
+2.3300	0.0265
+2.3998	0.0225
+2.4695	0.0190
+2.5393	0.0159
+2.6090	0.0133
+2.6788	0.0111
+2.7485	0.0092
+2.8182	0.0076
+2.8880	0.0062
+Oas3	1
+250	150
+3	2	3	7
+1	9
+-3.0744	0.0017
+-3.0125	0.0021
+-2.9506	0.0026
+-2.8888	0.0032
+-2.8269	0.0039
+-2.7650	0.0048
+-2.7031	0.0059
+-2.6413	0.0072
+-2.5794	0.0087
+-2.5175	0.0104
+-2.4556	0.0125
+-2.3938	0.0149
+-2.3319	0.0177
+-2.2700	0.0209
+-2.2081	0.0246
+-2.1463	0.0289
+-2.0844	0.0337
+-2.0225	0.0391
+-1.9606	0.0452
+-1.8988	0.0520
+-1.8369	0.0595
+-1.7750	0.0679
+-1.7132	0.0771
+-1.6513	0.0871
+-1.5894	0.0980
+-1.5275	0.1098
+-1.4657	0.1224
+-1.4038	0.1358
+-1.3419	0.1501
+-1.2800	0.1651
+-1.2182	0.1808
+-1.1563	0.1971
+-1.0944	0.2139
+-1.0325	0.2311
+-0.9707	0.2486
+-0.9088	0.2662
+-0.8469	0.2837
+-0.7850	0.3011
+-0.7232	0.3181
+-0.6613	0.3345
+-0.5994	0.3502
+-0.5375	0.3650
+-0.4757	0.3787
+-0.4138	0.3911
+-0.3519	0.4021
+-0.2901	0.4116
+-0.2282	0.4195
+-0.1663	0.4255
+-0.1044	0.4297
+-0.0426	0.4320
+0.0193	0.4324
+0.0812	0.4308
+0.1431	0.4273
+0.2049	0.4220
+0.2668	0.4148
+0.3287	0.4059
+0.3906	0.3954
+0.4524	0.3835
+0.5143	0.3702
+0.5762	0.3558
+0.6381	0.3405
+0.6999	0.3243
+0.7618	0.3075
+0.8237	0.2903
+0.8856	0.2728
+0.9474	0.2552
+1.0093	0.2377
+1.0712	0.2204
+1.1331	0.2034
+1.1949	0.1869
+1.2568	0.1709
+1.3187	0.1557
+1.3805	0.1411
+1.4424	0.1273
+1.5043	0.1144
+1.5662	0.1023
+1.6280	0.0911
+1.6899	0.0807
+1.7518	0.0712
+1.8137	0.0626
+1.8755	0.0547
+1.9374	0.0476
+1.9993	0.0413
+2.0612	0.0356
+2.1230	0.0306
+2.1849	0.0262
+2.2468	0.0223
+2.3087	0.0189
+2.3705	0.0159
+2.4324	0.0134
+2.4943	0.0112
+2.5562	0.0093
+2.6180	0.0077
+2.6799	0.0064
+2.7418	0.0052
+2.8037	0.0043
+2.8655	0.0035
+2.9274	0.0028
+2.9893	0.0023
+3.0511	0.0018
+3.1130	0.0015
+Pglyrp3	1
+250	150
+4	3	6	7	8
+0
+-3.5690	0.0011
+-3.5005	0.0014
+-3.4321	0.0017
+-3.3636	0.0021
+-3.2951	0.0026
+-3.2266	0.0032
+-3.1581	0.0039
+-3.0897	0.0047
+-3.0212	0.0057
+-2.9527	0.0069
+-2.8842	0.0083
+-2.8157	0.0100
+-2.7472	0.0119
+-2.6788	0.0141
+-2.6103	0.0166
+-2.5418	0.0196
+-2.4733	0.0229
+-2.4048	0.0267
+-2.3364	0.0310
+-2.2679	0.0359
+-2.1994	0.0413
+-2.1309	0.0474
+-2.0624	0.0541
+-1.9939	0.0614
+-1.9255	0.0695
+-1.8570	0.0783
+-1.7885	0.0878
+-1.7200	0.0981
+-1.6515	0.1091
+-1.5831	0.1208
+-1.5146	0.1332
+-1.4461	0.1462
+-1.3776	0.1598
+-1.3091	0.1739
+-1.2406	0.1885
+-1.1722	0.2034
+-1.1037	0.2185
+-1.0352	0.2337
+-0.9667	0.2490
+-0.8982	0.2640
+-0.8298	0.2788
+-0.7613	0.2931
+-0.6928	0.3069
+-0.6243	0.3199
+-0.5558	0.3320
+-0.4873	0.3431
+-0.4189	0.3530
+-0.3504	0.3617
+-0.2819	0.3690
+-0.2134	0.3748
+-0.1449	0.3790
+-0.0765	0.3817
+-0.0080	0.3827
+0.0605	0.3821
+0.1290	0.3798
+0.1975	0.3759
+0.2660	0.3705
+0.3344	0.3635
+0.4029	0.3552
+0.4714	0.3455
+0.5399	0.3347
+0.6084	0.3228
+0.6769	0.3100
+0.7453	0.2964
+0.8138	0.2822
+0.8823	0.2675
+0.9508	0.2525
+1.0193	0.2373
+1.0877	0.2220
+1.1562	0.2069
+1.2247	0.1919
+1.2932	0.1773
+1.3617	0.1631
+1.4302	0.1493
+1.4986	0.1362
+1.5671	0.1236
+1.6356	0.1118
+1.7041	0.1006
+1.7726	0.0902
+1.8410	0.0804
+1.9095	0.0715
+1.9780	0.0632
+2.0465	0.0557
+2.1150	0.0489
+2.1835	0.0427
+2.2519	0.0371
+2.3204	0.0321
+2.3889	0.0277
+2.4574	0.0238
+2.5259	0.0203
+2.5943	0.0173
+2.6628	0.0147
+2.7313	0.0124
+2.7998	0.0104
+2.8683	0.0087
+2.9368	0.0072
+3.0052	0.0060
+3.0737	0.0050
+3.1422	0.0041
+3.2107	0.0033
+3.2792	0.0027
+Parp9	1
+250	150
+2	2	6
+1	11
+-2.7999	0.0080
+-2.7399	0.0094
+-2.6799	0.0111
+-2.6199	0.0130
+-2.5599	0.0152
+-2.4999	0.0177
+-2.4399	0.0205
+-2.3799	0.0237
+-2.3199	0.0272
+-2.2599	0.0312
+-2.1999	0.0357
+-2.1398	0.0406
+-2.0798	0.0461
+-2.0198	0.0521
+-1.9598	0.0587
+-1.8998	0.0659
+-1.8398	0.0737
+-1.7798	0.0821
+-1.7198	0.0912
+-1.6598	0.1009
+-1.5998	0.1112
+-1.5398	0.1222
+-1.4798	0.1337
+-1.4198	0.1458
+-1.3598	0.1585
+-1.2997	0.1716
+-1.2397	0.1851
+-1.1797	0.1990
+-1.1197	0.2132
+-1.0597	0.2276
+-0.9997	0.2420
+-0.9397	0.2565
+-0.8797	0.2709
+-0.8197	0.2850
+-0.7597	0.2988
+-0.6997	0.3121
+-0.6397	0.3249
+-0.5797	0.3369
+-0.5197	0.3482
+-0.4596	0.3586
+-0.3996	0.3679
+-0.3396	0.3761
+-0.2796	0.3832
+-0.2196	0.3889
+-0.1596	0.3934
+-0.0996	0.3964
+-0.0396	0.3981
+0.0204	0.3983
+0.0804	0.3971
+0.1404	0.3945
+0.2004	0.3905
+0.2604	0.3851
+0.3204	0.3785
+0.3805	0.3706
+0.4405	0.3617
+0.5005	0.3516
+0.5605	0.3406
+0.6205	0.3288
+0.6805	0.3163
+0.7405	0.3031
+0.8005	0.2894
+0.8605	0.2754
+0.9205	0.2611
+0.9805	0.2467
+1.0405	0.2322
+1.1005	0.2178
+1.1605	0.2035
+1.2206	0.1895
+1.2806	0.1759
+1.3406	0.1626
+1.4006	0.1498
+1.4606	0.1375
+1.5206	0.1258
+1.5806	0.1146
+1.6406	0.1041
+1.7006	0.0942
+1.7606	0.0849
+1.8206	0.0763
+1.8806	0.0683
+1.9406	0.0609
+2.0006	0.0541
+2.0607	0.0480
+2.1207	0.0423
+2.1807	0.0372
+2.2407	0.0326
+2.3007	0.0285
+2.3607	0.0247
+2.4207	0.0214
+2.4807	0.0185
+2.5407	0.0159
+2.6007	0.0137
+2.6607	0.0117
+2.7207	0.0099
+2.7807	0.0084
+2.8407	0.0071
+2.9008	0.0060
+2.9608	0.0050
+3.0208	0.0042
+3.0808	0.0035
+3.1408	0.0029
+3.2008	0.0024
+Oas1a	1
+250	150
+1	10
+0
+-3.0946	0.0034
+-3.0304	0.0042
+-2.9662	0.0051
+-2.9019	0.0061
+-2.8377	0.0073
+-2.7735	0.0087
+-2.7093	0.0104
+-2.6450	0.0124
+-2.5808	0.0146
+-2.5166	0.0172
+-2.4524	0.0201
+-2.3881	0.0235
+-2.3239	0.0273
+-2.2597	0.0316
+-2.1955	0.0364
+-2.1312	0.0417
+-2.0670	0.0477
+-2.0028	0.0543
+-1.9385	0.0616
+-1.8743	0.0695
+-1.8101	0.0782
+-1.7459	0.0876
+-1.6816	0.0977
+-1.6174	0.1085
+-1.5532	0.1201
+-1.4890	0.1323
+-1.4247	0.1452
+-1.3605	0.1586
+-1.2963	0.1727
+-1.2320	0.1871
+-1.1678	0.2020
+-1.1036	0.2172
+-1.0394	0.2325
+-0.9751	0.2479
+-0.9109	0.2633
+-0.8467	0.2785
+-0.7825	0.2933
+-0.7182	0.3077
+-0.6540	0.3214
+-0.5898	0.3344
+-0.5256	0.3465
+-0.4613	0.3576
+-0.3971	0.3675
+-0.3329	0.3761
+-0.2686	0.3834
+-0.2044	0.3892
+-0.1402	0.3935
+-0.0760	0.3963
+-0.0117	0.3974
+0.0525	0.3969
+0.1167	0.3947
+0.1809	0.3910
+0.2452	0.3857
+0.3094	0.3790
+0.3736	0.3708
+0.4378	0.3613
+0.5021	0.3507
+0.5663	0.3389
+0.6305	0.3263
+0.6948	0.3128
+0.7590	0.2986
+0.8232	0.2839
+0.8874	0.2689
+0.9517	0.2536
+1.0159	0.2382
+1.0801	0.2228
+1.1443	0.2075
+1.2086	0.1925
+1.2728	0.1779
+1.3370	0.1637
+1.4012	0.1500
+1.4655	0.1369
+1.5297	0.1245
+1.5939	0.1127
+1.6582	0.1016
+1.7224	0.0912
+1.7866	0.0816
+1.8508	0.0726
+1.9151	0.0644
+1.9793	0.0569
+2.0435	0.0501
+2.1077	0.0439
+2.1720	0.0383
+2.2362	0.0332
+2.3004	0.0288
+2.3646	0.0248
+2.4289	0.0213
+2.4931	0.0182
+2.5573	0.0155
+2.6216	0.0131
+2.6858	0.0111
+2.7500	0.0093
+2.8142	0.0078
+2.8785	0.0065
+2.9427	0.0054
+3.0069	0.0045
+3.0711	0.0037
+3.1354	0.0030
+3.1996	0.0025
+3.2638	0.0020
+3.3280	0.0016
+Ifit1	1
+250	150
+3	1	2	4
+2	13	14
+-2.8983	0.0063
+-2.8370	0.0075
+-2.7756	0.0089
+-2.7142	0.0105
+-2.6528	0.0124
+-2.5915	0.0145
+-2.5301	0.0169
+-2.4687	0.0197
+-2.4073	0.0228
+-2.3460	0.0264
+-2.2846	0.0303
+-2.2232	0.0347
+-2.1618	0.0397
+-2.1005	0.0451
+-2.0391	0.0511
+-1.9777	0.0577
+-1.9164	0.0649
+-1.8550	0.0728
+-1.7936	0.0812
+-1.7322	0.0904
+-1.6709	0.1002
+-1.6095	0.1106
+-1.5481	0.1217
+-1.4867	0.1333
+-1.4254	0.1456
+-1.3640	0.1584
+-1.3026	0.1717
+-1.2412	0.1854
+-1.1799	0.1995
+-1.1185	0.2138
+-1.0571	0.2284
+-0.9957	0.2430
+-0.9344	0.2576
+-0.8730	0.2720
+-0.8116	0.2862
+-0.7502	0.3001
+-0.6889	0.3134
+-0.6275	0.3261
+-0.5661	0.3381
+-0.5047	0.3492
+-0.4434	0.3593
+-0.3820	0.3684
+-0.3206	0.3763
+-0.2592	0.3830
+-0.1979	0.3883
+-0.1365	0.3922
+-0.0751	0.3948
+-0.0137	0.3958
+0.0476	0.3954
+0.1090	0.3936
+0.1704	0.3902
+0.2318	0.3855
+0.2931	0.3795
+0.3545	0.3721
+0.4159	0.3635
+0.4773	0.3539
+0.5386	0.3432
+0.6000	0.3316
+0.6614	0.3192
+0.7228	0.3061
+0.7841	0.2925
+0.8455	0.2784
+0.9069	0.2641
+0.9682	0.2495
+1.0296	0.2349
+1.0910	0.2203
+1.1524	0.2059
+1.2137	0.1917
+1.2751	0.1778
+1.3365	0.1643
+1.3979	0.1513
+1.4592	0.1388
+1.5206	0.1268
+1.5820	0.1155
+1.6434	0.1047
+1.7047	0.0947
+1.7661	0.0852
+1.8275	0.0765
+1.8889	0.0683
+1.9502	0.0609
+2.0116	0.0540
+2.0730	0.0477
+2.1344	0.0420
+2.1957	0.0369
+2.2571	0.0322
+2.3185	0.0281
+2.3799	0.0244
+2.4412	0.0211
+2.5026	0.0181
+2.5640	0.0156
+2.6254	0.0133
+2.6867	0.0113
+2.7481	0.0096
+2.8095	0.0081
+2.8709	0.0068
+2.9322	0.0057
+2.9936	0.0048
+3.0550	0.0040
+3.1164	0.0033
+3.1777	0.0027
+3.2391	0.0023
+Mx1	1
+250	150
+2	4	12
+0
+-3.1709	0.0028
+-3.0983	0.0035
+-3.0258	0.0043
+-2.9533	0.0053
+-2.8808	0.0066
+-2.8082	0.0081
+-2.7357	0.0098
+-2.6632	0.0119
+-2.5907	0.0144
+-2.5181	0.0173
+-2.4456	0.0207
+-2.3731	0.0246
+-2.3006	0.0291
+-2.2280	0.0342
+-2.1555	0.0400
+-2.0830	0.0465
+-2.0105	0.0539
+-1.9379	0.0621
+-1.8654	0.0711
+-1.7929	0.0811
+-1.7204	0.0919
+-1.6479	0.1037
+-1.5753	0.1164
+-1.5028	0.1300
+-1.4303	0.1444
+-1.3578	0.1595
+-1.2852	0.1754
+-1.2127	0.1918
+-1.1402	0.2086
+-1.0677	0.2258
+-0.9951	0.2431
+-0.9226	0.2604
+-0.8501	0.2775
+-0.7776	0.2941
+-0.7050	0.3102
+-0.6325	0.3254
+-0.5600	0.3396
+-0.4875	0.3526
+-0.4149	0.3641
+-0.3424	0.3742
+-0.2699	0.3824
+-0.1974	0.3889
+-0.1248	0.3934
+-0.0523	0.3959
+0.0202	0.3964
+0.0927	0.3948
+0.1653	0.3911
+0.2378	0.3855
+0.3103	0.3780
+0.3828	0.3688
+0.4554	0.3579
+0.5279	0.3455
+0.6004	0.3318
+0.6729	0.3170
+0.7455	0.3013
+0.8180	0.2849
+0.8905	0.2680
+0.9630	0.2508
+1.0356	0.2335
+1.1081	0.2162
+1.1806	0.1992
+1.2531	0.1826
+1.3257	0.1665
+1.3982	0.1510
+1.4707	0.1363
+1.5432	0.1223
+1.6158	0.1092
+1.6883	0.0970
+1.7608	0.0858
+1.8333	0.0754
+1.9059	0.0660
+1.9784	0.0574
+2.0509	0.0497
+2.1234	0.0428
+2.1959	0.0367
+2.2685	0.0312
+2.3410	0.0265
+2.4135	0.0223
+2.4860	0.0187
+2.5586	0.0156
+2.6311	0.0130
+2.7036	0.0107
+2.7761	0.0088
+2.8487	0.0072
+2.9212	0.0059
+2.9937	0.0047
+3.0662	0.0038
+3.1388	0.0031
+3.2113	0.0024
+3.2838	0.0019
+3.3563	0.0015
+3.4289	0.0012
+3.5014	0.0009
+3.5739	0.0007
+3.6464	0.0006
+3.7190	0.0004
+3.7915	0.0003
+3.8640	0.0002
+3.9365	0.0002
+4.0091	0.0001
+4.0816	0.0001
+Irf7	1
+250	150
+2	4	12
+0
+-3.9154	0.0002
+-3.8440	0.0003
+-3.7726	0.0004
+-3.7012	0.0005
+-3.6298	0.0006
+-3.5583	0.0008
+-3.4869	0.0010
+-3.4155	0.0013
+-3.3441	0.0016
+-3.2727	0.0021
+-3.2013	0.0026
+-3.1299	0.0033
+-3.0585	0.0040
+-2.9871	0.0050
+-2.9157	0.0061
+-2.8443	0.0075
+-2.7729	0.0091
+-2.7015	0.0111
+-2.6301	0.0133
+-2.5587	0.0160
+-2.4873	0.0191
+-2.4159	0.0226
+-2.3445	0.0267
+-2.2730	0.0314
+-2.2016	0.0367
+-2.1302	0.0428
+-2.0588	0.0495
+-1.9874	0.0570
+-1.9160	0.0654
+-1.8446	0.0746
+-1.7732	0.0846
+-1.7018	0.0956
+-1.6304	0.1074
+-1.5590	0.1201
+-1.4876	0.1336
+-1.4162	0.1478
+-1.3448	0.1628
+-1.2734	0.1784
+-1.2020	0.1946
+-1.1306	0.2111
+-1.0592	0.2279
+-0.9878	0.2448
+-0.9163	0.2617
+-0.8449	0.2783
+-0.7735	0.2946
+-0.7021	0.3102
+-0.6307	0.3250
+-0.5593	0.3388
+-0.4879	0.3514
+-0.4165	0.3627
+-0.3451	0.3725
+-0.2737	0.3806
+-0.2023	0.3870
+-0.1309	0.3916
+-0.0595	0.3942
+0.0119	0.3948
+0.0833	0.3935
+0.1547	0.3903
+0.2261	0.3851
+0.2975	0.3781
+0.3690	0.3694
+0.4404	0.3591
+0.5118	0.3473
+0.5832	0.3343
+0.6546	0.3201
+0.7260	0.3050
+0.7974	0.2892
+0.8688	0.2728
+0.9402	0.2561
+1.0116	0.2392
+1.0830	0.2223
+1.1544	0.2056
+1.2258	0.1891
+1.2972	0.1732
+1.3686	0.1577
+1.4400	0.1430
+1.5114	0.1290
+1.5828	0.1157
+1.6543	0.1033
+1.7257	0.0918
+1.7971	0.0812
+1.8685	0.0714
+1.9399	0.0625
+2.0113	0.0544
+2.0827	0.0472
+2.1541	0.0407
+2.2255	0.0349
+2.2969	0.0298
+2.3683	0.0253
+2.4397	0.0214
+2.5111	0.0180
+2.5825	0.0151
+2.6539	0.0125
+2.7253	0.0104
+2.7967	0.0086
+2.8681	0.0070
+2.9396	0.0057
+3.0110	0.0047
+3.0824	0.0038
+3.1538	0.0030
+3.2252	0.0024
diff --git a/sourcecodes/data/example_chr2_spleen/cuLnet_figure_new.txt b/sourcecodes/data/example_chr2_spleen/cuLnet_figure_new.txt
new file mode 100644
index 00000000..7f631ad5
--- /dev/null
+++ b/sourcecodes/data/example_chr2_spleen/cuLnet_figure_new.txt
@@ -0,0 +1,1288 @@
+2	
+14
+1200	1400	
+rs3664317	360	0
+Ifih1	480	175
+Cd1d1	160	350
+Dhx58	560	350
+Oas1g	180	525
+Trim25	480	525
+Pml	0	700
+Oas3	280	875
+Pglyrp3	360	1050
+Parp9	240	700
+Oas1a	680	875
+Ifit1	780	525
+Mx1	480	700
+Irf7	720	700
+rs3664317	2
+250	150
+0
+5	2	3	4	5	12
+1	0.9980
+2	0.0020
+Ifih1	1
+250	150
+1	1
+6	3	4	6	8	10	12
+-3.3510	1.0000
+Cd1d1	1
+250	150
+2	1	2
+3	6	8	9
+-3.4620	0.0000
+-3.3962	0.0000
+-3.3304	0.0000
+-3.2645	0.0000
+-3.1987	0.0000
+-3.1328	0.0000
+-3.0670	0.0000
+-3.0011	0.0000
+-2.9353	0.0000
+-2.8694	0.0000
+-2.8036	0.0000
+-2.7378	0.0001
+-2.6719	0.0001
+-2.6061	0.0001
+-2.5402	0.0001
+-2.4744	0.0002
+-2.4085	0.0002
+-2.3427	0.0003
+-2.2768	0.0004
+-2.2110	0.0006
+-2.1452	0.0007
+-2.0793	0.0009
+-2.0135	0.0012
+-1.9476	0.0016
+-1.8818	0.0020
+-1.8159	0.0026
+-1.7501	0.0032
+-1.6843	0.0041
+-1.6184	0.0051
+-1.5526	0.0063
+-1.4867	0.0078
+-1.4209	0.0097
+-1.3550	0.0118
+-1.2892	0.0144
+-1.2233	0.0175
+-1.1575	0.0210
+-1.0917	0.0252
+-1.0258	0.0300
+-0.9600	0.0356
+-0.8941	0.0419
+-0.8283	0.0491
+-0.7624	0.0572
+-0.6966	0.0663
+-0.6308	0.0765
+-0.5649	0.0877
+-0.4991	0.1000
+-0.4332	0.1133
+-0.3674	0.1278
+-0.3015	0.1434
+-0.2357	0.1599
+-0.1698	0.1774
+-0.1040	0.1957
+-0.0382	0.2147
+0.0277	0.2343
+0.0935	0.2543
+0.1594	0.2744
+0.2252	0.2946
+0.2911	0.3144
+0.3569	0.3338
+0.4227	0.3524
+0.4886	0.3701
+0.5544	0.3865
+0.6203	0.4014
+0.6861	0.4146
+0.7520	0.4259
+0.8178	0.4351
+0.8837	0.4420
+0.9495	0.4466
+1.0153	0.4488
+1.0812	0.4485
+1.1470	0.4458
+1.2129	0.4407
+1.2787	0.4332
+1.3446	0.4236
+1.4104	0.4118
+1.4763	0.3983
+1.5421	0.3830
+1.6079	0.3663
+1.6738	0.3484
+1.7396	0.3296
+1.8055	0.3101
+1.8713	0.2902
+1.9372	0.2700
+2.0030	0.2499
+2.0688	0.2300
+2.1347	0.2105
+2.2005	0.1916
+2.2664	0.1735
+2.3322	0.1562
+2.3981	0.1399
+2.4639	0.1246
+2.5298	0.1103
+2.5956	0.0972
+2.6614	0.0851
+2.7273	0.0742
+2.7931	0.0643
+2.8590	0.0554
+2.9248	0.0474
+2.9907	0.0404
+3.0565	0.0343
+3.1223	0.0289
+Dhx58	1
+250	150
+2	1	2
+5	5	6	12	13	14
+-3.2125	0.2772
+-3.1470	0.3638
+-3.0814	0.4631
+-3.0159	0.5716
+-2.9503	0.6843
+-2.8848	0.7945
+-2.8192	0.8946
+-2.7536	0.9769
+-2.6881	1.0347
+-2.6225	1.0628
+-2.5570	1.0587
+-2.4914	1.0228
+-2.4258	0.9583
+-2.3603	0.8708
+-2.2947	0.7674
+-2.2292	0.6559
+-2.1636	0.5437
+-2.0980	0.4371
+-2.0325	0.3408
+-1.9669	0.2577
+-1.9014	0.1890
+-1.8358	0.1344
+-1.7702	0.0927
+-1.7047	0.0620
+-1.6391	0.0402
+-1.5736	0.0253
+-1.5080	0.0154
+-1.4425	0.0091
+-1.3769	0.0052
+-1.3113	0.0029
+-1.2458	0.0016
+-1.1802	0.0008
+-1.1147	0.0004
+-1.0491	0.0002
+-0.9835	0.0001
+-0.9180	0.0000
+-0.8524	0.0000
+-0.7869	0.0000
+-0.7213	0.0000
+-0.6557	0.0000
+-0.5902	0.0000
+-0.5246	0.0000
+-0.4591	0.0000
+-0.3935	0.0000
+-0.3280	0.0000
+-0.2624	0.0000
+-0.1968	0.0000
+-0.1313	0.0000
+-0.0657	0.0000
+-0.0002	0.0000
+0.0654	0.0000
+0.1310	0.0000
+0.1965	0.0000
+0.2621	0.0000
+0.3276	0.0000
+0.3932	0.0000
+0.4588	0.0000
+0.5243	0.0000
+0.5899	0.0000
+0.6554	0.0000
+0.7210	0.0000
+0.7866	0.0000
+0.8521	0.0000
+0.9177	0.0000
+0.9832	0.0000
+1.0488	0.0000
+1.1143	0.0000
+1.1799	0.0000
+1.2455	0.0000
+1.3110	0.0000
+1.3766	0.0000
+1.4421	0.0000
+1.5077	0.0000
+1.5733	0.0000
+1.6388	0.0000
+1.7044	0.0000
+1.7699	0.0000
+1.8355	0.0000
+1.9011	0.0000
+1.9666	0.0000
+2.0322	0.0000
+2.0977	0.0000
+2.1633	0.0000
+2.2288	0.0000
+2.2944	0.0000
+2.3600	0.0000
+2.4255	0.0000
+2.4911	0.0000
+2.5566	0.0000
+2.6222	0.0000
+2.6878	0.0000
+2.7533	0.0000
+2.8189	0.0000
+2.8844	0.0000
+2.9500	0.0000
+3.0156	0.0000
+3.0811	0.0000
+3.1467	0.0000
+3.2122	0.0000
+3.2778	0.0000
+3.3434	0.0000
+Oas1g	1
+250	150
+2	1	4
+0
+-3.5192	0.0005
+-3.4507	0.0009
+-3.3821	0.0017
+-3.3135	0.0030
+-3.2449	0.0053
+-3.1763	0.0090
+-3.1077	0.0148
+-3.0391	0.0238
+-2.9705	0.0371
+-2.9019	0.0562
+-2.8334	0.0829
+-2.7648	0.1187
+-2.6962	0.1652
+-2.6276	0.2236
+-2.5590	0.2943
+-2.4904	0.3764
+-2.4218	0.4681
+-2.3532	0.5659
+-2.2847	0.6652
+-2.2161	0.7600
+-2.1475	0.8442
+-2.0789	0.9116
+-2.0103	0.9570
+-1.9417	0.9767
+-1.8731	0.9691
+-1.8045	0.9347
+-1.7359	0.8764
+-1.6674	0.7989
+-1.5988	0.7080
+-1.5302	0.6100
+-1.4616	0.5109
+-1.3930	0.4159
+-1.3244	0.3292
+-1.2558	0.2533
+-1.1872	0.1895
+-1.1186	0.1378
+-1.0501	0.0974
+-0.9815	0.0670
+-0.9129	0.0448
+-0.8443	0.0291
+-0.7757	0.0184
+-0.7071	0.0113
+-0.6385	0.0067
+-0.5699	0.0039
+-0.5014	0.0022
+-0.4328	0.0012
+-0.3642	0.0006
+-0.2956	0.0003
+-0.2270	0.0002
+-0.1584	0.0001
+-0.0898	0.0000
+-0.0212	0.0000
+0.0474	0.0000
+0.1159	0.0000
+0.1845	0.0000
+0.2531	0.0000
+0.3217	0.0000
+0.3903	0.0000
+0.4589	0.0000
+0.5275	0.0000
+0.5961	0.0000
+0.6646	0.0000
+0.7332	0.0000
+0.8018	0.0000
+0.8704	0.0000
+0.9390	0.0000
+1.0076	0.0000
+1.0762	0.0000
+1.1448	0.0000
+1.2134	0.0000
+1.2819	0.0000
+1.3505	0.0000
+1.4191	0.0000
+1.4877	0.0000
+1.5563	0.0000
+1.6249	0.0000
+1.6935	0.0000
+1.7621	0.0000
+1.8307	0.0000
+1.8992	0.0000
+1.9678	0.0000
+2.0364	0.0000
+2.1050	0.0000
+2.1736	0.0000
+2.2422	0.0000
+2.3108	0.0000
+2.3794	0.0000
+2.4479	0.0000
+2.5165	0.0000
+2.5851	0.0000
+2.6537	0.0000
+2.7223	0.0000
+2.7909	0.0000
+2.8595	0.0000
+2.9281	0.0000
+2.9967	0.0000
+3.0652	0.0000
+3.1338	0.0000
+3.2024	0.0000
+3.2710	0.0000
+3.3396	0.0000
+Trim25	1
+250	150
+3	2	3	4
+3	7	9	10
+-3.4748	0.0273
+-3.4127	0.0331
+-3.3506	0.0400
+-3.2885	0.0479
+-3.2263	0.0570
+-3.1642	0.0675
+-3.1021	0.0792
+-3.0400	0.0925
+-2.9779	0.1072
+-2.9158	0.1235
+-2.8536	0.1413
+-2.7915	0.1606
+-2.7294	0.1814
+-2.6673	0.2034
+-2.6052	0.2267
+-2.5431	0.2510
+-2.4810	0.2760
+-2.4188	0.3015
+-2.3567	0.3273
+-2.2946	0.3528
+-2.2325	0.3779
+-2.1704	0.4021
+-2.1083	0.4250
+-2.0461	0.4463
+-1.9840	0.4655
+-1.9219	0.4824
+-1.8598	0.4966
+-1.7977	0.5078
+-1.7356	0.5159
+-1.6735	0.5207
+-1.6113	0.5220
+-1.5492	0.5199
+-1.4871	0.5144
+-1.4250	0.5056
+-1.3629	0.4937
+-1.3008	0.4789
+-1.2386	0.4615
+-1.1765	0.4417
+-1.1144	0.4201
+-1.0523	0.3969
+-0.9902	0.3724
+-0.9281	0.3472
+-0.8660	0.3216
+-0.8038	0.2959
+-0.7417	0.2705
+-0.6796	0.2456
+-0.6175	0.2215
+-0.5554	0.1985
+-0.4933	0.1767
+-0.4311	0.1562
+-0.3690	0.1373
+-0.3069	0.1198
+-0.2448	0.1039
+-0.1827	0.0894
+-0.1206	0.0765
+-0.0585	0.0650
+0.0037	0.0549
+0.0658	0.0461
+0.1279	0.0384
+0.1900	0.0318
+0.2521	0.0261
+0.3142	0.0213
+0.3764	0.0173
+0.4385	0.0140
+0.5006	0.0112
+0.5627	0.0089
+0.6248	0.0070
+0.6869	0.0055
+0.7490	0.0043
+0.8112	0.0033
+0.8733	0.0026
+0.9354	0.0020
+0.9975	0.0015
+1.0596	0.0011
+1.1217	0.0008
+1.1839	0.0006
+1.2460	0.0005
+1.3081	0.0003
+1.3702	0.0002
+1.4323	0.0002
+1.4944	0.0001
+1.5565	0.0001
+1.6187	0.0001
+1.6808	0.0000
+1.7429	0.0000
+1.8050	0.0000
+1.8671	0.0000
+1.9292	0.0000
+1.9914	0.0000
+2.0535	0.0000
+2.1156	0.0000
+2.1777	0.0000
+2.2398	0.0000
+2.3019	0.0000
+2.3640	0.0000
+2.4262	0.0000
+2.4883	0.0000
+2.5504	0.0000
+2.6125	0.0000
+2.6746	0.0000
+2.7367	0.0000
+Pml	1
+250	150
+1	6
+2	8	9
+-4.0862	0.0013
+-4.0165	0.0017
+-3.9468	0.0022
+-3.8770	0.0028
+-3.8073	0.0036
+-3.7375	0.0045
+-3.6678	0.0057
+-3.5980	0.0071
+-3.5283	0.0088
+-3.4586	0.0108
+-3.3888	0.0133
+-3.3191	0.0162
+-3.2493	0.0196
+-3.1796	0.0236
+-3.1098	0.0283
+-3.0401	0.0337
+-2.9704	0.0399
+-2.9006	0.0470
+-2.8309	0.0550
+-2.7611	0.0640
+-2.6914	0.0741
+-2.6217	0.0852
+-2.5519	0.0975
+-2.4822	0.1109
+-2.4124	0.1254
+-2.3427	0.1409
+-2.2729	0.1575
+-2.2032	0.1750
+-2.1335	0.1934
+-2.0637	0.2124
+-1.9940	0.2320
+-1.9242	0.2519
+-1.8545	0.2720
+-1.7847	0.2919
+-1.7150	0.3115
+-1.6453	0.3305
+-1.5755	0.3487
+-1.5058	0.3657
+-1.4360	0.3814
+-1.3663	0.3954
+-1.2966	0.4075
+-1.2268	0.4177
+-1.1571	0.4256
+-1.0873	0.4311
+-1.0176	0.4343
+-0.9478	0.4349
+-0.8781	0.4330
+-0.8084	0.4286
+-0.7386	0.4218
+-0.6689	0.4128
+-0.5991	0.4016
+-0.5294	0.3884
+-0.4596	0.3736
+-0.3899	0.3572
+-0.3202	0.3395
+-0.2504	0.3209
+-0.1807	0.3016
+-0.1109	0.2818
+-0.0412	0.2617
+0.0286	0.2417
+0.0983	0.2220
+0.1680	0.2026
+0.2378	0.1839
+0.3075	0.1660
+0.3773	0.1489
+0.4470	0.1328
+0.5167	0.1178
+0.5865	0.1039
+0.6562	0.0911
+0.7260	0.0794
+0.7957	0.0688
+0.8655	0.0593
+0.9352	0.0508
+1.0049	0.0433
+1.0747	0.0366
+1.1444	0.0308
+1.2142	0.0258
+1.2839	0.0215
+1.3537	0.0178
+1.4234	0.0146
+1.4931	0.0120
+1.5629	0.0097
+1.6326	0.0079
+1.7024	0.0063
+1.7721	0.0051
+1.8418	0.0040
+1.9116	0.0032
+1.9813	0.0025
+2.0511	0.0019
+2.1208	0.0015
+2.1906	0.0012
+2.2603	0.0009
+2.3300	0.0007
+2.3998	0.0005
+2.4695	0.0004
+2.5393	0.0003
+2.6090	0.0002
+2.6788	0.0002
+2.7485	0.0001
+2.8182	0.0001
+2.8880	0.0001
+Oas3	1
+250	150
+3	2	3	7
+1	9
+-3.0744	0.1968
+-3.0125	0.2591
+-2.9506	0.3326
+-2.8888	0.4165
+-2.8269	0.5085
+-2.7650	0.6055
+-2.7031	0.7031
+-2.6413	0.7962
+-2.5794	0.8793
+-2.5175	0.9470
+-2.4556	0.9947
+-2.3938	1.0188
+-2.3319	1.0177
+-2.2700	0.9913
+-2.2081	0.9417
+-2.1463	0.8724
+-2.0844	0.7882
+-2.0225	0.6945
+-1.9606	0.5967
+-1.8988	0.5000
+-1.8369	0.4086
+-1.7750	0.3256
+-1.7132	0.2531
+-1.6513	0.1918
+-1.5894	0.1418
+-1.5275	0.1022
+-1.4657	0.0718
+-1.4038	0.0492
+-1.3419	0.0329
+-1.2800	0.0215
+-1.2182	0.0136
+-1.1563	0.0085
+-1.0944	0.0051
+-1.0325	0.0030
+-0.9707	0.0017
+-0.9088	0.0010
+-0.8469	0.0005
+-0.7850	0.0003
+-0.7232	0.0001
+-0.6613	0.0001
+-0.5994	0.0000
+-0.5375	0.0000
+-0.4757	0.0000
+-0.4138	0.0000
+-0.3519	0.0000
+-0.2901	0.0000
+-0.2282	0.0000
+-0.1663	0.0000
+-0.1044	0.0000
+-0.0426	0.0000
+0.0193	0.0000
+0.0812	0.0000
+0.1431	0.0000
+0.2049	0.0000
+0.2668	0.0000
+0.3287	0.0000
+0.3906	0.0000
+0.4524	0.0000
+0.5143	0.0000
+0.5762	0.0000
+0.6381	0.0000
+0.6999	0.0000
+0.7618	0.0000
+0.8237	0.0000
+0.8856	0.0000
+0.9474	0.0000
+1.0093	0.0000
+1.0712	0.0000
+1.1331	0.0000
+1.1949	0.0000
+1.2568	0.0000
+1.3187	0.0000
+1.3805	0.0000
+1.4424	0.0000
+1.5043	0.0000
+1.5662	0.0000
+1.6280	0.0000
+1.6899	0.0000
+1.7518	0.0000
+1.8137	0.0000
+1.8755	0.0000
+1.9374	0.0000
+1.9993	0.0000
+2.0612	0.0000
+2.1230	0.0000
+2.1849	0.0000
+2.2468	0.0000
+2.3087	0.0000
+2.3705	0.0000
+2.4324	0.0000
+2.4943	0.0000
+2.5562	0.0000
+2.6180	0.0000
+2.6799	0.0000
+2.7418	0.0000
+2.8037	0.0000
+2.8655	0.0000
+2.9274	0.0000
+2.9893	0.0000
+3.0511	0.0000
+3.1130	0.0000
+Pglyrp3	1
+250	150
+4	3	6	7	8
+0
+-3.5690	0.0027
+-3.5005	0.0034
+-3.4321	0.0041
+-3.3636	0.0050
+-3.2951	0.0061
+-3.2266	0.0074
+-3.1581	0.0089
+-3.0897	0.0106
+-3.0212	0.0127
+-2.9527	0.0150
+-2.8842	0.0178
+-2.8157	0.0209
+-2.7472	0.0245
+-2.6788	0.0285
+-2.6103	0.0331
+-2.5418	0.0383
+-2.4733	0.0441
+-2.4048	0.0505
+-2.3364	0.0576
+-2.2679	0.0655
+-2.1994	0.0740
+-2.1309	0.0833
+-2.0624	0.0934
+-1.9939	0.1042
+-1.9255	0.1158
+-1.8570	0.1281
+-1.7885	0.1411
+-1.7200	0.1547
+-1.6515	0.1689
+-1.5831	0.1835
+-1.5146	0.1986
+-1.4461	0.2140
+-1.3776	0.2295
+-1.3091	0.2450
+-1.2406	0.2605
+-1.1722	0.2757
+-1.1037	0.2906
+-1.0352	0.3049
+-0.9667	0.3185
+-0.8982	0.3312
+-0.8298	0.3429
+-0.7613	0.3535
+-0.6928	0.3628
+-0.6243	0.3707
+-0.5558	0.3771
+-0.4873	0.3819
+-0.4189	0.3851
+-0.3504	0.3866
+-0.2819	0.3865
+-0.2134	0.3846
+-0.1449	0.3810
+-0.0765	0.3758
+-0.0080	0.3691
+0.0605	0.3609
+0.1290	0.3513
+0.1975	0.3404
+0.2660	0.3285
+0.3344	0.3155
+0.4029	0.3018
+0.4714	0.2874
+0.5399	0.2724
+0.6084	0.2571
+0.6769	0.2416
+0.7453	0.2261
+0.8138	0.2106
+0.8823	0.1953
+0.9508	0.1803
+1.0193	0.1657
+1.0877	0.1517
+1.1562	0.1382
+1.2247	0.1254
+1.2932	0.1132
+1.3617	0.1018
+1.4302	0.0911
+1.4986	0.0812
+1.5671	0.0721
+1.6356	0.0637
+1.7041	0.0560
+1.7726	0.0490
+1.8410	0.0428
+1.9095	0.0371
+1.9780	0.0321
+2.0465	0.0276
+2.1150	0.0236
+2.1835	0.0202
+2.2519	0.0171
+2.3204	0.0145
+2.3889	0.0122
+2.4574	0.0102
+2.5259	0.0085
+2.5943	0.0071
+2.6628	0.0058
+2.7313	0.0048
+2.7998	0.0039
+2.8683	0.0032
+2.9368	0.0026
+3.0052	0.0021
+3.0737	0.0017
+3.1422	0.0014
+3.2107	0.0011
+3.2792	0.0009
+Parp9	1
+250	150
+2	2	6
+1	11
+-2.7999	0.3911
+-2.7399	0.4346
+-2.6799	0.4778
+-2.6199	0.5196
+-2.5599	0.5590
+-2.4999	0.5949
+-2.4399	0.6263
+-2.3799	0.6523
+-2.3199	0.6721
+-2.2599	0.6850
+-2.1999	0.6907
+-2.1398	0.6890
+-2.0798	0.6798
+-2.0198	0.6636
+-1.9598	0.6408
+-1.8998	0.6122
+-1.8398	0.5785
+-1.7798	0.5408
+-1.7198	0.5002
+-1.6598	0.4576
+-1.5998	0.4141
+-1.5398	0.3708
+-1.4798	0.3284
+-1.4198	0.2878
+-1.3598	0.2494
+-1.2997	0.2139
+-1.2397	0.1814
+-1.1797	0.1522
+-1.1197	0.1264
+-1.0597	0.1038
+-0.9997	0.0843
+-0.9397	0.0678
+-0.8797	0.0539
+-0.8197	0.0424
+-0.7597	0.0330
+-0.6997	0.0254
+-0.6397	0.0193
+-0.5797	0.0145
+-0.5197	0.0108
+-0.4596	0.0080
+-0.3996	0.0058
+-0.3396	0.0042
+-0.2796	0.0030
+-0.2196	0.0021
+-0.1596	0.0015
+-0.0996	0.0010
+-0.0396	0.0007
+0.0204	0.0005
+0.0804	0.0003
+0.1404	0.0002
+0.2004	0.0001
+0.2604	0.0001
+0.3204	0.0001
+0.3805	0.0000
+0.4405	0.0000
+0.5005	0.0000
+0.5605	0.0000
+0.6205	0.0000
+0.6805	0.0000
+0.7405	0.0000
+0.8005	0.0000
+0.8605	0.0000
+0.9205	0.0000
+0.9805	0.0000
+1.0405	0.0000
+1.1005	0.0000
+1.1605	0.0000
+1.2206	0.0000
+1.2806	0.0000
+1.3406	0.0000
+1.4006	0.0000
+1.4606	0.0000
+1.5206	0.0000
+1.5806	0.0000
+1.6406	0.0000
+1.7006	0.0000
+1.7606	0.0000
+1.8206	0.0000
+1.8806	0.0000
+1.9406	0.0000
+2.0006	0.0000
+2.0607	0.0000
+2.1207	0.0000
+2.1807	0.0000
+2.2407	0.0000
+2.3007	0.0000
+2.3607	0.0000
+2.4207	0.0000
+2.4807	0.0000
+2.5407	0.0000
+2.6007	0.0000
+2.6607	0.0000
+2.7207	0.0000
+2.7807	0.0000
+2.8407	0.0000
+2.9008	0.0000
+2.9608	0.0000
+3.0208	0.0000
+3.0808	0.0000
+3.1408	0.0000
+3.2008	0.0000
+Oas1a	1
+250	150
+1	10
+0
+-3.0946	0.0747
+-3.0304	0.0873
+-2.9662	0.1013
+-2.9019	0.1168
+-2.8377	0.1338
+-2.7735	0.1522
+-2.7093	0.1720
+-2.6450	0.1932
+-2.5808	0.2155
+-2.5166	0.2388
+-2.4524	0.2629
+-2.3881	0.2875
+-2.3239	0.3124
+-2.2597	0.3371
+-2.1955	0.3615
+-2.1312	0.3850
+-2.0670	0.4074
+-2.0028	0.4282
+-1.9385	0.4472
+-1.8743	0.4639
+-1.8101	0.4780
+-1.7459	0.4894
+-1.6816	0.4977
+-1.6174	0.5029
+-1.5532	0.5047
+-1.4890	0.5032
+-1.4247	0.4985
+-1.3605	0.4905
+-1.2963	0.4795
+-1.2320	0.4656
+-1.1678	0.4492
+-1.1036	0.4304
+-1.0394	0.4098
+-0.9751	0.3876
+-0.9109	0.3642
+-0.8467	0.3399
+-0.7825	0.3152
+-0.7182	0.2903
+-0.6540	0.2656
+-0.5898	0.2415
+-0.5256	0.2181
+-0.4613	0.1956
+-0.3971	0.1744
+-0.3329	0.1544
+-0.2686	0.1358
+-0.2044	0.1186
+-0.1402	0.1030
+-0.0760	0.0888
+-0.0117	0.0761
+0.0525	0.0647
+0.1167	0.0547
+0.1809	0.0459
+0.2452	0.0383
+0.3094	0.0318
+0.3736	0.0262
+0.4378	0.0214
+0.5021	0.0174
+0.5663	0.0140
+0.6305	0.0113
+0.6948	0.0090
+0.7590	0.0071
+0.8232	0.0056
+0.8874	0.0044
+0.9517	0.0034
+1.0159	0.0026
+1.0801	0.0020
+1.1443	0.0015
+1.2086	0.0011
+1.2728	0.0009
+1.3370	0.0006
+1.4012	0.0005
+1.4655	0.0003
+1.5297	0.0003
+1.5939	0.0002
+1.6582	0.0001
+1.7224	0.0001
+1.7866	0.0001
+1.8508	0.0000
+1.9151	0.0000
+1.9793	0.0000
+2.0435	0.0000
+2.1077	0.0000
+2.1720	0.0000
+2.2362	0.0000
+2.3004	0.0000
+2.3646	0.0000
+2.4289	0.0000
+2.4931	0.0000
+2.5573	0.0000
+2.6216	0.0000
+2.6858	0.0000
+2.7500	0.0000
+2.8142	0.0000
+2.8785	0.0000
+2.9427	0.0000
+3.0069	0.0000
+3.0711	0.0000
+3.1354	0.0000
+3.1996	0.0000
+3.2638	0.0000
+3.3280	0.0000
+Ifit1	1
+250	150
+3	1	2	4
+2	13	14
+-2.8983	0.9160
+-2.8370	1.0549
+-2.7756	1.1688
+-2.7142	1.2459
+-2.6528	1.2777
+-2.5915	1.2606
+-2.5301	1.1965
+-2.4687	1.0926
+-2.4073	0.9599
+-2.3460	0.8113
+-2.2846	0.6598
+-2.2232	0.5161
+-2.1618	0.3885
+-2.1005	0.2813
+-2.0391	0.1960
+-1.9777	0.1313
+-1.9164	0.0847
+-1.8550	0.0525
+-1.7936	0.0313
+-1.7322	0.0180
+-1.6709	0.0099
+-1.6095	0.0053
+-1.5481	0.0027
+-1.4867	0.0013
+-1.4254	0.0006
+-1.3640	0.0003
+-1.3026	0.0001
+-1.2412	0.0001
+-1.1799	0.0000
+-1.1185	0.0000
+-1.0571	0.0000
+-0.9957	0.0000
+-0.9344	0.0000
+-0.8730	0.0000
+-0.8116	0.0000
+-0.7502	0.0000
+-0.6889	0.0000
+-0.6275	0.0000
+-0.5661	0.0000
+-0.5047	0.0000
+-0.4434	0.0000
+-0.3820	0.0000
+-0.3206	0.0000
+-0.2592	0.0000
+-0.1979	0.0000
+-0.1365	0.0000
+-0.0751	0.0000
+-0.0137	0.0000
+0.0476	0.0000
+0.1090	0.0000
+0.1704	0.0000
+0.2318	0.0000
+0.2931	0.0000
+0.3545	0.0000
+0.4159	0.0000
+0.4773	0.0000
+0.5386	0.0000
+0.6000	0.0000
+0.6614	0.0000
+0.7228	0.0000
+0.7841	0.0000
+0.8455	0.0000
+0.9069	0.0000
+0.9682	0.0000
+1.0296	0.0000
+1.0910	0.0000
+1.1524	0.0000
+1.2137	0.0000
+1.2751	0.0000
+1.3365	0.0000
+1.3979	0.0000
+1.4592	0.0000
+1.5206	0.0000
+1.5820	0.0000
+1.6434	0.0000
+1.7047	0.0000
+1.7661	0.0000
+1.8275	0.0000
+1.8889	0.0000
+1.9502	0.0000
+2.0116	0.0000
+2.0730	0.0000
+2.1344	0.0000
+2.1957	0.0000
+2.2571	0.0000
+2.3185	0.0000
+2.3799	0.0000
+2.4412	0.0000
+2.5026	0.0000
+2.5640	0.0000
+2.6254	0.0000
+2.6867	0.0000
+2.7481	0.0000
+2.8095	0.0000
+2.8709	0.0000
+2.9322	0.0000
+2.9936	0.0000
+3.0550	0.0000
+3.1164	0.0000
+3.1777	0.0000
+3.2391	0.0000
+Mx1	1
+250	150
+2	4	12
+0
+-3.1709	0.1330
+-3.0983	0.1643
+-3.0258	0.2000
+-2.9533	0.2398
+-2.8808	0.2834
+-2.8082	0.3299
+-2.7357	0.3785
+-2.6632	0.4278
+-2.5907	0.4764
+-2.5181	0.5228
+-2.4456	0.5653
+-2.3731	0.6022
+-2.3006	0.6321
+-2.2280	0.6538
+-2.1555	0.6662
+-2.0830	0.6690
+-2.0105	0.6619
+-1.9379	0.6452
+-1.8654	0.6197
+-1.7929	0.5865
+-1.7204	0.5469
+-1.6479	0.5024
+-1.5753	0.4548
+-1.5028	0.4057
+-1.4303	0.3566
+-1.3578	0.3088
+-1.2852	0.2635
+-1.2127	0.2215
+-1.1402	0.1835
+-1.0677	0.1497
+-0.9951	0.1204
+-0.9226	0.0954
+-0.8501	0.0745
+-0.7776	0.0573
+-0.7050	0.0434
+-0.6325	0.0324
+-0.5600	0.0239
+-0.4875	0.0173
+-0.4149	0.0124
+-0.3424	0.0087
+-0.2699	0.0060
+-0.1974	0.0041
+-0.1248	0.0028
+-0.0523	0.0018
+0.0202	0.0012
+0.0927	0.0008
+0.1653	0.0005
+0.2378	0.0003
+0.3103	0.0002
+0.3828	0.0001
+0.4554	0.0001
+0.5279	0.0000
+0.6004	0.0000
+0.6729	0.0000
+0.7455	0.0000
+0.8180	0.0000
+0.8905	0.0000
+0.9630	0.0000
+1.0356	0.0000
+1.1081	0.0000
+1.1806	0.0000
+1.2531	0.0000
+1.3257	0.0000
+1.3982	0.0000
+1.4707	0.0000
+1.5432	0.0000
+1.6158	0.0000
+1.6883	0.0000
+1.7608	0.0000
+1.8333	0.0000
+1.9059	0.0000
+1.9784	0.0000
+2.0509	0.0000
+2.1234	0.0000
+2.1959	0.0000
+2.2685	0.0000
+2.3410	0.0000
+2.4135	0.0000
+2.4860	0.0000
+2.5586	0.0000
+2.6311	0.0000
+2.7036	0.0000
+2.7761	0.0000
+2.8487	0.0000
+2.9212	0.0000
+2.9937	0.0000
+3.0662	0.0000
+3.1388	0.0000
+3.2113	0.0000
+3.2838	0.0000
+3.3563	0.0000
+3.4289	0.0000
+3.5014	0.0000
+3.5739	0.0000
+3.6464	0.0000
+3.7190	0.0000
+3.7915	0.0000
+3.8640	0.0000
+3.9365	0.0000
+4.0091	0.0000
+4.0816	0.0000
+Irf7	1
+250	150
+2	4	12
+0
+-3.9154	0.0040
+-3.8440	0.0068
+-3.7726	0.0113
+-3.7012	0.0181
+-3.6298	0.0282
+-3.5583	0.0429
+-3.4869	0.0635
+-3.4155	0.0916
+-3.3441	0.1284
+-3.2727	0.1753
+-3.2013	0.2330
+-3.1299	0.3015
+-3.0585	0.3798
+-2.9871	0.4657
+-2.9157	0.5560
+-2.8443	0.6461
+-2.7729	0.7310
+-2.7015	0.8051
+-2.6301	0.8632
+-2.5587	0.9010
+-2.4873	0.9155
+-2.4159	0.9056
+-2.3445	0.8721
+-2.2730	0.8175
+-2.2016	0.7461
+-2.1302	0.6628
+-2.0588	0.5732
+-1.9874	0.4827
+-1.9160	0.3956
+-1.8446	0.3157
+-1.7732	0.2452
+-1.7018	0.1854
+-1.6304	0.1365
+-1.5590	0.0978
+-1.4876	0.0682
+-1.4162	0.0463
+-1.3448	0.0306
+-1.2734	0.0197
+-1.2020	0.0124
+-1.1306	0.0075
+-1.0592	0.0045
+-0.9878	0.0026
+-0.9163	0.0015
+-0.8449	0.0008
+-0.7735	0.0004
+-0.7021	0.0002
+-0.6307	0.0001
+-0.5593	0.0001
+-0.4879	0.0000
+-0.4165	0.0000
+-0.3451	0.0000
+-0.2737	0.0000
+-0.2023	0.0000
+-0.1309	0.0000
+-0.0595	0.0000
+0.0119	0.0000
+0.0833	0.0000
+0.1547	0.0000
+0.2261	0.0000
+0.2975	0.0000
+0.3690	0.0000
+0.4404	0.0000
+0.5118	0.0000
+0.5832	0.0000
+0.6546	0.0000
+0.7260	0.0000
+0.7974	0.0000
+0.8688	0.0000
+0.9402	0.0000
+1.0116	0.0000
+1.0830	0.0000
+1.1544	0.0000
+1.2258	0.0000
+1.2972	0.0000
+1.3686	0.0000
+1.4400	0.0000
+1.5114	0.0000
+1.5828	0.0000
+1.6543	0.0000
+1.7257	0.0000
+1.7971	0.0000
+1.8685	0.0000
+1.9399	0.0000
+2.0113	0.0000
+2.0827	0.0000
+2.1541	0.0000
+2.2255	0.0000
+2.2969	0.0000
+2.3683	0.0000
+2.4397	0.0000
+2.5111	0.0000
+2.5825	0.0000
+2.6539	0.0000
+2.7253	0.0000
+2.7967	0.0000
+2.8681	0.0000
+2.9396	0.0000
+3.0110	0.0000
+3.0824	0.0000
+3.1538	0.0000
+3.2252	0.0000
diff --git a/sourcecodes/data/example_chr2_spleen/cuLnlevels.txt b/sourcecodes/data/example_chr2_spleen/cuLnlevels.txt
new file mode 100644
index 00000000..605579c3
--- /dev/null
+++ b/sourcecodes/data/example_chr2_spleen/cuLnlevels.txt
@@ -0,0 +1,2 @@
+rs3664317	1	2
+
diff --git a/sourcecodes/data/example_chr2_spleen/cuLnnode.txt b/sourcecodes/data/example_chr2_spleen/cuLnnode.txt
new file mode 100644
index 00000000..8351c193
--- /dev/null
+++ b/sourcecodes/data/example_chr2_spleen/cuLnnode.txt
@@ -0,0 +1 @@
+14
diff --git a/sourcecodes/data/example_chr2_spleen/cuLnrows.txt b/sourcecodes/data/example_chr2_spleen/cuLnrows.txt
new file mode 100644
index 00000000..fff0a247
--- /dev/null
+++ b/sourcecodes/data/example_chr2_spleen/cuLnrows.txt
@@ -0,0 +1 @@
+74
diff --git a/sourcecodes/data/example_chr2_spleen/cuLparent.txt b/sourcecodes/data/example_chr2_spleen/cuLparent.txt
new file mode 100644
index 00000000..b8626c4c
--- /dev/null
+++ b/sourcecodes/data/example_chr2_spleen/cuLparent.txt
@@ -0,0 +1 @@
+4
diff --git a/sourcecodes/data/example_chr2_spleen/cuLrun_evidencemodified.sh b/sourcecodes/data/example_chr2_spleen/cuLrun_evidencemodified.sh
new file mode 100644
index 00000000..5a228612
--- /dev/null
+++ b/sourcecodes/data/example_chr2_spleen/cuLrun_evidencemodified.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+# script for execution of deployed applications
+#
+# Sets up the MCR environment for the current $ARCH and executes 
+# the specified command.
+#
+exe_name=$0
+exe_dir=`dirname "$0"`
+echo "------------------------------------------"
+if [ "x$1" = "x" ]; then
+  echo Usage:
+  echo    $0 \<deployedMCRroot\> args
+else
+  echo Setting up environment variables
+  MCRROOT="$1"
+  echo ---
+  LD_LIBRARY_PATH=.:${MCRROOT}/runtime/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/bin/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/sys/os/glnxa64;
+	MCRJRE=${MCRROOT}/sys/java/jre/glnxa64/jre/lib/amd64 ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/native_threads ; 
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/server ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/client ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE} ;  
+  XAPPLRESDIR=${MCRROOT}/X11/app-defaults ;
+  export LD_LIBRARY_PATH;
+  export XAPPLRESDIR;
+  echo LD_LIBRARY_PATH is ${LD_LIBRARY_PATH};
+  shift 1
+  args=
+  while [ $# -gt 0 ]; do
+      token=`echo "$1" | sed 's/ /\\\\ /g'`   # Add blackslash before each blank
+      args="${args} ${token}" 
+      shift
+  done
+  "${exe_dir}"/evidencemodified cuL
+fi
+exit
diff --git a/sourcecodes/data/example_chr2_spleen/cuLrun_initialstructure.sh b/sourcecodes/data/example_chr2_spleen/cuLrun_initialstructure.sh
new file mode 100644
index 00000000..1d0835a4
--- /dev/null
+++ b/sourcecodes/data/example_chr2_spleen/cuLrun_initialstructure.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+# script for execution of deployed applications
+#
+# Sets up the MCR environment for the current $ARCH and executes 
+# the specified command.
+#
+exe_name=$0
+exe_dir=`dirname "$0"`
+echo "------------------------------------------"
+if [ "x$1" = "x" ]; then
+  echo Usage:
+  echo    $0 \<deployedMCRroot\> args
+else
+  echo Setting up environment variables
+  MCRROOT="$1"
+  echo ---
+  LD_LIBRARY_PATH=.:${MCRROOT}/runtime/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/bin/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/sys/os/glnxa64;
+	MCRJRE=${MCRROOT}/sys/java/jre/glnxa64/jre/lib/amd64 ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/native_threads ; 
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/server ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/client ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE} ;  
+  XAPPLRESDIR=${MCRROOT}/X11/app-defaults ;
+  export LD_LIBRARY_PATH;
+  export XAPPLRESDIR;
+  echo LD_LIBRARY_PATH is ${LD_LIBRARY_PATH};
+  shift 1
+  args=
+  while [ $# -gt 0 ]; do
+      token=`echo "$1" | sed 's/ /\\\\ /g'`   # Add blackslash before each blank
+      args="${args} ${token}" 
+      shift
+  done
+  "${exe_dir}"/initialstructure cuL
+fi
+exit
diff --git a/sourcecodes/data/example_chr2_spleen/cuLstructure_input.txt b/sourcecodes/data/example_chr2_spleen/cuLstructure_input.txt
new file mode 100644
index 00000000..48837c69
--- /dev/null
+++ b/sourcecodes/data/example_chr2_spleen/cuLstructure_input.txt
@@ -0,0 +1,15 @@
+rs3664317	Oas1a	Parp9	Dhx58	Cd1d1	Irf7	Oas3	Pml	Mx1	Ifit1	Trim25	Oas1g	Pglyrp3	Ifih1	
+0	0	0	1	1	0	0	0	0	1	0	1	0	1	
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	
+0	1	0	0	0	0	0	0	0	0	0	0	0	0	
+0	0	0	0	0	1	0	0	1	1	1	1	0	0	
+0	0	0	0	0	0	1	0	0	0	1	0	1	0	
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	
+0	0	0	0	0	0	0	0	0	0	0	0	1	0	
+0	0	0	0	0	0	1	0	0	0	0	0	1	0	
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	
+0	0	0	0	0	1	0	0	1	0	0	0	0	0	
+0	0	1	0	0	0	0	1	0	0	0	0	1	0	
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	
+0	0	1	1	1	0	1	0	0	1	1	0	0	0	
diff --git a/sourcecodes/data/example_chr2_spleen/cuLstructure_input_temp.txt b/sourcecodes/data/example_chr2_spleen/cuLstructure_input_temp.txt
new file mode 100644
index 00000000..f3589770
--- /dev/null
+++ b/sourcecodes/data/example_chr2_spleen/cuLstructure_input_temp.txt
@@ -0,0 +1,15 @@
+rs3664317	Oas1a	Parp9	Dhx58	Cd1d1	Irf7	Oas3	Pml	Mx1	Ifit1	Trim25	Oas1g	Pglyrp3	Ifih1	
+0.000000	0.808614	0.000000	1.000000	1.000000	0.000000	0.000000	0.000000	0.250558	1.000000	0.000000	0.960922	0.000000	1.000000	
+0.000000	0.000000	0.000000	0.000000	0.000000	0.596398	0.000000	0.786929	0.055837	0.000000	0.000000	0.590731	0.000000	0.000000	
+0.000000	0.942409	0.000000	0.000000	0.000000	0.018121	0.000000	0.000000	0.000000	0.409269	0.000000	0.401871	0.000000	0.000000	
+0.000000	0.590731	0.000000	0.000000	0.000000	1.000000	0.000000	0.000000	1.000000	1.000000	1.000000	1.000000	0.018396	0.000000	
+0.000000	0.038935	0.000000	0.500000	0.000000	0.036744	1.000000	0.000000	0.000000	0.000000	1.000000	0.039078	1.000000	0.000000	
+0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.786929	0.164752	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	
+0.000000	0.056298	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.981604	0.000000	
+0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	1.000000	0.000000	0.786929	0.000000	0.000000	0.000000	1.000000	0.000000	
+0.000000	0.000000	0.000000	0.000000	0.000000	0.290596	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	
+0.000000	0.075670	0.000000	0.000000	0.000000	1.000000	0.213071	0.641848	1.000000	0.000000	0.000000	0.000000	0.000000	0.000000	
+0.000000	0.526176	1.000000	0.000000	0.000000	0.036744	0.000000	1.000000	0.269815	0.000000	0.000000	0.000000	1.000000	0.000000	
+0.000000	0.000000	0.000000	0.000000	0.000000	0.750185	0.000000	0.622177	0.636861	0.590731	0.000000	0.000000	0.000000	0.000000	
+0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	
+0.000000	0.360110	1.000000	1.000000	1.000000	0.018780	1.000000	0.000000	0.000000	1.000000	1.000000	0.348314	0.000000	0.000000	
diff --git a/sourcecodes/data/example_chr2_spleen/cuLstructure_old.txt b/sourcecodes/data/example_chr2_spleen/cuLstructure_old.txt
new file mode 100644
index 00000000..f0815c7a
--- /dev/null
+++ b/sourcecodes/data/example_chr2_spleen/cuLstructure_old.txt
@@ -0,0 +1,14 @@
+rs3664317	0.5479	0.4521
+Dhx58	0.0024	0.0029	0.0035	0.0043	0.0053	0.0064	0.0076	0.0092	0.0110	0.0130	0.0154	0.0182	0.0213	0.0249	0.0290	0.0336	0.0388	0.0446	0.0510	0.0581	0.0659	0.0745	0.0838	0.0938	0.1046	0.1162	0.1284	0.1414	0.1550	0.1692	0.1839	0.1990	0.2145	0.2302	0.2459	0.2617	0.2772	0.2924	0.3071	0.3212	0.3346	0.3469	0.3582	0.3683	0.3771	0.3844	0.3902	0.3944	0.3970	0.3978	0.3970	0.3944	0.3902	0.3845	0.3771	0.3684	0.3583	0.3470	0.3346	0.3213	0.3072	0.2925	0.2773	0.2617	0.2460	0.2302	0.2146	0.1991	0.1840	0.1693	0.1551	0.1415	0.1285	0.1162	0.1047	0.0939	0.0838	0.0745	0.0660	0.0582	0.0510	0.0446	0.0388	0.0337	0.0290	0.0250	0.0213	0.0182	0.0154	0.0130	0.0110	0.0092	0.0077	0.0064	0.0053	0.0043	0.0035	0.0029	0.0024	0.0019	0.0015
+Cd1d1	0.0010	0.0012	0.0015	0.0019	0.0023	0.0029	0.0035	0.0043	0.0052	0.0064	0.0077	0.0092	0.0110	0.0131	0.0156	0.0184	0.0216	0.0253	0.0295	0.0342	0.0395	0.0455	0.0521	0.0594	0.0674	0.0762	0.0857	0.0960	0.1072	0.1190	0.1316	0.1449	0.1589	0.1734	0.1885	0.2039	0.2197	0.2357	0.2517	0.2677	0.2834	0.2987	0.3135	0.3276	0.3408	0.3530	0.3641	0.3739	0.3823	0.3891	0.3944	0.3980	0.3999	0.4000	0.3984	0.3951	0.3901	0.3835	0.3753	0.3658	0.3549	0.3428	0.3297	0.3158	0.3011	0.2858	0.2702	0.2543	0.2382	0.2223	0.2064	0.1909	0.1758	0.1612	0.1471	0.1337	0.1210	0.1090	0.0978	0.0873	0.0776	0.0687	0.0606	0.0532	0.0465	0.0404	0.0350	0.0302	0.0259	0.0222	0.0189	0.0160	0.0135	0.0113	0.0095	0.0079	0.0066	0.0054	0.0044	0.0036	0.0030
+Ifit1	0.0063	0.0075	0.0089	0.0105	0.0124	0.0145	0.0169	0.0197	0.0228	0.0264	0.0303	0.0347	0.0397	0.0451	0.0511	0.0577	0.0649	0.0728	0.0812	0.0904	0.1002	0.1106	0.1217	0.1333	0.1456	0.1584	0.1717	0.1854	0.1995	0.2138	0.2284	0.2430	0.2576	0.2720	0.2862	0.3001	0.3134	0.3261	0.3381	0.3492	0.3593	0.3684	0.3763	0.3830	0.3883	0.3922	0.3948	0.3958	0.3954	0.3936	0.3902	0.3855	0.3795	0.3721	0.3635	0.3539	0.3432	0.3316	0.3192	0.3061	0.2925	0.2784	0.2641	0.2495	0.2349	0.2203	0.2059	0.1917	0.1778	0.1643	0.1513	0.1388	0.1268	0.1155	0.1047	0.0947	0.0852	0.0765	0.0683	0.0609	0.0540	0.0477	0.0420	0.0369	0.0322	0.0281	0.0244	0.0211	0.0181	0.0156	0.0133	0.0113	0.0096	0.0081	0.0068	0.0057	0.0048	0.0040	0.0033	0.0027	0.0023
+Oas1g	0.0009	0.0011	0.0014	0.0018	0.0022	0.0028	0.0034	0.0042	0.0052	0.0063	0.0076	0.0092	0.0111	0.0133	0.0158	0.0187	0.0221	0.0260	0.0304	0.0353	0.0409	0.0472	0.0542	0.0619	0.0704	0.0797	0.0899	0.1008	0.1125	0.1251	0.1383	0.1523	0.1670	0.1822	0.1978	0.2138	0.2300	0.2464	0.2626	0.2787	0.2943	0.3094	0.3238	0.3373	0.3497	0.3609	0.3707	0.3791	0.3858	0.3909	0.3942	0.3956	0.3953	0.3931	0.3891	0.3834	0.3761	0.3672	0.3568	0.3451	0.3323	0.3184	0.3038	0.2884	0.2726	0.2565	0.2401	0.2238	0.2077	0.1918	0.1763	0.1613	0.1469	0.1332	0.1202	0.1080	0.0965	0.0859	0.0761	0.0671	0.0589	0.0514	0.0447	0.0387	0.0334	0.0286	0.0244	0.0208	0.0176	0.0148	0.0124	0.0103	0.0086	0.0071	0.0058	0.0048	0.0039	0.0032	0.0025	0.0020	0.0016
+Ifih1	0.0023	0.0028	0.0034	0.0041	0.0050	0.0060	0.0071	0.0085	0.0101	0.0119	0.0140	0.0164	0.0192	0.0223	0.0259	0.0299	0.0343	0.0393	0.0449	0.0510	0.0578	0.0652	0.0733	0.0820	0.0914	0.1015	0.1124	0.1238	0.1359	0.1487	0.1620	0.1758	0.1900	0.2046	0.2195	0.2345	0.2496	0.2647	0.2795	0.2941	0.3082	0.3218	0.3347	0.3467	0.3578	0.3678	0.3766	0.3842	0.3903	0.3951	0.3984	0.4001	0.4003	0.3990	0.3961	0.3917	0.3859	0.3787	0.3702	0.3605	0.3497	0.3379	0.3252	0.3118	0.2978	0.2834	0.2685	0.2535	0.2384	0.2234	0.2084	0.1938	0.1794	0.1655	0.1521	0.1392	0.1269	0.1153	0.1043	0.0940	0.0844	0.0755	0.0672	0.0597	0.0527	0.0464	0.0407	0.0356	0.0310	0.0269	0.0232	0.0200	0.0171	0.0146	0.0124	0.0105	0.0089	0.0075	0.0063	0.0052	0.0043
+Parp9	0.0080	0.0094	0.0111	0.0130	0.0152	0.0177	0.0205	0.0237	0.0272	0.0312	0.0357	0.0406	0.0461	0.0521	0.0587	0.0659	0.0737	0.0821	0.0912	0.1009	0.1112	0.1222	0.1337	0.1458	0.1585	0.1716	0.1851	0.1990	0.2132	0.2276	0.2420	0.2565	0.2709	0.2850	0.2988	0.3121	0.3249	0.3369	0.3482	0.3586	0.3679	0.3761	0.3832	0.3889	0.3934	0.3964	0.3981	0.3983	0.3971	0.3945	0.3905	0.3851	0.3785	0.3706	0.3617	0.3516	0.3406	0.3288	0.3163	0.3031	0.2894	0.2754	0.2611	0.2467	0.2322	0.2178	0.2035	0.1895	0.1759	0.1626	0.1498	0.1375	0.1258	0.1146	0.1041	0.0942	0.0849	0.0763	0.0683	0.0609	0.0541	0.0480	0.0423	0.0372	0.0326	0.0285	0.0247	0.0214	0.0185	0.0159	0.0137	0.0117	0.0099	0.0084	0.0071	0.0060	0.0050	0.0042	0.0035	0.0029	0.0024
+Oas1a	0.0034	0.0042	0.0051	0.0061	0.0073	0.0087	0.0104	0.0124	0.0146	0.0172	0.0201	0.0235	0.0273	0.0316	0.0364	0.0417	0.0477	0.0543	0.0616	0.0695	0.0782	0.0876	0.0977	0.1085	0.1201	0.1323	0.1452	0.1586	0.1727	0.1871	0.2020	0.2172	0.2325	0.2479	0.2633	0.2785	0.2933	0.3077	0.3214	0.3344	0.3465	0.3576	0.3675	0.3761	0.3834	0.3892	0.3935	0.3963	0.3974	0.3969	0.3947	0.3910	0.3857	0.3790	0.3708	0.3613	0.3507	0.3389	0.3263	0.3128	0.2986	0.2839	0.2689	0.2536	0.2382	0.2228	0.2075	0.1925	0.1779	0.1637	0.1500	0.1369	0.1245	0.1127	0.1016	0.0912	0.0816	0.0726	0.0644	0.0569	0.0501	0.0439	0.0383	0.0332	0.0288	0.0248	0.0213	0.0182	0.0155	0.0131	0.0111	0.0093	0.0078	0.0065	0.0054	0.0045	0.0037	0.0030	0.0025	0.0020	0.0016
+Irf7	0.0002	0.0003	0.0004	0.0005	0.0006	0.0008	0.0010	0.0013	0.0016	0.0021	0.0026	0.0033	0.0040	0.0050	0.0061	0.0075	0.0091	0.0111	0.0133	0.0160	0.0191	0.0226	0.0267	0.0314	0.0367	0.0428	0.0495	0.0570	0.0654	0.0746	0.0846	0.0956	0.1074	0.1201	0.1336	0.1478	0.1628	0.1784	0.1946	0.2111	0.2279	0.2448	0.2617	0.2783	0.2946	0.3102	0.3250	0.3388	0.3514	0.3627	0.3725	0.3806	0.3870	0.3916	0.3942	0.3948	0.3935	0.3903	0.3851	0.3781	0.3694	0.3591	0.3473	0.3343	0.3201	0.3050	0.2892	0.2728	0.2561	0.2392	0.2223	0.2056	0.1891	0.1732	0.1577	0.1430	0.1290	0.1157	0.1033	0.0918	0.0812	0.0714	0.0625	0.0544	0.0472	0.0407	0.0349	0.0298	0.0253	0.0214	0.0180	0.0151	0.0125	0.0104	0.0086	0.0070	0.0057	0.0047	0.0038	0.0030	0.0024
+Mx1	0.0028	0.0035	0.0043	0.0053	0.0066	0.0081	0.0098	0.0119	0.0144	0.0173	0.0207	0.0246	0.0291	0.0342	0.0400	0.0465	0.0539	0.0621	0.0711	0.0811	0.0919	0.1037	0.1164	0.1300	0.1444	0.1595	0.1754	0.1918	0.2086	0.2258	0.2431	0.2604	0.2775	0.2941	0.3102	0.3254	0.3396	0.3526	0.3641	0.3742	0.3824	0.3889	0.3934	0.3959	0.3964	0.3948	0.3911	0.3855	0.3780	0.3688	0.3579	0.3455	0.3318	0.3170	0.3013	0.2849	0.2680	0.2508	0.2335	0.2162	0.1992	0.1826	0.1665	0.1510	0.1363	0.1223	0.1092	0.0970	0.0858	0.0754	0.0660	0.0574	0.0497	0.0428	0.0367	0.0312	0.0265	0.0223	0.0187	0.0156	0.0130	0.0107	0.0088	0.0072	0.0059	0.0047	0.0038	0.0031	0.0024	0.0019	0.0015	0.0012	0.0009	0.0007	0.0006	0.0004	0.0003	0.0002	0.0002	0.0001	0.0001
+Trim25	0.0009	0.0012	0.0014	0.0018	0.0022	0.0026	0.0032	0.0039	0.0047	0.0056	0.0068	0.0081	0.0096	0.0113	0.0133	0.0156	0.0183	0.0213	0.0247	0.0286	0.0329	0.0377	0.0431	0.0490	0.0556	0.0628	0.0706	0.0791	0.0883	0.0982	0.1087	0.1200	0.1319	0.1444	0.1575	0.1711	0.1851	0.1996	0.2144	0.2293	0.2444	0.2594	0.2743	0.2889	0.3031	0.3168	0.3299	0.3422	0.3535	0.3638	0.3730	0.3809	0.3875	0.3927	0.3964	0.3987	0.3993	0.3985	0.3961	0.3922	0.3868	0.3801	0.3720	0.3627	0.3522	0.3408	0.3284	0.3153	0.3015	0.2872	0.2725	0.2576	0.2426	0.2275	0.2126	0.1979	0.1835	0.1695	0.1559	0.1429	0.1304	0.1186	0.1075	0.0970	0.0872	0.0781	0.0696	0.0619	0.0548	0.0483	0.0424	0.0371	0.0323	0.0281	0.0243	0.0209	0.0180	0.0153	0.0131	0.0111	0.0094
+Oas3	0.0017	0.0021	0.0026	0.0032	0.0039	0.0048	0.0059	0.0072	0.0087	0.0104	0.0125	0.0149	0.0177	0.0209	0.0246	0.0289	0.0337	0.0391	0.0452	0.0520	0.0595	0.0679	0.0771	0.0871	0.0980	0.1098	0.1224	0.1358	0.1501	0.1651	0.1808	0.1971	0.2139	0.2311	0.2486	0.2662	0.2837	0.3011	0.3181	0.3345	0.3502	0.3650	0.3787	0.3911	0.4021	0.4116	0.4195	0.4255	0.4297	0.4320	0.4324	0.4308	0.4273	0.4220	0.4148	0.4059	0.3954	0.3835	0.3702	0.3558	0.3405	0.3243	0.3075	0.2903	0.2728	0.2552	0.2377	0.2204	0.2034	0.1869	0.1709	0.1557	0.1411	0.1273	0.1144	0.1023	0.0911	0.0807	0.0712	0.0626	0.0547	0.0476	0.0413	0.0356	0.0306	0.0262	0.0223	0.0189	0.0159	0.0134	0.0112	0.0093	0.0077	0.0064	0.0052	0.0043	0.0035	0.0028	0.0023	0.0018	0.0015
+Pglyrp3	0.0011	0.0014	0.0017	0.0021	0.0026	0.0032	0.0039	0.0047	0.0057	0.0069	0.0083	0.0100	0.0119	0.0141	0.0166	0.0196	0.0229	0.0267	0.0310	0.0359	0.0413	0.0474	0.0541	0.0614	0.0695	0.0783	0.0878	0.0981	0.1091	0.1208	0.1332	0.1462	0.1598	0.1739	0.1885	0.2034	0.2185	0.2337	0.2490	0.2640	0.2788	0.2931	0.3069	0.3199	0.3320	0.3431	0.3530	0.3617	0.3690	0.3748	0.3790	0.3817	0.3827	0.3821	0.3798	0.3759	0.3705	0.3635	0.3552	0.3455	0.3347	0.3228	0.3100	0.2964	0.2822	0.2675	0.2525	0.2373	0.2220	0.2069	0.1919	0.1773	0.1631	0.1493	0.1362	0.1236	0.1118	0.1006	0.0902	0.0804	0.0715	0.0632	0.0557	0.0489	0.0427	0.0371	0.0321	0.0277	0.0238	0.0203	0.0173	0.0147	0.0124	0.0104	0.0087	0.0072	0.0060	0.0050	0.0041	0.0033	0.0027
+Pml	0.0001	0.0001	0.0002	0.0002	0.0003	0.0004	0.0005	0.0006	0.0008	0.0010	0.0013	0.0016	0.0020	0.0026	0.0032	0.0040	0.0049	0.0060	0.0073	0.0089	0.0107	0.0129	0.0154	0.0184	0.0218	0.0257	0.0302	0.0353	0.0411	0.0476	0.0548	0.0628	0.0716	0.0813	0.0918	0.1032	0.1155	0.1285	0.1424	0.1570	0.1722	0.1880	0.2043	0.2209	0.2377	0.2546	0.2713	0.2877	0.3036	0.3188	0.3332	0.3466	0.3587	0.3695	0.3787	0.3863	0.3922	0.3962	0.3983	0.3985	0.3967	0.3930	0.3875	0.3802	0.3713	0.3608	0.3489	0.3357	0.3215	0.3064	0.2906	0.2743	0.2576	0.2408	0.2240	0.2073	0.1910	0.1751	0.1597	0.1450	0.1310	0.1178	0.1054	0.0938	0.0831	0.0733	0.0643	0.0562	0.0488	0.0422	0.0363	0.0311	0.0265	0.0225	0.0190	0.0159	0.0133	0.0111	0.0092	0.0076	0.0062
diff --git a/sourcecodes/data/example_chr2_spleen/cuLthr.txt b/sourcecodes/data/example_chr2_spleen/cuLthr.txt
new file mode 100644
index 00000000..b63ba696
--- /dev/null
+++ b/sourcecodes/data/example_chr2_spleen/cuLthr.txt
@@ -0,0 +1 @@
+0.9
diff --git a/sourcecodes/data/example_chr2_spleen/cuLtier.txt b/sourcecodes/data/example_chr2_spleen/cuLtier.txt
new file mode 100644
index 00000000..e71cfdda
--- /dev/null
+++ b/sourcecodes/data/example_chr2_spleen/cuLtier.txt
@@ -0,0 +1 @@
+3,Tier1,1,rs3664317,Tier2,1,Ifih1,Tier3,12,Oas1a,Parp9,Dhx58,Cd1d1,Irf7,Oas3,Pml,Mx1,Ifit1,Trim25,Oas1g,Pglyrp3,
\ No newline at end of file
diff --git a/sourcecodes/data/example_chr2_spleen/cuLtype.txt b/sourcecodes/data/example_chr2_spleen/cuLtype.txt
new file mode 100644
index 00000000..1b707710
--- /dev/null
+++ b/sourcecodes/data/example_chr2_spleen/cuLtype.txt
@@ -0,0 +1,2 @@
+rs3664317	Oas1a	Parp9	Dhx58	Cd1d1	Irf7	Oas3	Pml	Mx1	Ifit1	Trim25	Oas1g	Pglyrp3	Ifih1
+2	1	1	1	1	1	1	1	1	1	1	1	1	1	
diff --git a/sourcecodes/data/example_chr2_spleen/cuLwhite.txt b/sourcecodes/data/example_chr2_spleen/cuLwhite.txt
new file mode 100644
index 00000000..83e81b8b
--- /dev/null
+++ b/sourcecodes/data/example_chr2_spleen/cuLwhite.txt
@@ -0,0 +1 @@
+From	To
diff --git a/sourcecodes/data/example_sci/LluOyOgrviz_name_file.txt b/sourcecodes/data/example_sci/LluOyOgrviz_name_file.txt
new file mode 100644
index 00000000..b31e4c3c
--- /dev/null
+++ b/sourcecodes/data/example_sci/LluOyOgrviz_name_file.txt
@@ -0,0 +1,6 @@
+Genotype
+Gene3
+Gene2
+Phenotype
+Gene1
+
diff --git a/sourcecodes/data/example_sci/Lluban.txt b/sourcecodes/data/example_sci/Lluban.txt
new file mode 100644
index 00000000..38108f00
--- /dev/null
+++ b/sourcecodes/data/example_sci/Lluban.txt
@@ -0,0 +1,15 @@
+From	To
+Gene1	Genotype
+Gene2	Genotype
+Gene3	Genotype
+Phenotype	Genotype
+Gene1	Genotype
+Gene2	Genotype
+Gene3	Genotype
+Phenotype	Gene1
+Phenotype	Gene2
+Phenotype	Gene3
+Phenotype	Genotype
+Phenotype	Gene1
+Phenotype	Gene2
+Phenotype	Gene3
diff --git a/sourcecodes/data/example_sci/Llucontinuous_input.txt b/sourcecodes/data/example_sci/Llucontinuous_input.txt
new file mode 100644
index 00000000..79295d7e
--- /dev/null
+++ b/sourcecodes/data/example_sci/Llucontinuous_input.txt
@@ -0,0 +1,503 @@
+Genotype	Gene3	Gene2	Phenotype	Gene1
+2	1	1	1	1
+2	-1.0008	-0.44837	0.21808	-1.196
+1	-0.29368	-0.53043	-1.0893	-0.10136
+2	0.70835	0.72886	-0.18098	-0.42907
+1	0.63703	0.86428	1.7013	0.1425
+1	-1.2402	-0.69712	-1.7002	-0.71634
+1	-1.1952	0.27155	-0.79413	-1.0965
+2	0.62914	0.94265	1.8385	0.6135
+1	-1.91	-2.379	-3.1094	-1.0924
+2	-0.83436	-0.90968	-1.3598	1.335
+1	0.15685	0.4766	1.2891	-1.3309
+2	0.7047	1.0623	1.9811	1.2821
+1	0.59747	-0.023123	0.88555	-0.8844
+1	-1.0557	-1.5548	-1.3016	-0.77687
+2	1.5206	2.0289	0.90366	1.8089
+1	0.65525	-0.47226	-1.1824	0.41863
+2	-0.39262	0.382	-0.64829	0.40947
+2	0.14966	0.22972	0.33797	0.69647
+1	-1.8836	-0.68534	-0.99941	-0.78961
+1	0.48181	0.01241	1.2145	0.16835
+2	1.4673	2.0438	2.4674	2.5234
+1	-1.3242	-0.80218	-1.6446	-0.31044
+1	-1.2471	-2.0351	-1.0296	-1.937
+1	0.23695	-0.01724	-0.32851	-0.16484
+1	-0.13986	-0.6065	-0.8491	-0.95538
+2	0.90888	1.0365	2.7222	1.3507
+1	-0.30556	-1.1546	-0.86033	-2.2006
+2	0.5391	0.99532	0.96947	1.1575
+2	1.1235	0.37982	0.64439	0.94362
+2	1.7073	1.9303	2.8018	1.9158
+1	-0.20553	-0.074104	-0.50073	-1.0697
+1	-0.27415	0.23076	-0.27564	-0.11286
+1	-1.304	-1.1213	-0.71793	-1.3462
+2	0.54315	0.55846	0.87411	1.2432
+1	-1.0659	-0.38067	-1.4372	-2.0927
+1	0.21278	-1.0115	-1.0984	-0.72751
+1	-2.9061	-1.3118	-3.8372	-2.0448
+2	-0.69608	-0.61145	-1.0037	0.12181
+1	0.66835	0.018886	-1.0081	-1.4165
+1	0.32575	-0.51767	1.0187	-0.40914
+2	0.65837	1.2791	1.8388	2.2906
+2	0.37574	0.21618	-0.89435	1.2643
+1	0.13513	-0.31405	-0.16057	0.77712
+2	0.16054	0.40635	0.036165	1.6374
+1	1.9393	1.5717	2.6922	1.1933
+1	-0.59118	-0.47154	-0.20293	-1.5576
+1	-0.35938	-0.49565	-0.20837	0.61043
+2	-0.57133	0.15921	-0.44158	0.43312
+1	0.31835	0.49002	2.2029	0.17685
+1	-0.0093708	-0.85889	-1.0934	-1.6905
+1	-0.90501	-1.4637	-1.5526	-1.828
+2	0.11531	-0.022781	0.88843	0.8607
+1	0.34978	-0.34306	0.95301	-0.056177
+2	-0.22236	-0.13023	0.37608	0.18027
+1	-0.90103	-0.38393	-1.1513	-0.78153
+2	0.66848	0.81005	1.3945	3.3654
+2	0.10539	0.59781	0.77864	0.63865
+1	-1.15	-1.4531	-2.929	-1.6867
+1	0.20842	-0.0039076	-0.12879	-0.31459
+2	0.52155	1.248	1.0411	1.9656
+2	0.041926	0.86223	1.2222	1.0289
+1	-0.70875	-0.15791	-1.1581	-0.77456
+1	-1.1701	-0.57889	-0.8843	-0.11873
+2	0.98106	1.0805	0.95484	2.1834
+2	0.26676	0.7527	0.61491	1.9024
+1	-0.64765	0.19831	-1.4399	1.3127
+2	0.92209	2.2111	1.208	2.7402
+2	-0.93755	-0.26009	0.54448	0.20265
+2	1.2403	1.8468	1.6169	1.8359
+1	-0.1313	0.14288	-0.48278	-0.96105
+1	-0.7222	-0.25191	-1.2122	-0.59027
+2	-0.57013	-0.061267	-0.5438	0.18234
+1	-1.5355	-1.1998	-2.6613	-0.2634
+2	0.86507	0.60361	1.2411	-0.29711
+1	-0.60117	-0.7424	-0.79575	-0.5736
+1	-0.91776	-1.5669	-2.1735	-0.56602
+2	0.9917	2.3088	1.7993	2.645
+1	0.17017	0.53321	0.84278	-1.4458
+2	-0.22306	0.262	-0.86259	0.87407
+1	-0.42107	-0.69813	-0.48166	-1.009
+1	0.46913	-0.76457	0.11077	-0.21258
+1	0.066036	-0.48665	-0.74847	0.38785
+1	0.16465	-0.57268	0.19043	0.23
+1	-1.2044	-2.2027	-2.9688	-2.5546
+1	-0.3031	-2.0277	-1.3027	-2.6541
+2	-0.20063	0.3886	1.2227	0.84669
+2	-0.23897	0.0036995	-1.4547	0.37173
+1	2.197	0.41411	0.68339	-1.2721
+2	1.9922	2.748	3.0416	3.1268
+1	-1.7922	-1.2233	-3.1352	-0.98514
+2	0.66968	0.81377	1.9112	1.7507
+2	1.048	1.3718	1.5938	1.4847
+1	0.56532	-0.97153	-0.91123	-2.4761
+2	-0.53609	-0.30043	-0.65398	-0.38562
+2	1.0012	1.3344	2.0595	2.8441
+1	-3.4639	-2.4231	-3.9055	-2.3575
+1	0.79272	-0.78962	-0.40706	-1.1306
+1	0.78178	0.32152	0.79399	0.14086
+2	-0.28587	0.20138	0.78238	2.1602
+2	1.4137	1.6184	2.2458	2.1799
+2	1.409	1.6079	2.4053	2.0587
+2	-0.049571	1.1163	2.0792	0.99457
+1	-1.394	-0.67782	-2.2302	-0.33872
+2	0.5374	1.8476	2.205	2.0025
+1	-1.4988	-0.90782	-1.4206	-1.2048
+1	-2.2683	-1.7667	-3.7613	-2.0306
+1	0.5275	-0.34657	0.11355	-0.6761
+1	-1.89	-2.1862	-2.3535	-2.2032
+2	1.4183	2.5108	2.4607	1.7296
+1	-0.19829	0.031868	0.014954	-1.7813
+2	1.9842	2.0081	3.2753	3.6534
+1	0.60225	0.089417	0.37343	-1.396
+2	0.15127	0.55563	-0.099824	1.684
+1	-0.30521	-0.0050244	-0.68635	-0.42167
+2	0.65124	0.2796	-0.22261	1.4011
+1	-0.71925	-1.8908	-2.0898	-1.2222
+2	-0.56741	0.091717	-0.37763	0.40742
+1	-2.8956	-2.2286	-3.4496	-3.429
+2	-0.89598	1.0267	-0.4909	1.1085
+1	-0.94952	-0.7555	-1.795	-0.13335
+2	1.2407	2.0614	2.5452	1.9642
+1	-0.11717	-0.54282	-1.9921	-0.72275
+1	-0.45987	-0.58174	-1.1552	-0.76589
+2	1.4219	1.7052	1.3243	2.0381
+1	0.17284	-1.1866	0.12735	-0.89424
+1	-1.5493	-1.5627	-2.191	-1.4248
+2	-0.52149	0.50488	0.88087	1.9829
+2	-0.073205	0.87222	-0.68612	1.5622
+1	-0.20595	-0.60619	-1.2632	-0.31189
+1	-1.6215	-2.0613	-2.6335	-2.0367
+2	0.91305	1.4897	2.1731	2.2545
+1	1.142	1.8275	1.8053	1.0419
+1	-0.45335	-1.322	-1.3973	-0.48254
+2	0.74114	1.8757	1.4174	2.1017
+1	-0.38344	-0.17813	-0.23266	-0.41796
+2	0.92714	1.7223	2.7582	1.4736
+1	-0.96407	-1.004	-1.3232	-0.72647
+1	-0.17388	-0.55234	-0.16535	-1.1821
+1	-1.4482	-1.0906	-1.9966	-0.2562
+1	-1.5948	-1.656	-2.1184	-1.9089
+1	0.30118	-0.24953	0.3965	-1.2012
+1	0.040955	-1.5321	-0.0067596	-1.8302
+2	-0.47573	0.19062	-0.38082	1.4748
+1	-0.57924	-0.90781	-1.0718	-0.87675
+2	1.2355	1.6025	0.66291	1.3094
+1	-0.85148	-1.0376	-0.35579	-0.84493
+1	0.62128	-0.097245	1.1169	1.1175
+1	-1.0166	-0.95689	-0.54272	-1.0278
+2	2.2273	2.234	3.0504	2.9534
+2	0.39445	0.74964	0.49728	0.40693
+1	-1.0992	-1.0596	-0.34052	-1.6927
+2	-0.87373	-0.044581	-0.87888	-0.87457
+1	-0.17361	-1.0992	-0.61197	-0.52145
+2	-0.81143	-0.23214	0.019331	-0.021054
+2	0.4003	0.84559	1.3177	0.22445
+2	2.4797	2.3692	3.1041	1.2821
+2	-1.2217	0.28611	-0.91875	0.53117
+1	-0.37718	-1.1674	1.1769	-0.7679
+2	0.69641	1.3615	1.2907	1.7631
+1	0.058157	-1.4908	-1.6127	-2.051
+2	-0.10351	-0.26543	-1.1031	1.4271
+2	1.5874	1.159	2.1284	1.6052
+2	0.7304	1.8986	1.8219	2.6148
+2	1.2822	1.2151	1.6436	0.45098
+1	-0.67686	-0.50447	-0.81689	-0.47995
+2	0.099845	0.22575	-0.38467	1.3463
+1	-0.60473	-0.56624	-1.0822	-0.9277
+2	-0.09599	-0.052173	0.60328	0.36281
+1	1.3654	0.15181	1.0298	-1.196
+2	-1.4158	-1.1006	-1.9009	0.73982
+1	-0.035902	-0.11554	0.031789	0.15859
+2	-0.41972	-0.75665	-0.12297	-1.1222
+2	0.5198	1.1791	1.4405	0.74397
+2	0.48739	-0.18437	0.062889	1.33
+1	-0.40637	-0.97335	-1.7407	-1.7785
+2	1.2506	2.1236	2.544	2.21
+1	0.2246	0.14729	0.19402	-0.0184
+1	-2.9787	-2.8634	-3.6482	-3.2628
+2	-0.34778	-0.88344	-0.53681	-0.1392
+2	-1.8429	-1.7447	-1.2394	0.076896
+2	0.19618	1.4064	0.26418	1.4885
+1	1.1131	-0.28387	-0.062115	-0.38574
+2	0.49115	0.78076	1.4226	0.55504
+1	-1.8202	-1.2481	-2.3751	-1.7518
+2	1.2174	2.2183	1.4501	3.6806
+1	-1.9377	-1.6646	-3.3068	-2.1189
+2	0.54181	0.5947	0.58072	0.40033
+1	-0.66287	-0.68746	-0.096024	-1.7397
+1	0.40851	0.30851	-0.17237	-0.50364
+2	0.75742	0.4505	-0.78196	0.44425
+1	-1.4505	0.020384	-0.43303	-0.95328
+2	-0.028847	0.15037	0.5137	0.46568
+2	-0.63541	0.3954	-0.8684	1.5549
+1	0.33942	-0.38445	-0.041492	-1.4867
+2	0.47366	1.145	0.23226	1.7193
+1	0.023382	-0.041247	-0.82666	0.080651
+1	-1.1404	-1.0549	-2.3807	-2.1069
+2	0.33731	1.2985	0.71006	3.2157
+1	1.14	-0.87596	0.068296	-0.74487
+2	-0.049493	0.63	0.61696	0.5656
+1	-0.4566	0.65674	0.031943	0.92164
+2	0.017518	0.38805	0.53672	0.36798
+2	0.48676	0.83957	0.81814	1.0935
+2	2.7892	2.4059	4.9329	2.8726
+1	0.43253	0.11799	1.095	-0.30789
+1	-1.1828	-0.8044	-0.85393	-0.88528
+1	-1.5592	-2.1209	-2.309	-3.1197
+2	-1.2601	-1.2767	-1.6618	-0.50383
+2	2.1516	2.1742	2.8387	1.8793
+2	0.24623	0.69241	-0.010176	0.53935
+1	-0.22259	-0.40572	0.11176	-1.348
+1	-0.50134	-1.5699	0.070888	-1.576
+1	-0.59262	-0.25483	-0.97248	-0.80873
+2	0.59278	2.3224	1.2169	3.7789
+2	1.8088	2.2184	2.3414	2.2607
+1	-1.4547	-0.92385	-2.0514	-1.4636
+1	-1.0861	-0.97609	-1.4805	0.049658
+2	-1.3983	-1.4913	-1.5386	-0.37917
+1	0.39015	-0.60643	0.29969	-1.038
+2	-0.56574	0.93819	0.41397	3.0029
+1	0.33141	0.18418	-0.58313	-0.55312
+1	-1.0672	-1.2348	-1.7643	-1.8829
+1	-2.6167	-2.6369	-2.7652	-3.2899
+2	0.86111	1.9481	1.9289	2.6912
+2	-0.17146	0.59905	-0.32254	0.90592
+1	0.56296	0.22567	0.50046	-0.015986
+1	0.27356	0.014082	0.53515	-1.2915
+2	0.028483	0.74312	0.032785	0.86451
+2	0.45844	1.8271	1.9607	1.5293
+1	-1.0948	-0.81939	-1.3227	-1.7485
+2	-1.9435	-1.416	-2.3622	-0.083073
+2	1.9356	2.3905	3.3874	3.3754
+2	-0.51503	-0.61825	-1.0265	1.0355
+1	-0.069375	-0.38404	0.76998	-1.0565
+1	-0.99145	-1.4551	-0.3469	-1.1237
+2	0.22687	0.42981	-0.57465	1.7352
+1	-0.6192	-0.85621	-1.5754	-2.1116
+2	0.044283	0.22217	-0.46803	0.077448
+2	0.25206	0.75089	2.0777	1.6582
+1	-1.4421	0.36925	-1.3094	1.5023
+2	-0.37483	0.92607	0.66991	1.5735
+2	0.96079	1.4626	2.6634	1.8589
+1	-1.3318	-0.19963	-1.0137	-0.69936
+1	1.7601	1.2466	2.176	0.32938
+1	0.30315	-0.016251	0.51713	-0.89472
+2	-1.4913	-0.70336	-0.91095	0.12156
+2	-0.42001	-0.10023	-0.6748	0.60273
+2	1.3951	2.7444	2.8842	3.5656
+1	1.4232	0.6032	3.5048	1.7782
+1	0.73551	0.75694	1.037	-0.57807
+2	-0.39931	0.58809	-0.4973	0.21019
+2	1.3913	1.8648	1.7568	0.93599
+2	0.80965	0.4027	0.24317	1.9104
+1	-0.51752	1.1244	0.48382	0.33224
+1	0.1481	-0.5792	-0.3214	-0.26037
+1	-1.3533	-0.43213	-0.42417	-0.87353
+2	0.56938	0.99576	0.89716	1.7409
+1	-0.079763	-1.7127	-0.63871	-2.5791
+2	2.0641	2.5514	4.0436	2.7148
+1	-0.19435	-0.15077	0.60547	-1.4134
+2	0.081749	0.54813	0.96427	1.7548
+1	1.8213	0.88012	1.1502	0.10288
+2	-0.36776	1.0119	0.72045	1.4314
+2	-0.013532	0.88042	-0.065303	1.2714
+1	-0.46271	-1.5631	-1.3127	-1.5945
+2	0.32816	0.69476	1.2058	0.95562
+2	1.0995	1.9791	1.6754	2.7251
+2	1.2894	2.0428	2.7797	3.0741
+2	0.086177	0.13431	0.15097	1.1387
+2	1.4238	1.8326	1.452	2.2914
+2	-0.26067	0.085743	0.10703	1.6861
+1	0.8651	0.16132	1.2287	-0.49648
+2	1.6258	2.0722	1.5768	2.692
+2	-0.41045	-0.064344	-1.1639	0.35736
+1	0.87048	0.48066	1.3185	0.56768
+1	-0.059767	0.65175	0.20121	-1.4305
+1	-0.27649	-0.71256	-0.93355	0.12948
+2	0.40298	0.62103	0.38596	1.4175
+2	0.92929	1.4075	2.4664	1.9966
+1	-1.7047	-1.5666	-1.9704	-2.1459
+2	-0.31907	0.39015	-0.094609	0.63235
+2	1.43	2.3977	3.1491	2.2081
+1	-1.6535	-0.62255	-1.1695	-0.61433
+2	-0.22619	-0.15443	0.80091	-0.054849
+2	0.38626	1.6316	0.47058	1.4147
+1	0.14484	-0.64224	0.0082434	-0.86504
+2	1.8557	2.0853	3.4931	3.3653
+2	1.9842	3.3837	3.9431	2.2935
+1	-1.8676	-0.25935	-1.384	-0.46349
+2	1.1631	1.8748	2.8603	1.986
+2	0.28825	0.24785	1.285	0.97497
+1	0.014074	-0.43179	0.47159	-1.5869
+2	0.54993	1.3186	0.45672	1.4753
+1	0.36038	-0.17131	0.38497	0.032798
+2	-0.80787	0.028976	0.37316	-0.44677
+2	-0.28951	0.65841	-0.64075	1.0972
+2	0.55213	0.20033	-0.03155	-0.76611
+2	-0.39724	0.7762	0.84015	0.7553
+1	0.93813	0.87454	1.4003	-1.3907
+2	-0.32578	0.26563	-0.33416	1.6042
+2	0.33084	1.2848	1.0439	0.0011286
+2	-0.38575	0.17469	-0.30238	1.5178
+2	1.3498	1.2703	1.9845	1.5933
+2	0.58348	1.167	1.0504	1.1296
+1	1.082	0.6528	0.81685	-0.23314
+2	2.4742	2.4752	3.1153	2.9547
+2	0.12754	0.025728	-0.058504	0.58213
+2	1.817	2.0622	1.4037	1.1949
+2	0.8552	1.6038	1.0049	2.2411
+1	-1.0052	-1.0198	-0.48341	-2.5176
+1	-1.3895	-1.8934	-2.3298	-1.8805
+2	-1.0276	0.3109	-0.56926	0.026187
+1	-1.3081	-0.57127	-2.0782	-2.0429
+2	0.50882	-0.20697	0.013231	1.1618
+1	-0.9931	-1.3226	-0.98672	-0.47612
+1	0.41926	-0.14847	0.91577	-1.2763
+1	-0.93098	-1.0248	-2.0666	-0.55364
+1	-0.25192	-0.73885	0.073947	-0.4339
+1	-0.6545	-0.21517	-1.3672	-1.5453
+2	1.6327	2.0072	2.554	2.6639
+2	0.57601	-0.3015	0.74417	0.88943
+2	1.2264	1.7475	0.67207	1.0271
+1	0.42271	0.040673	0.80654	-0.83604
+1	-0.67361	-0.91976	-2.2619	-1.3054
+2	0.36815	0.93526	1.3126	1.077
+2	-0.1728	0.32075	0.54531	1.9659
+2	1.8385	2.4279	3.2285	3.4634
+1	-1.4314	-0.89679	-1.154	-1.4032
+2	0.38846	0.05761	1.0422	1.9036
+1	0.80821	-0.15658	-0.62623	-0.68719
+1	-1.302	-1.3887	-2.2708	-2.092
+1	-1.2392	-1.4976	-1.3607	-3.0231
+1	-0.3896	-0.42846	-0.75791	-1.7643
+2	1.5723	1.0907	2.0144	1.5574
+2	0.8587	1.1411	1.1627	1.9495
+2	-0.77478	-0.39283	-0.0099916	0.64003
+2	0.1672	0.63395	0.41181	1.3391
+2	-0.14637	0.26969	0.82956	0.41884
+2	0.14447	-0.10291	-0.287	0.80367
+1	0.18687	-0.27602	0.27575	-0.63094
+2	1.2428	1.5281	1.2243	3.0052
+1	-0.052875	-0.25162	-0.60352	-1.208
+2	0.6821	0.21045	1.2654	-0.013434
+1	0.26358	0.068284	0.22081	0.066436
+2	-0.62892	-0.053397	0.047075	0.74043
+2	-0.78913	-0.2106	-1.804	0.01624
+1	0.22995	-0.80286	1.3801	-0.92733
+1	-1.9684	-1.1444	-1.8	-2.7373
+2	-0.5569	-0.61626	-0.86638	0.4016
+2	0.1115	1.0784	-0.3657	1.3313
+1	-0.64278	-0.82557	-0.24553	-1.5426
+2	0.20989	0.049778	0.14976	-0.17113
+2	0.93007	1.927	1.9457	1.1498
+1	0.26164	0.15551	-0.033813	0.44309
+2	0.73092	1.0348	0.74128	2.4557
+2	-0.35204	0.606	-0.43078	1.2194
+1	-0.16719	0.40172	0.76466	0.31738
+2	0.97519	1.447	1.6576	0.8312
+1	-0.47105	-0.44196	-1.6032	0.68482
+2	-0.60894	-0.70426	-0.46443	0.86476
+2	-0.19328	0.33885	0.7601	0.61242
+2	0.12697	0.76843	0.73746	0.81747
+1	0.031673	-0.68398	-0.5238	-0.6702
+1	-0.93868	0.50393	0.10229	-0.63522
+1	-1.0264	-1.1855	-1.9957	-2.5259
+2	-0.5916	0.44419	0.014831	0.77302
+1	1.0176	0.82793	0.63908	-0.62945
+1	0.76611	0.14394	0.43542	-0.86403
+2	0.58551	0.21427	1.0034	0.50604
+2	-0.34577	-0.40185	-0.61186	-0.40606
+1	-0.77597	-1.1617	-1.8329	-3.1861
+2	0.068959	0.30321	0.76889	0.34588
+1	-1.2576	-1.5157	-1.1779	-0.94907
+1	-0.83648	0.090435	0.56704	-0.53314
+2	0.88421	1.707	2.6335	2.255
+2	0.55861	0.94463	0.9639	0.8637
+1	-0.18064	-1.0746	0.99446	-2.7845
+1	0.76049	0.26843	1.5167	-0.24873
+2	0.35634	-0.24447	-0.97159	0.11146
+2	1.7377	2.5182	2.4327	3.2303
+1	-1.624	-1.42	-3.435	-1.0498
+1	-1.2389	-1.8164	-1.726	-1.1608
+1	1.0074	-1.0969	-0.0682	-2.9043
+2	0.21432	0.54189	0.15421	1.1324
+2	1.5187	2.458	2.1317	3.8317
+2	1.5893	1.9248	3.0454	2.0655
+1	0.35221	1.6454	1.8029	-0.44455
+1	-0.54894	0.55414	0.35949	-1.3991
+2	-1.1614	-0.48362	-0.73735	-0.49564
+2	1.1159	1.0502	1.0648	0.3003
+2	0.96161	2.1506	1.531	2.1461
+1	-1.2411	-1.0381	-1.1269	-1.1484
+1	0.11049	-0.27275	-0.55964	-0.70906
+2	2.2862	2.1313	2.6027	2.2877
+1	-0.64184	-1.1552	-0.63442	-1.8594
+2	1.9075	1.8567	3.8481	1.9532
+1	-0.63126	-0.85427	-0.53335	0.37771
+2	0.59491	1.4425	1.9929	0.98581
+1	1.5669	0.7286	2.3314	-0.25628
+1	-2.1064	-1.9792	-3.209	-1.9161
+2	0.62872	0.51499	0.21648	1.4204
+1	-0.51532	-0.93122	-0.72578	-1.3459
+1	0.041397	-0.61347	-0.034157	-0.054858
+1	-0.72287	-1.1269	-1.7365	-1.4906
+1	-1.8362	-0.24614	-1.2446	-0.088146
+2	0.97014	1.3422	1.5292	0.77185
+1	-1.8502	-1.2924	-1.9175	-2.5133
+2	0.77748	0.89065	1.1444	0.26583
+1	-0.15405	0.089319	0.59477	0.16672
+2	1.3054	2.3544	3.2492	1.6727
+2	0.92409	1.3741	0.79866	2.0506
+2	-0.69943	-0.67926	-1.8186	0.67307
+1	-3.2806	-1.8577	-3.5456	-1.7004
+2	0.74119	1.0011	-0.11293	2.328
+2	0.73779	1.6924	1.7521	1.2604
+1	-1.3683	-1.7765	-1.5974	-2.2288
+2	0.46839	-0.27199	-0.1524	0.88269
+1	-0.73595	-1.4506	-1.408	-1.9886
+2	-0.2289	-0.5663	-2.0807	-1.4869
+2	-1.0052	0.16268	-0.48156	0.014777
+1	-0.10211	0.087625	-1.1098	-1.0203
+2	-0.090896	-0.057038	-0.69817	0.19942
+2	-0.42191	0.14803	-0.32168	0.049687
+2	0.84872	0.59768	1.9205	1.1233
+1	0.029696	-1.4186	-0.39548	-0.029631
+2	2.0013	1.9999	3.0139	1.6432
+2	1.1324	0.89689	-0.1229	0.15109
+2	0.93618	2.4521	1.7229	3.4367
+1	-1.0037	-1.435	-2.2126	-1.9473
+2	-2.2472	-1.296	-2.3762	-1.9611
+2	0.62477	1.5212	1.2814	1.4403
+2	0.17619	0.488	0.38575	0.19632
+1	0.79693	0.15328	-0.26972	-0.45147
+2	1.3618	1.6805	1.2152	2.1905
+2	-0.36075	1.0698	0.38569	2.5707
+1	-0.55325	-0.17572	-1.0232	-1.134
+2	0.9795	1.3777	0.26495	0.23258
+1	-0.92872	-1.2233	-2.1998	-1.9011
+1	0.47029	-0.06201	-0.34515	-0.57857
+1	-2.6597	-1.5144	-3.0038	-1.949
+2	-0.064474	-0.25394	-0.34794	0.76334
+2	0.52259	0.76325	0.93484	0.060827
+1	0.89037	0.68007	0.50459	-0.88464
+2	1.0031	1.3853	1.7313	0.75303
+2	0.6954	1.3692	0.19298	1.6174
+2	-0.14026	1.1774	0.39386	-0.25913
+2	-1.7796	-1.2709	-2.5775	-0.36996
+2	0.41557	1.9905	1.839	1.1327
+1	0.53878	-0.71974	-0.65395	-0.62597
+2	0.22326	1.3888	0.17221	1.2265
+1	-0.12667	-1.1336	-0.67	-3.6161
+2	1.0183	1.5883	2.2784	1.7509
+1	-2.0415	-2.2483	-2.8307	-3.1148
+2	-1.1513	-0.08575	-0.62876	2.164
+1	0.1961	0.075096	1.9551	0.039445
+2	-0.96925	0.12921	-1.2741	1.8371
+1	0.34137	0.086468	1.4716	0.55236
+1	-0.20756	-0.74846	0.65256	-0.7032
+2	1.1736	1.0214	1.258	1.0002
+2	0.48081	1.3275	0.54443	1.2194
+2	-0.45146	0.38298	0.64902	0.90395
+1	0.75519	-1.0627	-0.35778	-1.7689
+1	-1.4308	-1.0998	-1.0094	-0.66361
+1	-0.097019	0.18029	-9.0423e-07	0.59444
+2	1.3769	2.4872	3.2855	0.98727
+2	0.79201	0.76361	0.88459	3.119
+2	2.5125	2.4776	4.6119	3.966
+1	0.57129	-0.93689	-0.20516	-0.42323
+1	-0.91517	-0.25445	-1.3515	-0.99354
+1	0.17456	-0.98904	-0.49643	-0.8997
+1	-2.2724	-1.6869	-3.8034	-2.0882
+2	-1.8188	-0.57721	-2.4386	0.058963
+2	-0.19227	0.038901	-0.85065	0.6644
+1	-1.5517	-0.57182	-0.9874	-1.4081
+2	-0.47999	0.49667	0.27351	0.6261
+2	0.45041	0.48469	0.55808	2.0659
+1	-1.1302	-1.255	-2.7206	-1.2712
+1	-0.60672	-1.1008	-2.6889	-1.0078
+1	-1.0508	-0.99612	-1.555	-1.0463
+2	0.14434	0.97791	1.2498	1.7391
+2	0.21333	1.6686	1.219	1.8919
+2	-0.35461	-0.64694	-1.3312	-0.10481
+1	-2.0611	-2.1245	-3.6067	-1.6584
+2	-0.3534	0.45962	-0.39991	0.45667
+1	-0.37564	-0.63085	-1.2641	-1.3292
+1	0.30023	-0.20283	0.041852	-0.17139
+2	0.25089	1.0204	1.8084	1.0493
+1	-0.44041	-1.1143	-0.59224	-0.84288
+2	-0.11392	0.5681	-0.054604	0.88897
+1	0.41829	-1.042	-0.0042274	-1.9512
+2	1.4863	2.9227	3.0012	3.1253
+1	-0.60588	-1.1196	-1.4647	-0.92268
+1	-0.10497	-0.74629	-1.8353	-0.35425
+1	-1.2499	-0.83335	-2.4047	-1.4657
+1	-0.51414	-1.4602	-0.54649	-1.0475
+1	0.56956	0.79545	0.86494	-0.59471
+1	-0.64964	-0.78543	-1.9412	-2.2114
+2	1.0044	0.56431	1.2968	1.3807
+1	-1.1924	-0.69401	-0.72828	-1.7252
+2	0.15739	1.0449	0.3742	1.4303
+2	0.49582	1.4353	1.1652	1.5814
+
diff --git a/sourcecodes/data/example_sci/Llugraphviz.txt b/sourcecodes/data/example_sci/Llugraphviz.txt
new file mode 100644
index 00000000..88bbd3ba
--- /dev/null
+++ b/sourcecodes/data/example_sci/Llugraphviz.txt
@@ -0,0 +1,10 @@
+digraph G {
+size="10,10";  ratio = fill;
+node [shape=square,width=1.5];
+Genotype -> Gene3;
+Genotype -> Gene1;
+Gene3 -> Phenotype;
+Gene2 -> Gene3;
+Gene2 -> Phenotype;
+Gene1 -> Gene2;
+}
\ No newline at end of file
diff --git a/sourcecodes/data/example_sci/Lluk.txt b/sourcecodes/data/example_sci/Lluk.txt
new file mode 100644
index 00000000..83b33d23
--- /dev/null
+++ b/sourcecodes/data/example_sci/Lluk.txt
@@ -0,0 +1 @@
+1000
diff --git a/sourcecodes/data/example_sci/Llumap.txt b/sourcecodes/data/example_sci/Llumap.txt
new file mode 100644
index 00000000..958281d5
--- /dev/null
+++ b/sourcecodes/data/example_sci/Llumap.txt
@@ -0,0 +1,5 @@
+Genotype	2	0.500305	1.514000
+Gene3	1	1.027261	-0.015284
+Gene2	1	1.160583	0.138097
+Phenotype	1	1.554104	0.069005
+Gene1	1	1.515414	0.174451
diff --git a/sourcecodes/data/example_sci/Llumapdata.txt b/sourcecodes/data/example_sci/Llumapdata.txt
new file mode 100644
index 00000000..d684ea06
--- /dev/null
+++ b/sourcecodes/data/example_sci/Llumapdata.txt
@@ -0,0 +1 @@
+Genotype	Gene1	Gene2	Gene3	Phenotype
diff --git a/sourcecodes/data/example_sci/Lluname.txt b/sourcecodes/data/example_sci/Lluname.txt
new file mode 100644
index 00000000..f3a1f5bf
--- /dev/null
+++ b/sourcecodes/data/example_sci/Lluname.txt
@@ -0,0 +1 @@
+Genotype	Gene3	Gene2	Phenotype	Gene1
diff --git a/sourcecodes/data/example_sci/Llunet_figure.txt b/sourcecodes/data/example_sci/Llunet_figure.txt
new file mode 100644
index 00000000..bdc07cbd
--- /dev/null
+++ b/sourcecodes/data/example_sci/Llunet_figure.txt
@@ -0,0 +1,433 @@
+5
+1200	1200	
+Genotype	0	0
+Gene1	120	200
+Gene2	0	400
+Gene3	120	600
+Phenotype	0	800
+Genotype	2
+250	150
+0
+2	2	4
+1	0.4860
+2	0.5140
+Gene1	1
+250	150
+1	1
+1	3
+-3.5013	0.0009
+-3.4313	0.0012
+-3.3613	0.0015
+-3.2912	0.0019
+-3.2212	0.0024
+-3.1512	0.0030
+-3.0811	0.0037
+-3.0111	0.0046
+-2.9411	0.0056
+-2.8710	0.0069
+-2.8010	0.0083
+-2.7310	0.0101
+-2.6609	0.0121
+-2.5909	0.0145
+-2.5209	0.0174
+-2.4508	0.0206
+-2.3808	0.0243
+-2.3108	0.0286
+-2.2407	0.0335
+-2.1707	0.0389
+-2.1007	0.0451
+-2.0306	0.0520
+-1.9606	0.0597
+-1.8906	0.0682
+-1.8205	0.0775
+-1.7505	0.0876
+-1.6805	0.0986
+-1.6104	0.1105
+-1.5404	0.1231
+-1.4704	0.1366
+-1.4003	0.1508
+-1.3303	0.1657
+-1.2603	0.1811
+-1.1902	0.1971
+-1.1202	0.2134
+-1.0502	0.2300
+-0.9801	0.2467
+-0.9101	0.2633
+-0.8401	0.2797
+-0.7700	0.2956
+-0.7000	0.3110
+-0.6300	0.3256
+-0.5599	0.3392
+-0.4899	0.3517
+-0.4199	0.3629
+-0.3498	0.3726
+-0.2798	0.3808
+-0.2098	0.3873
+-0.1397	0.3920
+-0.0697	0.3948
+0.0003	0.3958
+0.0704	0.3948
+0.1404	0.3920
+0.2104	0.3872
+0.2805	0.3807
+0.3505	0.3726
+0.4205	0.3628
+0.4906	0.3516
+0.5606	0.3391
+0.6306	0.3254
+0.7007	0.3108
+0.7707	0.2955
+0.8407	0.2795
+0.9108	0.2631
+0.9808	0.2465
+1.0508	0.2299
+1.1209	0.2133
+1.1909	0.1969
+1.2609	0.1810
+1.3310	0.1655
+1.4010	0.1507
+1.4710	0.1365
+1.5411	0.1230
+1.6111	0.1103
+1.6811	0.0985
+1.7512	0.0875
+1.8212	0.0774
+1.8912	0.0681
+1.9613	0.0596
+2.0313	0.0520
+2.1013	0.0451
+2.1714	0.0389
+2.2414	0.0334
+2.3114	0.0286
+2.3815	0.0243
+2.4515	0.0206
+2.5215	0.0173
+2.5916	0.0145
+2.6616	0.0121
+2.7316	0.0101
+2.8017	0.0083
+2.8717	0.0068
+2.9417	0.0056
+3.0118	0.0046
+3.0818	0.0037
+3.1518	0.0030
+3.2219	0.0024
+3.2919	0.0019
+3.3619	0.0015
+3.4320	0.0012
+3.5020	0.0009
+Gene2	1
+250	150
+1	2
+2	4	5
+-3.5862	0.0008
+-3.5124	0.0010
+-3.4385	0.0013
+-3.3647	0.0016
+-3.2909	0.0020
+-3.2171	0.0026
+-3.1432	0.0032
+-3.0694	0.0041
+-2.9956	0.0050
+-2.9218	0.0062
+-2.8479	0.0077
+-2.7741	0.0094
+-2.7003	0.0114
+-2.6264	0.0138
+-2.5526	0.0166
+-2.4788	0.0199
+-2.4050	0.0237
+-2.3311	0.0281
+-2.2573	0.0331
+-2.1835	0.0388
+-2.1097	0.0453
+-2.0358	0.0526
+-1.9620	0.0607
+-1.8882	0.0696
+-1.8143	0.0795
+-1.7405	0.0903
+-1.6667	0.1021
+-1.5929	0.1147
+-1.5190	0.1282
+-1.4452	0.1426
+-1.3714	0.1578
+-1.2976	0.1736
+-1.2237	0.1900
+-1.1499	0.2069
+-1.0761	0.2241
+-1.0022	0.2414
+-0.9284	0.2587
+-0.8546	0.2758
+-0.7808	0.2924
+-0.7069	0.3084
+-0.6331	0.3236
+-0.5593	0.3377
+-0.4855	0.3506
+-0.4116	0.3621
+-0.3378	0.3719
+-0.2640	0.3800
+-0.1901	0.3863
+-0.1163	0.3905
+-0.0425	0.3927
+0.0313	0.3929
+0.1052	0.3910
+0.1790	0.3870
+0.2528	0.3811
+0.3266	0.3732
+0.4005	0.3636
+0.4743	0.3524
+0.5481	0.3397
+0.6220	0.3258
+0.6958	0.3108
+0.7696	0.2949
+0.8434	0.2783
+0.9173	0.2613
+0.9911	0.2440
+1.0649	0.2267
+1.1387	0.2095
+1.2126	0.1925
+1.2864	0.1760
+1.3602	0.1601
+1.4341	0.1449
+1.5079	0.1304
+1.5817	0.1167
+1.6555	0.1039
+1.7294	0.0920
+1.8032	0.0811
+1.8770	0.0711
+1.9508	0.0620
+2.0247	0.0537
+2.0985	0.0464
+2.1723	0.0398
+2.2462	0.0340
+2.3200	0.0288
+2.3938	0.0243
+2.4676	0.0205
+2.5415	0.0171
+2.6153	0.0142
+2.6891	0.0117
+2.7629	0.0097
+2.8368	0.0079
+2.9106	0.0064
+2.9844	0.0052
+3.0583	0.0042
+3.1321	0.0034
+3.2059	0.0027
+3.2797	0.0021
+3.3536	0.0017
+3.4274	0.0013
+3.5012	0.0010
+3.5750	0.0008
+3.6489	0.0006
+3.7227	0.0005
+3.7965	0.0004
+Gene3	1
+250	150
+2	1	3
+1	5
+-4.3571	0.0001
+-4.2762	0.0001
+-4.1954	0.0001
+-4.1145	0.0001
+-4.0336	0.0002
+-3.9527	0.0002
+-3.8719	0.0003
+-3.7910	0.0004
+-3.7101	0.0006
+-3.6293	0.0008
+-3.5484	0.0010
+-3.4675	0.0013
+-3.3866	0.0018
+-3.3058	0.0023
+-3.2249	0.0029
+-3.1440	0.0037
+-3.0632	0.0047
+-2.9823	0.0059
+-2.9014	0.0074
+-2.8205	0.0092
+-2.7397	0.0113
+-2.6588	0.0139
+-2.5779	0.0170
+-2.4971	0.0206
+-2.4162	0.0248
+-2.3353	0.0297
+-2.2544	0.0354
+-2.1736	0.0419
+-2.0927	0.0493
+-2.0118	0.0576
+-1.9310	0.0669
+-1.8501	0.0773
+-1.7692	0.0887
+-1.6883	0.1012
+-1.6075	0.1147
+-1.5266	0.1292
+-1.4457	0.1447
+-1.3648	0.1610
+-1.2840	0.1781
+-1.2031	0.1958
+-1.1222	0.2139
+-1.0414	0.2323
+-0.9605	0.2507
+-0.8796	0.2688
+-0.7987	0.2866
+-0.7179	0.3036
+-0.6370	0.3197
+-0.5561	0.3345
+-0.4753	0.3479
+-0.3944	0.3597
+-0.3135	0.3695
+-0.2326	0.3773
+-0.1518	0.3828
+-0.0709	0.3861
+0.0100	0.3870
+0.0908	0.3855
+0.1717	0.3817
+0.2526	0.3756
+0.3335	0.3673
+0.4143	0.3570
+0.4952	0.3449
+0.5761	0.3311
+0.6569	0.3160
+0.7378	0.2996
+0.8187	0.2824
+0.8996	0.2645
+0.9804	0.2463
+1.0613	0.2279
+1.1422	0.2095
+1.2230	0.1915
+1.3039	0.1740
+1.3848	0.1570
+1.4657	0.1409
+1.5465	0.1256
+1.6274	0.1114
+1.7083	0.0981
+1.7891	0.0859
+1.8700	0.0747
+1.9509	0.0646
+2.0318	0.0555
+2.1126	0.0474
+2.1935	0.0402
+2.2744	0.0340
+2.3552	0.0285
+2.4361	0.0237
+2.5170	0.0197
+2.5979	0.0162
+2.6787	0.0132
+2.7596	0.0108
+2.8405	0.0087
+2.9213	0.0070
+3.0022	0.0056
+3.0831	0.0044
+3.1640	0.0035
+3.2448	0.0027
+3.3257	0.0021
+3.4066	0.0016
+3.4874	0.0013
+3.5683	0.0010
+3.6492	0.0007
+3.7301	0.0006
+Phenotype	1
+250	150
+2	3	4
+0
+-3.5574	0.0010
+-3.4806	0.0013
+-3.4037	0.0016
+-3.3268	0.0021
+-3.2499	0.0026
+-3.1731	0.0033
+-3.0962	0.0042
+-3.0193	0.0052
+-2.9425	0.0065
+-2.8656	0.0080
+-2.7887	0.0098
+-2.7118	0.0120
+-2.6350	0.0146
+-2.5581	0.0176
+-2.4812	0.0212
+-2.4044	0.0253
+-2.3275	0.0300
+-2.2506	0.0354
+-2.1737	0.0416
+-2.0969	0.0486
+-2.0200	0.0564
+-1.9431	0.0651
+-1.8663	0.0748
+-1.7894	0.0854
+-1.7125	0.0970
+-1.6356	0.1096
+-1.5588	0.1230
+-1.4819	0.1374
+-1.4050	0.1526
+-1.3282	0.1685
+-1.2513	0.1850
+-1.1744	0.2021
+-1.0975	0.2195
+-1.0207	0.2370
+-0.9438	0.2545
+-0.8669	0.2718
+-0.7901	0.2887
+-0.7132	0.3049
+-0.6363	0.3202
+-0.5594	0.3344
+-0.4826	0.3473
+-0.4057	0.3587
+-0.3288	0.3684
+-0.2520	0.3763
+-0.1751	0.3822
+-0.0982	0.3860
+-0.0213	0.3877
+0.0555	0.3872
+0.1324	0.3846
+0.2093	0.3798
+0.2861	0.3731
+0.3630	0.3644
+0.4399	0.3539
+0.5168	0.3418
+0.5936	0.3283
+0.6705	0.3136
+0.7474	0.2979
+0.8242	0.2813
+0.9011	0.2643
+0.9780	0.2468
+1.0549	0.2293
+1.1317	0.2118
+1.2086	0.1945
+1.2855	0.1777
+1.3623	0.1614
+1.4392	0.1458
+1.5161	0.1310
+1.5930	0.1170
+1.6698	0.1039
+1.7467	0.0918
+1.8236	0.0806
+1.9004	0.0704
+1.9773	0.0612
+2.0542	0.0529
+2.1311	0.0454
+2.2079	0.0388
+2.2848	0.0329
+2.3617	0.0278
+2.4385	0.0234
+2.5154	0.0195
+2.5923	0.0162
+2.6692	0.0134
+2.7460	0.0110
+2.8229	0.0090
+2.8998	0.0073
+2.9766	0.0059
+3.0535	0.0047
+3.1304	0.0038
+3.2073	0.0030
+3.2841	0.0024
+3.3610	0.0019
+3.4379	0.0015
+3.5147	0.0011
+3.5916	0.0009
+3.6685	0.0007
+3.7454	0.0005
+3.8222	0.0004
+3.8991	0.0003
+3.9760	0.0002
+4.0528	0.0002
+4.1297	0.0001
diff --git a/sourcecodes/data/example_sci/Llunet_figure_new.txt b/sourcecodes/data/example_sci/Llunet_figure_new.txt
new file mode 100644
index 00000000..7e6f0d97
--- /dev/null
+++ b/sourcecodes/data/example_sci/Llunet_figure_new.txt
@@ -0,0 +1,433 @@
+1	
+5
+1200	1200	
+Genotype	0	0
+Gene1	120	200
+Gene2	0	400
+Gene3	120	600
+Phenotype	0	800
+Genotype	2
+250	150
+0
+2	2	4
+1.0000	1.0000
+Gene1	1
+250	150
+1	1
+1	3
+-3.5013	0.0000
+-3.4313	0.0000
+-3.3613	0.0000
+-3.2912	0.0000
+-3.2212	0.0000
+-3.1512	0.0000
+-3.0811	0.0000
+-3.0111	0.0000
+-2.9411	0.0000
+-2.8710	0.0000
+-2.8010	0.0000
+-2.7310	0.0000
+-2.6609	0.0000
+-2.5909	0.0000
+-2.5209	0.0001
+-2.4508	0.0002
+-2.3808	0.0004
+-2.3108	0.0007
+-2.2407	0.0014
+-2.1707	0.0026
+-2.1007	0.0046
+-2.0306	0.0079
+-1.9606	0.0133
+-1.8906	0.0217
+-1.8205	0.0344
+-1.7505	0.0529
+-1.6805	0.0791
+-1.6104	0.1147
+-1.5404	0.1615
+-1.4704	0.2207
+-1.4003	0.2928
+-1.3303	0.3771
+-1.2603	0.4715
+-1.1902	0.5723
+-1.1202	0.6743
+-1.0502	0.7713
+-0.9801	0.8564
+-0.9101	0.9232
+-0.8401	0.9660
+-0.7700	0.9813
+-0.7000	0.9676
+-0.6300	0.9263
+-0.5599	0.8608
+-0.4899	0.7765
+-0.4199	0.6800
+-0.3498	0.5781
+-0.2798	0.4771
+-0.2098	0.3822
+-0.1397	0.2973
+-0.0697	0.2244
+0.0003	0.1645
+0.0704	0.1170
+0.1404	0.0808
+0.2104	0.0542
+0.2805	0.0353
+0.3505	0.0223
+0.4205	0.0137
+0.4906	0.0081
+0.5606	0.0047
+0.6306	0.0026
+0.7007	0.0014
+0.7707	0.0008
+0.8407	0.0004
+0.9108	0.0002
+0.9808	0.0001
+1.0508	0.0000
+1.1209	0.0000
+1.1909	0.0000
+1.2609	0.0000
+1.3310	0.0000
+1.4010	0.0000
+1.4710	0.0000
+1.5411	0.0000
+1.6111	0.0000
+1.6811	0.0000
+1.7512	0.0000
+1.8212	0.0000
+1.8912	0.0000
+1.9613	0.0000
+2.0313	0.0000
+2.1013	0.0000
+2.1714	0.0000
+2.2414	0.0000
+2.3114	0.0000
+2.3815	0.0000
+2.4515	0.0000
+2.5215	0.0000
+2.5916	0.0000
+2.6616	0.0000
+2.7316	0.0000
+2.8017	0.0000
+2.8717	0.0000
+2.9417	0.0000
+3.0118	0.0000
+3.0818	0.0000
+3.1518	0.0000
+3.2219	0.0000
+3.2919	0.0000
+3.3619	0.0000
+3.4320	0.0000
+3.5020	0.0000
+Gene2	1
+250	150
+1	2
+2	4	5
+-3.5862	0.0000
+-3.5124	0.0000
+-3.4385	0.0000
+-3.3647	0.0000
+-3.2909	0.0000
+-3.2171	0.0001
+-3.1432	0.0001
+-3.0694	0.0002
+-2.9956	0.0003
+-2.9218	0.0005
+-2.8479	0.0008
+-2.7741	0.0012
+-2.7003	0.0018
+-2.6264	0.0028
+-2.5526	0.0041
+-2.4788	0.0060
+-2.4050	0.0087
+-2.3311	0.0124
+-2.2573	0.0175
+-2.1835	0.0242
+-2.1097	0.0329
+-2.0358	0.0441
+-1.9620	0.0583
+-1.8882	0.0759
+-1.8143	0.0974
+-1.7405	0.1230
+-1.6667	0.1530
+-1.5929	0.1874
+-1.5190	0.2262
+-1.4452	0.2689
+-1.3714	0.3148
+-1.2976	0.3631
+-1.2237	0.4126
+-1.1499	0.4617
+-1.0761	0.5089
+-1.0022	0.5525
+-0.9284	0.5908
+-0.8546	0.6224
+-0.7808	0.6458
+-0.7069	0.6600
+-0.6331	0.6644
+-0.5593	0.6588
+-0.4855	0.6434
+-0.4116	0.6190
+-0.3378	0.5866
+-0.2640	0.5475
+-0.1901	0.5034
+-0.1163	0.4558
+-0.0425	0.4066
+0.0313	0.3573
+0.1052	0.3092
+0.1790	0.2636
+0.2528	0.2213
+0.3266	0.1830
+0.4005	0.1491
+0.4743	0.1197
+0.5481	0.0946
+0.6220	0.0736
+0.6958	0.0565
+0.7696	0.0426
+0.8434	0.0317
+0.9173	0.0233
+0.9911	0.0168
+1.0649	0.0119
+1.1387	0.0084
+1.2126	0.0058
+1.2864	0.0039
+1.3602	0.0026
+1.4341	0.0017
+1.5079	0.0011
+1.5817	0.0007
+1.6555	0.0005
+1.7294	0.0003
+1.8032	0.0002
+1.8770	0.0001
+1.9508	0.0001
+2.0247	0.0000
+2.0985	0.0000
+2.1723	0.0000
+2.2462	0.0000
+2.3200	0.0000
+2.3938	0.0000
+2.4676	0.0000
+2.5415	0.0000
+2.6153	0.0000
+2.6891	0.0000
+2.7629	0.0000
+2.8368	0.0000
+2.9106	0.0000
+2.9844	0.0000
+3.0583	0.0000
+3.1321	0.0000
+3.2059	0.0000
+3.2797	0.0000
+3.3536	0.0000
+3.4274	0.0000
+3.5012	0.0000
+3.5750	0.0000
+3.6489	0.0000
+3.7227	0.0000
+3.7965	0.0000
+Gene3	1
+250	150
+2	1	3
+1	5
+-4.3571	0.0002
+-4.2762	0.0002
+-4.1954	0.0003
+-4.1145	0.0004
+-4.0336	0.0005
+-3.9527	0.0007
+-3.8719	0.0010
+-3.7910	0.0013
+-3.7101	0.0017
+-3.6293	0.0022
+-3.5484	0.0028
+-3.4675	0.0036
+-3.3866	0.0046
+-3.3058	0.0059
+-3.2249	0.0074
+-3.1440	0.0093
+-3.0632	0.0115
+-2.9823	0.0143
+-2.9014	0.0175
+-2.8205	0.0214
+-2.7397	0.0260
+-2.6588	0.0313
+-2.5779	0.0374
+-2.4971	0.0445
+-2.4162	0.0526
+-2.3353	0.0617
+-2.2544	0.0719
+-2.1736	0.0833
+-2.0927	0.0958
+-2.0118	0.1095
+-1.9310	0.1243
+-1.8501	0.1403
+-1.7692	0.1572
+-1.6883	0.1750
+-1.6075	0.1936
+-1.5266	0.2127
+-1.4457	0.2322
+-1.3648	0.2518
+-1.2840	0.2713
+-1.2031	0.2904
+-1.1222	0.3088
+-1.0414	0.3263
+-0.9605	0.3424
+-0.8796	0.3570
+-0.7987	0.3698
+-0.7179	0.3806
+-0.6370	0.3890
+-0.5561	0.3951
+-0.4753	0.3987
+-0.3944	0.3996
+-0.3135	0.3980
+-0.2326	0.3937
+-0.1518	0.3869
+-0.0709	0.3778
+0.0100	0.3665
+0.0908	0.3532
+0.1717	0.3381
+0.2526	0.3216
+0.3335	0.3039
+0.4143	0.2852
+0.4952	0.2660
+0.5761	0.2464
+0.6569	0.2268
+0.7378	0.2074
+0.8187	0.1884
+0.8996	0.1700
+0.9804	0.1524
+1.0613	0.1358
+1.1422	0.1201
+1.2230	0.1056
+1.3039	0.0922
+1.3848	0.0800
+1.4657	0.0690
+1.5465	0.0591
+1.6274	0.0502
+1.7083	0.0425
+1.7891	0.0357
+1.8700	0.0297
+1.9509	0.0246
+2.0318	0.0203
+2.1126	0.0166
+2.1935	0.0135
+2.2744	0.0109
+2.3552	0.0087
+2.4361	0.0070
+2.5170	0.0055
+2.5979	0.0043
+2.6787	0.0034
+2.7596	0.0026
+2.8405	0.0020
+2.9213	0.0015
+3.0022	0.0012
+3.0831	0.0009
+3.1640	0.0007
+3.2448	0.0005
+3.3257	0.0004
+3.4066	0.0003
+3.4874	0.0002
+3.5683	0.0001
+3.6492	0.0001
+3.7301	0.0001
+Phenotype	1
+250	150
+2	3	4
+0
+-3.5574	0.0004
+-3.4806	0.0006
+-3.4037	0.0008
+-3.3268	0.0012
+-3.2499	0.0016
+-3.1731	0.0022
+-3.0962	0.0030
+-3.0193	0.0040
+-2.9425	0.0054
+-2.8656	0.0071
+-2.7887	0.0093
+-2.7118	0.0121
+-2.6350	0.0155
+-2.5581	0.0198
+-2.4812	0.0250
+-2.4044	0.0313
+-2.3275	0.0389
+-2.2506	0.0479
+-2.1737	0.0584
+-2.0969	0.0706
+-2.0200	0.0846
+-1.9431	0.1005
+-1.8663	0.1184
+-1.7894	0.1381
+-1.7125	0.1597
+-1.6356	0.1831
+-1.5588	0.2081
+-1.4819	0.2343
+-1.4050	0.2615
+-1.3282	0.2893
+-1.2513	0.3173
+-1.1744	0.3448
+-1.0975	0.3714
+-1.0207	0.3966
+-0.9438	0.4197
+-0.8669	0.4402
+-0.7901	0.4576
+-0.7132	0.4716
+-0.6363	0.4816
+-0.5594	0.4875
+-0.4826	0.4891
+-0.4057	0.4864
+-0.3288	0.4794
+-0.2520	0.4684
+-0.1751	0.4535
+-0.0982	0.4353
+-0.0213	0.4140
+0.0555	0.3904
+0.1324	0.3648
+0.2093	0.3379
+0.2861	0.3102
+0.3630	0.2822
+0.4399	0.2545
+0.5168	0.2275
+0.5936	0.2016
+0.6705	0.1770
+0.7474	0.1541
+0.8242	0.1329
+0.9011	0.1136
+0.9780	0.0963
+1.0549	0.0809
+1.1317	0.0673
+1.2086	0.0556
+1.2855	0.0455
+1.3623	0.0368
+1.4392	0.0296
+1.5161	0.0236
+1.5930	0.0186
+1.6698	0.0146
+1.7467	0.0113
+1.8236	0.0087
+1.9004	0.0066
+1.9773	0.0050
+2.0542	0.0037
+2.1311	0.0028
+2.2079	0.0020
+2.2848	0.0015
+2.3617	0.0011
+2.4385	0.0008
+2.5154	0.0005
+2.5923	0.0004
+2.6692	0.0003
+2.7460	0.0002
+2.8229	0.0001
+2.8998	0.0001
+2.9766	0.0001
+3.0535	0.0000
+3.1304	0.0000
+3.2073	0.0000
+3.2841	0.0000
+3.3610	0.0000
+3.4379	0.0000
+3.5147	0.0000
+3.5916	0.0000
+3.6685	0.0000
+3.7454	0.0000
+3.8222	0.0000
+3.8991	0.0000
+3.9760	0.0000
+4.0528	0.0000
+4.1297	0.0000
diff --git a/sourcecodes/data/example_sci/Llunlevels.txt b/sourcecodes/data/example_sci/Llunlevels.txt
new file mode 100644
index 00000000..714e56bd
--- /dev/null
+++ b/sourcecodes/data/example_sci/Llunlevels.txt
@@ -0,0 +1,2 @@
+Genotype	1	2
+
diff --git a/sourcecodes/data/example_sci/Llunnode.txt b/sourcecodes/data/example_sci/Llunnode.txt
new file mode 100644
index 00000000..7ed6ff82
--- /dev/null
+++ b/sourcecodes/data/example_sci/Llunnode.txt
@@ -0,0 +1 @@
+5
diff --git a/sourcecodes/data/example_sci/Llunrows.txt b/sourcecodes/data/example_sci/Llunrows.txt
new file mode 100644
index 00000000..c15fb720
--- /dev/null
+++ b/sourcecodes/data/example_sci/Llunrows.txt
@@ -0,0 +1 @@
+501
diff --git a/sourcecodes/data/example_sci/Lluparent.txt b/sourcecodes/data/example_sci/Lluparent.txt
new file mode 100644
index 00000000..b8626c4c
--- /dev/null
+++ b/sourcecodes/data/example_sci/Lluparent.txt
@@ -0,0 +1 @@
+4
diff --git a/sourcecodes/data/example_sci/Llurun_evidencemodified.sh b/sourcecodes/data/example_sci/Llurun_evidencemodified.sh
new file mode 100644
index 00000000..ee0dde13
--- /dev/null
+++ b/sourcecodes/data/example_sci/Llurun_evidencemodified.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+# script for execution of deployed applications
+#
+# Sets up the MCR environment for the current $ARCH and executes 
+# the specified command.
+#
+exe_name=$0
+exe_dir=`dirname "$0"`
+echo "------------------------------------------"
+if [ "x$1" = "x" ]; then
+  echo Usage:
+  echo    $0 \<deployedMCRroot\> args
+else
+  echo Setting up environment variables
+  MCRROOT="$1"
+  echo ---
+  LD_LIBRARY_PATH=.:${MCRROOT}/runtime/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/bin/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/sys/os/glnxa64;
+	MCRJRE=${MCRROOT}/sys/java/jre/glnxa64/jre/lib/amd64 ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/native_threads ; 
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/server ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/client ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE} ;  
+  XAPPLRESDIR=${MCRROOT}/X11/app-defaults ;
+  export LD_LIBRARY_PATH;
+  export XAPPLRESDIR;
+  echo LD_LIBRARY_PATH is ${LD_LIBRARY_PATH};
+  shift 1
+  args=
+  while [ $# -gt 0 ]; do
+      token=`echo "$1" | sed 's/ /\\\\ /g'`   # Add blackslash before each blank
+      args="${args} ${token}" 
+      shift
+  done
+  "${exe_dir}"/evidencemodified Llu
+fi
+exit
diff --git a/sourcecodes/data/example_sci/Llurun_initialstructure.sh b/sourcecodes/data/example_sci/Llurun_initialstructure.sh
new file mode 100644
index 00000000..adde14dd
--- /dev/null
+++ b/sourcecodes/data/example_sci/Llurun_initialstructure.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+# script for execution of deployed applications
+#
+# Sets up the MCR environment for the current $ARCH and executes 
+# the specified command.
+#
+exe_name=$0
+exe_dir=`dirname "$0"`
+echo "------------------------------------------"
+if [ "x$1" = "x" ]; then
+  echo Usage:
+  echo    $0 \<deployedMCRroot\> args
+else
+  echo Setting up environment variables
+  MCRROOT="$1"
+  echo ---
+  LD_LIBRARY_PATH=.:${MCRROOT}/runtime/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/bin/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/sys/os/glnxa64;
+	MCRJRE=${MCRROOT}/sys/java/jre/glnxa64/jre/lib/amd64 ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/native_threads ; 
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/server ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/client ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE} ;  
+  XAPPLRESDIR=${MCRROOT}/X11/app-defaults ;
+  export LD_LIBRARY_PATH;
+  export XAPPLRESDIR;
+  echo LD_LIBRARY_PATH is ${LD_LIBRARY_PATH};
+  shift 1
+  args=
+  while [ $# -gt 0 ]; do
+      token=`echo "$1" | sed 's/ /\\\\ /g'`   # Add blackslash before each blank
+      args="${args} ${token}" 
+      shift
+  done
+  "${exe_dir}"/initialstructure Llu
+fi
+exit
diff --git a/sourcecodes/data/example_sci/Llustructure_input.txt b/sourcecodes/data/example_sci/Llustructure_input.txt
new file mode 100644
index 00000000..bcf72d97
--- /dev/null
+++ b/sourcecodes/data/example_sci/Llustructure_input.txt
@@ -0,0 +1,6 @@
+Genotype	Gene3	Gene2	Phenotype	Gene1	
+0	1	0	0	1	
+0	0	0	1	0	
+0	1	0	1	0	
+0	0	0	0	0	
+0	0	1	0	0	
diff --git a/sourcecodes/data/example_sci/Llustructure_input_temp.txt b/sourcecodes/data/example_sci/Llustructure_input_temp.txt
new file mode 100644
index 00000000..95aa7a5d
--- /dev/null
+++ b/sourcecodes/data/example_sci/Llustructure_input_temp.txt
@@ -0,0 +1,6 @@
+Genotype	Gene3	Gene2	Phenotype	Gene1	
+0.000000	0.999929	0.183248	0.000431	1.000000	
+0.000000	0.000000	0.000000	1.000000	0.000000	
+0.000000	0.935752	0.000000	1.000000	0.000000	
+0.000000	0.000000	0.000000	0.000000	0.000000	
+0.000000	0.053385	0.881001	0.156255	0.000000	
diff --git a/sourcecodes/data/example_sci/Llustructure_old.txt b/sourcecodes/data/example_sci/Llustructure_old.txt
new file mode 100644
index 00000000..5b464577
--- /dev/null
+++ b/sourcecodes/data/example_sci/Llustructure_old.txt
@@ -0,0 +1,5 @@
+Genotype	0.4860	0.5140
+Gene3	0.0001	0.0001	0.0001	0.0001	0.0002	0.0002	0.0003	0.0004	0.0006	0.0008	0.0010	0.0013	0.0018	0.0023	0.0029	0.0037	0.0047	0.0059	0.0074	0.0092	0.0113	0.0139	0.0170	0.0206	0.0248	0.0297	0.0354	0.0419	0.0493	0.0576	0.0669	0.0773	0.0887	0.1012	0.1147	0.1292	0.1447	0.1610	0.1781	0.1958	0.2139	0.2323	0.2507	0.2688	0.2866	0.3036	0.3197	0.3345	0.3479	0.3597	0.3695	0.3773	0.3828	0.3861	0.3870	0.3855	0.3817	0.3756	0.3673	0.3570	0.3449	0.3311	0.3160	0.2996	0.2824	0.2645	0.2463	0.2279	0.2095	0.1915	0.1740	0.1570	0.1409	0.1256	0.1114	0.0981	0.0859	0.0747	0.0646	0.0555	0.0474	0.0402	0.0340	0.0285	0.0237	0.0197	0.0162	0.0132	0.0108	0.0087	0.0070	0.0056	0.0044	0.0035	0.0027	0.0021	0.0016	0.0013	0.0010	0.0007	0.0006
+Gene1	0.0009	0.0012	0.0015	0.0019	0.0024	0.0030	0.0037	0.0046	0.0056	0.0069	0.0083	0.0101	0.0121	0.0145	0.0174	0.0206	0.0243	0.0286	0.0335	0.0389	0.0451	0.0520	0.0597	0.0682	0.0775	0.0876	0.0986	0.1105	0.1231	0.1366	0.1508	0.1657	0.1811	0.1971	0.2134	0.2300	0.2467	0.2633	0.2797	0.2956	0.3110	0.3256	0.3392	0.3517	0.3629	0.3726	0.3808	0.3873	0.3920	0.3948	0.3958	0.3948	0.3920	0.3872	0.3807	0.3726	0.3628	0.3516	0.3391	0.3254	0.3108	0.2955	0.2795	0.2631	0.2465	0.2299	0.2133	0.1969	0.1810	0.1655	0.1507	0.1365	0.1230	0.1103	0.0985	0.0875	0.0774	0.0681	0.0596	0.0520	0.0451	0.0389	0.0334	0.0286	0.0243	0.0206	0.0173	0.0145	0.0121	0.0101	0.0083	0.0068	0.0056	0.0046	0.0037	0.0030	0.0024	0.0019	0.0015	0.0012	0.0009
+Phenotype	0.0010	0.0013	0.0016	0.0021	0.0026	0.0033	0.0042	0.0052	0.0065	0.0080	0.0098	0.0120	0.0146	0.0176	0.0212	0.0253	0.0300	0.0354	0.0416	0.0486	0.0564	0.0651	0.0748	0.0854	0.0970	0.1096	0.1230	0.1374	0.1526	0.1685	0.1850	0.2021	0.2195	0.2370	0.2545	0.2718	0.2887	0.3049	0.3202	0.3344	0.3473	0.3587	0.3684	0.3763	0.3822	0.3860	0.3877	0.3872	0.3846	0.3798	0.3731	0.3644	0.3539	0.3418	0.3283	0.3136	0.2979	0.2813	0.2643	0.2468	0.2293	0.2118	0.1945	0.1777	0.1614	0.1458	0.1310	0.1170	0.1039	0.0918	0.0806	0.0704	0.0612	0.0529	0.0454	0.0388	0.0329	0.0278	0.0234	0.0195	0.0162	0.0134	0.0110	0.0090	0.0073	0.0059	0.0047	0.0038	0.0030	0.0024	0.0019	0.0015	0.0011	0.0009	0.0007	0.0005	0.0004	0.0003	0.0002	0.0002	0.0001
+Gene2	0.0008	0.0010	0.0013	0.0016	0.0020	0.0026	0.0032	0.0041	0.0050	0.0062	0.0077	0.0094	0.0114	0.0138	0.0166	0.0199	0.0237	0.0281	0.0331	0.0388	0.0453	0.0526	0.0607	0.0696	0.0795	0.0903	0.1021	0.1147	0.1282	0.1426	0.1578	0.1736	0.1900	0.2069	0.2241	0.2414	0.2587	0.2758	0.2924	0.3084	0.3236	0.3377	0.3506	0.3621	0.3719	0.3800	0.3863	0.3905	0.3927	0.3929	0.3910	0.3870	0.3811	0.3732	0.3636	0.3524	0.3397	0.3258	0.3108	0.2949	0.2783	0.2613	0.2440	0.2267	0.2095	0.1925	0.1760	0.1601	0.1449	0.1304	0.1167	0.1039	0.0920	0.0811	0.0711	0.0620	0.0537	0.0464	0.0398	0.0340	0.0288	0.0243	0.0205	0.0171	0.0142	0.0117	0.0097	0.0079	0.0064	0.0052	0.0042	0.0034	0.0027	0.0021	0.0017	0.0013	0.0010	0.0008	0.0006	0.0005	0.0004
diff --git a/sourcecodes/data/example_sci/Lluthr.txt b/sourcecodes/data/example_sci/Lluthr.txt
new file mode 100644
index 00000000..2eb3c4fe
--- /dev/null
+++ b/sourcecodes/data/example_sci/Lluthr.txt
@@ -0,0 +1 @@
+0.5
diff --git a/sourcecodes/data/example_sci/Llutier.txt b/sourcecodes/data/example_sci/Llutier.txt
new file mode 100644
index 00000000..da7084fb
--- /dev/null
+++ b/sourcecodes/data/example_sci/Llutier.txt
@@ -0,0 +1 @@
+3,Tier1,1,Genotype,Tier2,3,Gene1,Gene2,Gene3,Tier3,1,Phenotype,
\ No newline at end of file
diff --git a/sourcecodes/data/example_sci/Llutype.txt b/sourcecodes/data/example_sci/Llutype.txt
new file mode 100644
index 00000000..9ea66ce4
--- /dev/null
+++ b/sourcecodes/data/example_sci/Llutype.txt
@@ -0,0 +1,2 @@
+Genotype	Gene3	Gene2	Phenotype	Gene1
+2	1	1	1	1	
diff --git a/sourcecodes/data/example_sci/Lluvar.txt b/sourcecodes/data/example_sci/Lluvar.txt
new file mode 100644
index 00000000..56a6051c
--- /dev/null
+++ b/sourcecodes/data/example_sci/Lluvar.txt
@@ -0,0 +1 @@
+1
\ No newline at end of file
diff --git a/sourcecodes/data/example_sci/Lluvardata.txt b/sourcecodes/data/example_sci/Lluvardata.txt
new file mode 100644
index 00000000..56a6051c
--- /dev/null
+++ b/sourcecodes/data/example_sci/Lluvardata.txt
@@ -0,0 +1 @@
+1
\ No newline at end of file
diff --git a/sourcecodes/data/example_sci/Lluvarname.txt b/sourcecodes/data/example_sci/Lluvarname.txt
new file mode 100644
index 00000000..3fe283bd
--- /dev/null
+++ b/sourcecodes/data/example_sci/Lluvarname.txt
@@ -0,0 +1 @@
+Genotype
\ No newline at end of file
diff --git a/sourcecodes/data/example_sci/Lluwhite.txt b/sourcecodes/data/example_sci/Lluwhite.txt
new file mode 100644
index 00000000..83e81b8b
--- /dev/null
+++ b/sourcecodes/data/example_sci/Lluwhite.txt
@@ -0,0 +1 @@
+From	To
diff --git a/sourcecodes/data/example_sci_bk/Lluban.txt b/sourcecodes/data/example_sci_bk/Lluban.txt
new file mode 100644
index 00000000..38108f00
--- /dev/null
+++ b/sourcecodes/data/example_sci_bk/Lluban.txt
@@ -0,0 +1,15 @@
+From	To
+Gene1	Genotype
+Gene2	Genotype
+Gene3	Genotype
+Phenotype	Genotype
+Gene1	Genotype
+Gene2	Genotype
+Gene3	Genotype
+Phenotype	Gene1
+Phenotype	Gene2
+Phenotype	Gene3
+Phenotype	Genotype
+Phenotype	Gene1
+Phenotype	Gene2
+Phenotype	Gene3
diff --git a/sourcecodes/data/example_sci_bk/Llucontinuous_input.txt b/sourcecodes/data/example_sci_bk/Llucontinuous_input.txt
new file mode 100644
index 00000000..79295d7e
--- /dev/null
+++ b/sourcecodes/data/example_sci_bk/Llucontinuous_input.txt
@@ -0,0 +1,503 @@
+Genotype	Gene3	Gene2	Phenotype	Gene1
+2	1	1	1	1
+2	-1.0008	-0.44837	0.21808	-1.196
+1	-0.29368	-0.53043	-1.0893	-0.10136
+2	0.70835	0.72886	-0.18098	-0.42907
+1	0.63703	0.86428	1.7013	0.1425
+1	-1.2402	-0.69712	-1.7002	-0.71634
+1	-1.1952	0.27155	-0.79413	-1.0965
+2	0.62914	0.94265	1.8385	0.6135
+1	-1.91	-2.379	-3.1094	-1.0924
+2	-0.83436	-0.90968	-1.3598	1.335
+1	0.15685	0.4766	1.2891	-1.3309
+2	0.7047	1.0623	1.9811	1.2821
+1	0.59747	-0.023123	0.88555	-0.8844
+1	-1.0557	-1.5548	-1.3016	-0.77687
+2	1.5206	2.0289	0.90366	1.8089
+1	0.65525	-0.47226	-1.1824	0.41863
+2	-0.39262	0.382	-0.64829	0.40947
+2	0.14966	0.22972	0.33797	0.69647
+1	-1.8836	-0.68534	-0.99941	-0.78961
+1	0.48181	0.01241	1.2145	0.16835
+2	1.4673	2.0438	2.4674	2.5234
+1	-1.3242	-0.80218	-1.6446	-0.31044
+1	-1.2471	-2.0351	-1.0296	-1.937
+1	0.23695	-0.01724	-0.32851	-0.16484
+1	-0.13986	-0.6065	-0.8491	-0.95538
+2	0.90888	1.0365	2.7222	1.3507
+1	-0.30556	-1.1546	-0.86033	-2.2006
+2	0.5391	0.99532	0.96947	1.1575
+2	1.1235	0.37982	0.64439	0.94362
+2	1.7073	1.9303	2.8018	1.9158
+1	-0.20553	-0.074104	-0.50073	-1.0697
+1	-0.27415	0.23076	-0.27564	-0.11286
+1	-1.304	-1.1213	-0.71793	-1.3462
+2	0.54315	0.55846	0.87411	1.2432
+1	-1.0659	-0.38067	-1.4372	-2.0927
+1	0.21278	-1.0115	-1.0984	-0.72751
+1	-2.9061	-1.3118	-3.8372	-2.0448
+2	-0.69608	-0.61145	-1.0037	0.12181
+1	0.66835	0.018886	-1.0081	-1.4165
+1	0.32575	-0.51767	1.0187	-0.40914
+2	0.65837	1.2791	1.8388	2.2906
+2	0.37574	0.21618	-0.89435	1.2643
+1	0.13513	-0.31405	-0.16057	0.77712
+2	0.16054	0.40635	0.036165	1.6374
+1	1.9393	1.5717	2.6922	1.1933
+1	-0.59118	-0.47154	-0.20293	-1.5576
+1	-0.35938	-0.49565	-0.20837	0.61043
+2	-0.57133	0.15921	-0.44158	0.43312
+1	0.31835	0.49002	2.2029	0.17685
+1	-0.0093708	-0.85889	-1.0934	-1.6905
+1	-0.90501	-1.4637	-1.5526	-1.828
+2	0.11531	-0.022781	0.88843	0.8607
+1	0.34978	-0.34306	0.95301	-0.056177
+2	-0.22236	-0.13023	0.37608	0.18027
+1	-0.90103	-0.38393	-1.1513	-0.78153
+2	0.66848	0.81005	1.3945	3.3654
+2	0.10539	0.59781	0.77864	0.63865
+1	-1.15	-1.4531	-2.929	-1.6867
+1	0.20842	-0.0039076	-0.12879	-0.31459
+2	0.52155	1.248	1.0411	1.9656
+2	0.041926	0.86223	1.2222	1.0289
+1	-0.70875	-0.15791	-1.1581	-0.77456
+1	-1.1701	-0.57889	-0.8843	-0.11873
+2	0.98106	1.0805	0.95484	2.1834
+2	0.26676	0.7527	0.61491	1.9024
+1	-0.64765	0.19831	-1.4399	1.3127
+2	0.92209	2.2111	1.208	2.7402
+2	-0.93755	-0.26009	0.54448	0.20265
+2	1.2403	1.8468	1.6169	1.8359
+1	-0.1313	0.14288	-0.48278	-0.96105
+1	-0.7222	-0.25191	-1.2122	-0.59027
+2	-0.57013	-0.061267	-0.5438	0.18234
+1	-1.5355	-1.1998	-2.6613	-0.2634
+2	0.86507	0.60361	1.2411	-0.29711
+1	-0.60117	-0.7424	-0.79575	-0.5736
+1	-0.91776	-1.5669	-2.1735	-0.56602
+2	0.9917	2.3088	1.7993	2.645
+1	0.17017	0.53321	0.84278	-1.4458
+2	-0.22306	0.262	-0.86259	0.87407
+1	-0.42107	-0.69813	-0.48166	-1.009
+1	0.46913	-0.76457	0.11077	-0.21258
+1	0.066036	-0.48665	-0.74847	0.38785
+1	0.16465	-0.57268	0.19043	0.23
+1	-1.2044	-2.2027	-2.9688	-2.5546
+1	-0.3031	-2.0277	-1.3027	-2.6541
+2	-0.20063	0.3886	1.2227	0.84669
+2	-0.23897	0.0036995	-1.4547	0.37173
+1	2.197	0.41411	0.68339	-1.2721
+2	1.9922	2.748	3.0416	3.1268
+1	-1.7922	-1.2233	-3.1352	-0.98514
+2	0.66968	0.81377	1.9112	1.7507
+2	1.048	1.3718	1.5938	1.4847
+1	0.56532	-0.97153	-0.91123	-2.4761
+2	-0.53609	-0.30043	-0.65398	-0.38562
+2	1.0012	1.3344	2.0595	2.8441
+1	-3.4639	-2.4231	-3.9055	-2.3575
+1	0.79272	-0.78962	-0.40706	-1.1306
+1	0.78178	0.32152	0.79399	0.14086
+2	-0.28587	0.20138	0.78238	2.1602
+2	1.4137	1.6184	2.2458	2.1799
+2	1.409	1.6079	2.4053	2.0587
+2	-0.049571	1.1163	2.0792	0.99457
+1	-1.394	-0.67782	-2.2302	-0.33872
+2	0.5374	1.8476	2.205	2.0025
+1	-1.4988	-0.90782	-1.4206	-1.2048
+1	-2.2683	-1.7667	-3.7613	-2.0306
+1	0.5275	-0.34657	0.11355	-0.6761
+1	-1.89	-2.1862	-2.3535	-2.2032
+2	1.4183	2.5108	2.4607	1.7296
+1	-0.19829	0.031868	0.014954	-1.7813
+2	1.9842	2.0081	3.2753	3.6534
+1	0.60225	0.089417	0.37343	-1.396
+2	0.15127	0.55563	-0.099824	1.684
+1	-0.30521	-0.0050244	-0.68635	-0.42167
+2	0.65124	0.2796	-0.22261	1.4011
+1	-0.71925	-1.8908	-2.0898	-1.2222
+2	-0.56741	0.091717	-0.37763	0.40742
+1	-2.8956	-2.2286	-3.4496	-3.429
+2	-0.89598	1.0267	-0.4909	1.1085
+1	-0.94952	-0.7555	-1.795	-0.13335
+2	1.2407	2.0614	2.5452	1.9642
+1	-0.11717	-0.54282	-1.9921	-0.72275
+1	-0.45987	-0.58174	-1.1552	-0.76589
+2	1.4219	1.7052	1.3243	2.0381
+1	0.17284	-1.1866	0.12735	-0.89424
+1	-1.5493	-1.5627	-2.191	-1.4248
+2	-0.52149	0.50488	0.88087	1.9829
+2	-0.073205	0.87222	-0.68612	1.5622
+1	-0.20595	-0.60619	-1.2632	-0.31189
+1	-1.6215	-2.0613	-2.6335	-2.0367
+2	0.91305	1.4897	2.1731	2.2545
+1	1.142	1.8275	1.8053	1.0419
+1	-0.45335	-1.322	-1.3973	-0.48254
+2	0.74114	1.8757	1.4174	2.1017
+1	-0.38344	-0.17813	-0.23266	-0.41796
+2	0.92714	1.7223	2.7582	1.4736
+1	-0.96407	-1.004	-1.3232	-0.72647
+1	-0.17388	-0.55234	-0.16535	-1.1821
+1	-1.4482	-1.0906	-1.9966	-0.2562
+1	-1.5948	-1.656	-2.1184	-1.9089
+1	0.30118	-0.24953	0.3965	-1.2012
+1	0.040955	-1.5321	-0.0067596	-1.8302
+2	-0.47573	0.19062	-0.38082	1.4748
+1	-0.57924	-0.90781	-1.0718	-0.87675
+2	1.2355	1.6025	0.66291	1.3094
+1	-0.85148	-1.0376	-0.35579	-0.84493
+1	0.62128	-0.097245	1.1169	1.1175
+1	-1.0166	-0.95689	-0.54272	-1.0278
+2	2.2273	2.234	3.0504	2.9534
+2	0.39445	0.74964	0.49728	0.40693
+1	-1.0992	-1.0596	-0.34052	-1.6927
+2	-0.87373	-0.044581	-0.87888	-0.87457
+1	-0.17361	-1.0992	-0.61197	-0.52145
+2	-0.81143	-0.23214	0.019331	-0.021054
+2	0.4003	0.84559	1.3177	0.22445
+2	2.4797	2.3692	3.1041	1.2821
+2	-1.2217	0.28611	-0.91875	0.53117
+1	-0.37718	-1.1674	1.1769	-0.7679
+2	0.69641	1.3615	1.2907	1.7631
+1	0.058157	-1.4908	-1.6127	-2.051
+2	-0.10351	-0.26543	-1.1031	1.4271
+2	1.5874	1.159	2.1284	1.6052
+2	0.7304	1.8986	1.8219	2.6148
+2	1.2822	1.2151	1.6436	0.45098
+1	-0.67686	-0.50447	-0.81689	-0.47995
+2	0.099845	0.22575	-0.38467	1.3463
+1	-0.60473	-0.56624	-1.0822	-0.9277
+2	-0.09599	-0.052173	0.60328	0.36281
+1	1.3654	0.15181	1.0298	-1.196
+2	-1.4158	-1.1006	-1.9009	0.73982
+1	-0.035902	-0.11554	0.031789	0.15859
+2	-0.41972	-0.75665	-0.12297	-1.1222
+2	0.5198	1.1791	1.4405	0.74397
+2	0.48739	-0.18437	0.062889	1.33
+1	-0.40637	-0.97335	-1.7407	-1.7785
+2	1.2506	2.1236	2.544	2.21
+1	0.2246	0.14729	0.19402	-0.0184
+1	-2.9787	-2.8634	-3.6482	-3.2628
+2	-0.34778	-0.88344	-0.53681	-0.1392
+2	-1.8429	-1.7447	-1.2394	0.076896
+2	0.19618	1.4064	0.26418	1.4885
+1	1.1131	-0.28387	-0.062115	-0.38574
+2	0.49115	0.78076	1.4226	0.55504
+1	-1.8202	-1.2481	-2.3751	-1.7518
+2	1.2174	2.2183	1.4501	3.6806
+1	-1.9377	-1.6646	-3.3068	-2.1189
+2	0.54181	0.5947	0.58072	0.40033
+1	-0.66287	-0.68746	-0.096024	-1.7397
+1	0.40851	0.30851	-0.17237	-0.50364
+2	0.75742	0.4505	-0.78196	0.44425
+1	-1.4505	0.020384	-0.43303	-0.95328
+2	-0.028847	0.15037	0.5137	0.46568
+2	-0.63541	0.3954	-0.8684	1.5549
+1	0.33942	-0.38445	-0.041492	-1.4867
+2	0.47366	1.145	0.23226	1.7193
+1	0.023382	-0.041247	-0.82666	0.080651
+1	-1.1404	-1.0549	-2.3807	-2.1069
+2	0.33731	1.2985	0.71006	3.2157
+1	1.14	-0.87596	0.068296	-0.74487
+2	-0.049493	0.63	0.61696	0.5656
+1	-0.4566	0.65674	0.031943	0.92164
+2	0.017518	0.38805	0.53672	0.36798
+2	0.48676	0.83957	0.81814	1.0935
+2	2.7892	2.4059	4.9329	2.8726
+1	0.43253	0.11799	1.095	-0.30789
+1	-1.1828	-0.8044	-0.85393	-0.88528
+1	-1.5592	-2.1209	-2.309	-3.1197
+2	-1.2601	-1.2767	-1.6618	-0.50383
+2	2.1516	2.1742	2.8387	1.8793
+2	0.24623	0.69241	-0.010176	0.53935
+1	-0.22259	-0.40572	0.11176	-1.348
+1	-0.50134	-1.5699	0.070888	-1.576
+1	-0.59262	-0.25483	-0.97248	-0.80873
+2	0.59278	2.3224	1.2169	3.7789
+2	1.8088	2.2184	2.3414	2.2607
+1	-1.4547	-0.92385	-2.0514	-1.4636
+1	-1.0861	-0.97609	-1.4805	0.049658
+2	-1.3983	-1.4913	-1.5386	-0.37917
+1	0.39015	-0.60643	0.29969	-1.038
+2	-0.56574	0.93819	0.41397	3.0029
+1	0.33141	0.18418	-0.58313	-0.55312
+1	-1.0672	-1.2348	-1.7643	-1.8829
+1	-2.6167	-2.6369	-2.7652	-3.2899
+2	0.86111	1.9481	1.9289	2.6912
+2	-0.17146	0.59905	-0.32254	0.90592
+1	0.56296	0.22567	0.50046	-0.015986
+1	0.27356	0.014082	0.53515	-1.2915
+2	0.028483	0.74312	0.032785	0.86451
+2	0.45844	1.8271	1.9607	1.5293
+1	-1.0948	-0.81939	-1.3227	-1.7485
+2	-1.9435	-1.416	-2.3622	-0.083073
+2	1.9356	2.3905	3.3874	3.3754
+2	-0.51503	-0.61825	-1.0265	1.0355
+1	-0.069375	-0.38404	0.76998	-1.0565
+1	-0.99145	-1.4551	-0.3469	-1.1237
+2	0.22687	0.42981	-0.57465	1.7352
+1	-0.6192	-0.85621	-1.5754	-2.1116
+2	0.044283	0.22217	-0.46803	0.077448
+2	0.25206	0.75089	2.0777	1.6582
+1	-1.4421	0.36925	-1.3094	1.5023
+2	-0.37483	0.92607	0.66991	1.5735
+2	0.96079	1.4626	2.6634	1.8589
+1	-1.3318	-0.19963	-1.0137	-0.69936
+1	1.7601	1.2466	2.176	0.32938
+1	0.30315	-0.016251	0.51713	-0.89472
+2	-1.4913	-0.70336	-0.91095	0.12156
+2	-0.42001	-0.10023	-0.6748	0.60273
+2	1.3951	2.7444	2.8842	3.5656
+1	1.4232	0.6032	3.5048	1.7782
+1	0.73551	0.75694	1.037	-0.57807
+2	-0.39931	0.58809	-0.4973	0.21019
+2	1.3913	1.8648	1.7568	0.93599
+2	0.80965	0.4027	0.24317	1.9104
+1	-0.51752	1.1244	0.48382	0.33224
+1	0.1481	-0.5792	-0.3214	-0.26037
+1	-1.3533	-0.43213	-0.42417	-0.87353
+2	0.56938	0.99576	0.89716	1.7409
+1	-0.079763	-1.7127	-0.63871	-2.5791
+2	2.0641	2.5514	4.0436	2.7148
+1	-0.19435	-0.15077	0.60547	-1.4134
+2	0.081749	0.54813	0.96427	1.7548
+1	1.8213	0.88012	1.1502	0.10288
+2	-0.36776	1.0119	0.72045	1.4314
+2	-0.013532	0.88042	-0.065303	1.2714
+1	-0.46271	-1.5631	-1.3127	-1.5945
+2	0.32816	0.69476	1.2058	0.95562
+2	1.0995	1.9791	1.6754	2.7251
+2	1.2894	2.0428	2.7797	3.0741
+2	0.086177	0.13431	0.15097	1.1387
+2	1.4238	1.8326	1.452	2.2914
+2	-0.26067	0.085743	0.10703	1.6861
+1	0.8651	0.16132	1.2287	-0.49648
+2	1.6258	2.0722	1.5768	2.692
+2	-0.41045	-0.064344	-1.1639	0.35736
+1	0.87048	0.48066	1.3185	0.56768
+1	-0.059767	0.65175	0.20121	-1.4305
+1	-0.27649	-0.71256	-0.93355	0.12948
+2	0.40298	0.62103	0.38596	1.4175
+2	0.92929	1.4075	2.4664	1.9966
+1	-1.7047	-1.5666	-1.9704	-2.1459
+2	-0.31907	0.39015	-0.094609	0.63235
+2	1.43	2.3977	3.1491	2.2081
+1	-1.6535	-0.62255	-1.1695	-0.61433
+2	-0.22619	-0.15443	0.80091	-0.054849
+2	0.38626	1.6316	0.47058	1.4147
+1	0.14484	-0.64224	0.0082434	-0.86504
+2	1.8557	2.0853	3.4931	3.3653
+2	1.9842	3.3837	3.9431	2.2935
+1	-1.8676	-0.25935	-1.384	-0.46349
+2	1.1631	1.8748	2.8603	1.986
+2	0.28825	0.24785	1.285	0.97497
+1	0.014074	-0.43179	0.47159	-1.5869
+2	0.54993	1.3186	0.45672	1.4753
+1	0.36038	-0.17131	0.38497	0.032798
+2	-0.80787	0.028976	0.37316	-0.44677
+2	-0.28951	0.65841	-0.64075	1.0972
+2	0.55213	0.20033	-0.03155	-0.76611
+2	-0.39724	0.7762	0.84015	0.7553
+1	0.93813	0.87454	1.4003	-1.3907
+2	-0.32578	0.26563	-0.33416	1.6042
+2	0.33084	1.2848	1.0439	0.0011286
+2	-0.38575	0.17469	-0.30238	1.5178
+2	1.3498	1.2703	1.9845	1.5933
+2	0.58348	1.167	1.0504	1.1296
+1	1.082	0.6528	0.81685	-0.23314
+2	2.4742	2.4752	3.1153	2.9547
+2	0.12754	0.025728	-0.058504	0.58213
+2	1.817	2.0622	1.4037	1.1949
+2	0.8552	1.6038	1.0049	2.2411
+1	-1.0052	-1.0198	-0.48341	-2.5176
+1	-1.3895	-1.8934	-2.3298	-1.8805
+2	-1.0276	0.3109	-0.56926	0.026187
+1	-1.3081	-0.57127	-2.0782	-2.0429
+2	0.50882	-0.20697	0.013231	1.1618
+1	-0.9931	-1.3226	-0.98672	-0.47612
+1	0.41926	-0.14847	0.91577	-1.2763
+1	-0.93098	-1.0248	-2.0666	-0.55364
+1	-0.25192	-0.73885	0.073947	-0.4339
+1	-0.6545	-0.21517	-1.3672	-1.5453
+2	1.6327	2.0072	2.554	2.6639
+2	0.57601	-0.3015	0.74417	0.88943
+2	1.2264	1.7475	0.67207	1.0271
+1	0.42271	0.040673	0.80654	-0.83604
+1	-0.67361	-0.91976	-2.2619	-1.3054
+2	0.36815	0.93526	1.3126	1.077
+2	-0.1728	0.32075	0.54531	1.9659
+2	1.8385	2.4279	3.2285	3.4634
+1	-1.4314	-0.89679	-1.154	-1.4032
+2	0.38846	0.05761	1.0422	1.9036
+1	0.80821	-0.15658	-0.62623	-0.68719
+1	-1.302	-1.3887	-2.2708	-2.092
+1	-1.2392	-1.4976	-1.3607	-3.0231
+1	-0.3896	-0.42846	-0.75791	-1.7643
+2	1.5723	1.0907	2.0144	1.5574
+2	0.8587	1.1411	1.1627	1.9495
+2	-0.77478	-0.39283	-0.0099916	0.64003
+2	0.1672	0.63395	0.41181	1.3391
+2	-0.14637	0.26969	0.82956	0.41884
+2	0.14447	-0.10291	-0.287	0.80367
+1	0.18687	-0.27602	0.27575	-0.63094
+2	1.2428	1.5281	1.2243	3.0052
+1	-0.052875	-0.25162	-0.60352	-1.208
+2	0.6821	0.21045	1.2654	-0.013434
+1	0.26358	0.068284	0.22081	0.066436
+2	-0.62892	-0.053397	0.047075	0.74043
+2	-0.78913	-0.2106	-1.804	0.01624
+1	0.22995	-0.80286	1.3801	-0.92733
+1	-1.9684	-1.1444	-1.8	-2.7373
+2	-0.5569	-0.61626	-0.86638	0.4016
+2	0.1115	1.0784	-0.3657	1.3313
+1	-0.64278	-0.82557	-0.24553	-1.5426
+2	0.20989	0.049778	0.14976	-0.17113
+2	0.93007	1.927	1.9457	1.1498
+1	0.26164	0.15551	-0.033813	0.44309
+2	0.73092	1.0348	0.74128	2.4557
+2	-0.35204	0.606	-0.43078	1.2194
+1	-0.16719	0.40172	0.76466	0.31738
+2	0.97519	1.447	1.6576	0.8312
+1	-0.47105	-0.44196	-1.6032	0.68482
+2	-0.60894	-0.70426	-0.46443	0.86476
+2	-0.19328	0.33885	0.7601	0.61242
+2	0.12697	0.76843	0.73746	0.81747
+1	0.031673	-0.68398	-0.5238	-0.6702
+1	-0.93868	0.50393	0.10229	-0.63522
+1	-1.0264	-1.1855	-1.9957	-2.5259
+2	-0.5916	0.44419	0.014831	0.77302
+1	1.0176	0.82793	0.63908	-0.62945
+1	0.76611	0.14394	0.43542	-0.86403
+2	0.58551	0.21427	1.0034	0.50604
+2	-0.34577	-0.40185	-0.61186	-0.40606
+1	-0.77597	-1.1617	-1.8329	-3.1861
+2	0.068959	0.30321	0.76889	0.34588
+1	-1.2576	-1.5157	-1.1779	-0.94907
+1	-0.83648	0.090435	0.56704	-0.53314
+2	0.88421	1.707	2.6335	2.255
+2	0.55861	0.94463	0.9639	0.8637
+1	-0.18064	-1.0746	0.99446	-2.7845
+1	0.76049	0.26843	1.5167	-0.24873
+2	0.35634	-0.24447	-0.97159	0.11146
+2	1.7377	2.5182	2.4327	3.2303
+1	-1.624	-1.42	-3.435	-1.0498
+1	-1.2389	-1.8164	-1.726	-1.1608
+1	1.0074	-1.0969	-0.0682	-2.9043
+2	0.21432	0.54189	0.15421	1.1324
+2	1.5187	2.458	2.1317	3.8317
+2	1.5893	1.9248	3.0454	2.0655
+1	0.35221	1.6454	1.8029	-0.44455
+1	-0.54894	0.55414	0.35949	-1.3991
+2	-1.1614	-0.48362	-0.73735	-0.49564
+2	1.1159	1.0502	1.0648	0.3003
+2	0.96161	2.1506	1.531	2.1461
+1	-1.2411	-1.0381	-1.1269	-1.1484
+1	0.11049	-0.27275	-0.55964	-0.70906
+2	2.2862	2.1313	2.6027	2.2877
+1	-0.64184	-1.1552	-0.63442	-1.8594
+2	1.9075	1.8567	3.8481	1.9532
+1	-0.63126	-0.85427	-0.53335	0.37771
+2	0.59491	1.4425	1.9929	0.98581
+1	1.5669	0.7286	2.3314	-0.25628
+1	-2.1064	-1.9792	-3.209	-1.9161
+2	0.62872	0.51499	0.21648	1.4204
+1	-0.51532	-0.93122	-0.72578	-1.3459
+1	0.041397	-0.61347	-0.034157	-0.054858
+1	-0.72287	-1.1269	-1.7365	-1.4906
+1	-1.8362	-0.24614	-1.2446	-0.088146
+2	0.97014	1.3422	1.5292	0.77185
+1	-1.8502	-1.2924	-1.9175	-2.5133
+2	0.77748	0.89065	1.1444	0.26583
+1	-0.15405	0.089319	0.59477	0.16672
+2	1.3054	2.3544	3.2492	1.6727
+2	0.92409	1.3741	0.79866	2.0506
+2	-0.69943	-0.67926	-1.8186	0.67307
+1	-3.2806	-1.8577	-3.5456	-1.7004
+2	0.74119	1.0011	-0.11293	2.328
+2	0.73779	1.6924	1.7521	1.2604
+1	-1.3683	-1.7765	-1.5974	-2.2288
+2	0.46839	-0.27199	-0.1524	0.88269
+1	-0.73595	-1.4506	-1.408	-1.9886
+2	-0.2289	-0.5663	-2.0807	-1.4869
+2	-1.0052	0.16268	-0.48156	0.014777
+1	-0.10211	0.087625	-1.1098	-1.0203
+2	-0.090896	-0.057038	-0.69817	0.19942
+2	-0.42191	0.14803	-0.32168	0.049687
+2	0.84872	0.59768	1.9205	1.1233
+1	0.029696	-1.4186	-0.39548	-0.029631
+2	2.0013	1.9999	3.0139	1.6432
+2	1.1324	0.89689	-0.1229	0.15109
+2	0.93618	2.4521	1.7229	3.4367
+1	-1.0037	-1.435	-2.2126	-1.9473
+2	-2.2472	-1.296	-2.3762	-1.9611
+2	0.62477	1.5212	1.2814	1.4403
+2	0.17619	0.488	0.38575	0.19632
+1	0.79693	0.15328	-0.26972	-0.45147
+2	1.3618	1.6805	1.2152	2.1905
+2	-0.36075	1.0698	0.38569	2.5707
+1	-0.55325	-0.17572	-1.0232	-1.134
+2	0.9795	1.3777	0.26495	0.23258
+1	-0.92872	-1.2233	-2.1998	-1.9011
+1	0.47029	-0.06201	-0.34515	-0.57857
+1	-2.6597	-1.5144	-3.0038	-1.949
+2	-0.064474	-0.25394	-0.34794	0.76334
+2	0.52259	0.76325	0.93484	0.060827
+1	0.89037	0.68007	0.50459	-0.88464
+2	1.0031	1.3853	1.7313	0.75303
+2	0.6954	1.3692	0.19298	1.6174
+2	-0.14026	1.1774	0.39386	-0.25913
+2	-1.7796	-1.2709	-2.5775	-0.36996
+2	0.41557	1.9905	1.839	1.1327
+1	0.53878	-0.71974	-0.65395	-0.62597
+2	0.22326	1.3888	0.17221	1.2265
+1	-0.12667	-1.1336	-0.67	-3.6161
+2	1.0183	1.5883	2.2784	1.7509
+1	-2.0415	-2.2483	-2.8307	-3.1148
+2	-1.1513	-0.08575	-0.62876	2.164
+1	0.1961	0.075096	1.9551	0.039445
+2	-0.96925	0.12921	-1.2741	1.8371
+1	0.34137	0.086468	1.4716	0.55236
+1	-0.20756	-0.74846	0.65256	-0.7032
+2	1.1736	1.0214	1.258	1.0002
+2	0.48081	1.3275	0.54443	1.2194
+2	-0.45146	0.38298	0.64902	0.90395
+1	0.75519	-1.0627	-0.35778	-1.7689
+1	-1.4308	-1.0998	-1.0094	-0.66361
+1	-0.097019	0.18029	-9.0423e-07	0.59444
+2	1.3769	2.4872	3.2855	0.98727
+2	0.79201	0.76361	0.88459	3.119
+2	2.5125	2.4776	4.6119	3.966
+1	0.57129	-0.93689	-0.20516	-0.42323
+1	-0.91517	-0.25445	-1.3515	-0.99354
+1	0.17456	-0.98904	-0.49643	-0.8997
+1	-2.2724	-1.6869	-3.8034	-2.0882
+2	-1.8188	-0.57721	-2.4386	0.058963
+2	-0.19227	0.038901	-0.85065	0.6644
+1	-1.5517	-0.57182	-0.9874	-1.4081
+2	-0.47999	0.49667	0.27351	0.6261
+2	0.45041	0.48469	0.55808	2.0659
+1	-1.1302	-1.255	-2.7206	-1.2712
+1	-0.60672	-1.1008	-2.6889	-1.0078
+1	-1.0508	-0.99612	-1.555	-1.0463
+2	0.14434	0.97791	1.2498	1.7391
+2	0.21333	1.6686	1.219	1.8919
+2	-0.35461	-0.64694	-1.3312	-0.10481
+1	-2.0611	-2.1245	-3.6067	-1.6584
+2	-0.3534	0.45962	-0.39991	0.45667
+1	-0.37564	-0.63085	-1.2641	-1.3292
+1	0.30023	-0.20283	0.041852	-0.17139
+2	0.25089	1.0204	1.8084	1.0493
+1	-0.44041	-1.1143	-0.59224	-0.84288
+2	-0.11392	0.5681	-0.054604	0.88897
+1	0.41829	-1.042	-0.0042274	-1.9512
+2	1.4863	2.9227	3.0012	3.1253
+1	-0.60588	-1.1196	-1.4647	-0.92268
+1	-0.10497	-0.74629	-1.8353	-0.35425
+1	-1.2499	-0.83335	-2.4047	-1.4657
+1	-0.51414	-1.4602	-0.54649	-1.0475
+1	0.56956	0.79545	0.86494	-0.59471
+1	-0.64964	-0.78543	-1.9412	-2.2114
+2	1.0044	0.56431	1.2968	1.3807
+1	-1.1924	-0.69401	-0.72828	-1.7252
+2	0.15739	1.0449	0.3742	1.4303
+2	0.49582	1.4353	1.1652	1.5814
+
diff --git a/sourcecodes/data/example_sci_bk/Llugraphviz.txt b/sourcecodes/data/example_sci_bk/Llugraphviz.txt
new file mode 100644
index 00000000..88bbd3ba
--- /dev/null
+++ b/sourcecodes/data/example_sci_bk/Llugraphviz.txt
@@ -0,0 +1,10 @@
+digraph G {
+size="10,10";  ratio = fill;
+node [shape=square,width=1.5];
+Genotype -> Gene3;
+Genotype -> Gene1;
+Gene3 -> Phenotype;
+Gene2 -> Gene3;
+Gene2 -> Phenotype;
+Gene1 -> Gene2;
+}
\ No newline at end of file
diff --git a/sourcecodes/data/example_sci_bk/Lluk.txt b/sourcecodes/data/example_sci_bk/Lluk.txt
new file mode 100644
index 00000000..83b33d23
--- /dev/null
+++ b/sourcecodes/data/example_sci_bk/Lluk.txt
@@ -0,0 +1 @@
+1000
diff --git a/sourcecodes/data/example_sci_bk/Llumap.txt b/sourcecodes/data/example_sci_bk/Llumap.txt
new file mode 100644
index 00000000..958281d5
--- /dev/null
+++ b/sourcecodes/data/example_sci_bk/Llumap.txt
@@ -0,0 +1,5 @@
+Genotype	2	0.500305	1.514000
+Gene3	1	1.027261	-0.015284
+Gene2	1	1.160583	0.138097
+Phenotype	1	1.554104	0.069005
+Gene1	1	1.515414	0.174451
diff --git a/sourcecodes/data/example_sci_bk/Llumapdata.txt b/sourcecodes/data/example_sci_bk/Llumapdata.txt
new file mode 100644
index 00000000..d684ea06
--- /dev/null
+++ b/sourcecodes/data/example_sci_bk/Llumapdata.txt
@@ -0,0 +1 @@
+Genotype	Gene1	Gene2	Gene3	Phenotype
diff --git a/sourcecodes/data/example_sci_bk/Lluname.txt b/sourcecodes/data/example_sci_bk/Lluname.txt
new file mode 100644
index 00000000..f3a1f5bf
--- /dev/null
+++ b/sourcecodes/data/example_sci_bk/Lluname.txt
@@ -0,0 +1 @@
+Genotype	Gene3	Gene2	Phenotype	Gene1
diff --git a/sourcecodes/data/example_sci_bk/Llunet_figure.txt b/sourcecodes/data/example_sci_bk/Llunet_figure.txt
new file mode 100644
index 00000000..bdc07cbd
--- /dev/null
+++ b/sourcecodes/data/example_sci_bk/Llunet_figure.txt
@@ -0,0 +1,433 @@
+5
+1200	1200	
+Genotype	0	0
+Gene1	120	200
+Gene2	0	400
+Gene3	120	600
+Phenotype	0	800
+Genotype	2
+250	150
+0
+2	2	4
+1	0.4860
+2	0.5140
+Gene1	1
+250	150
+1	1
+1	3
+-3.5013	0.0009
+-3.4313	0.0012
+-3.3613	0.0015
+-3.2912	0.0019
+-3.2212	0.0024
+-3.1512	0.0030
+-3.0811	0.0037
+-3.0111	0.0046
+-2.9411	0.0056
+-2.8710	0.0069
+-2.8010	0.0083
+-2.7310	0.0101
+-2.6609	0.0121
+-2.5909	0.0145
+-2.5209	0.0174
+-2.4508	0.0206
+-2.3808	0.0243
+-2.3108	0.0286
+-2.2407	0.0335
+-2.1707	0.0389
+-2.1007	0.0451
+-2.0306	0.0520
+-1.9606	0.0597
+-1.8906	0.0682
+-1.8205	0.0775
+-1.7505	0.0876
+-1.6805	0.0986
+-1.6104	0.1105
+-1.5404	0.1231
+-1.4704	0.1366
+-1.4003	0.1508
+-1.3303	0.1657
+-1.2603	0.1811
+-1.1902	0.1971
+-1.1202	0.2134
+-1.0502	0.2300
+-0.9801	0.2467
+-0.9101	0.2633
+-0.8401	0.2797
+-0.7700	0.2956
+-0.7000	0.3110
+-0.6300	0.3256
+-0.5599	0.3392
+-0.4899	0.3517
+-0.4199	0.3629
+-0.3498	0.3726
+-0.2798	0.3808
+-0.2098	0.3873
+-0.1397	0.3920
+-0.0697	0.3948
+0.0003	0.3958
+0.0704	0.3948
+0.1404	0.3920
+0.2104	0.3872
+0.2805	0.3807
+0.3505	0.3726
+0.4205	0.3628
+0.4906	0.3516
+0.5606	0.3391
+0.6306	0.3254
+0.7007	0.3108
+0.7707	0.2955
+0.8407	0.2795
+0.9108	0.2631
+0.9808	0.2465
+1.0508	0.2299
+1.1209	0.2133
+1.1909	0.1969
+1.2609	0.1810
+1.3310	0.1655
+1.4010	0.1507
+1.4710	0.1365
+1.5411	0.1230
+1.6111	0.1103
+1.6811	0.0985
+1.7512	0.0875
+1.8212	0.0774
+1.8912	0.0681
+1.9613	0.0596
+2.0313	0.0520
+2.1013	0.0451
+2.1714	0.0389
+2.2414	0.0334
+2.3114	0.0286
+2.3815	0.0243
+2.4515	0.0206
+2.5215	0.0173
+2.5916	0.0145
+2.6616	0.0121
+2.7316	0.0101
+2.8017	0.0083
+2.8717	0.0068
+2.9417	0.0056
+3.0118	0.0046
+3.0818	0.0037
+3.1518	0.0030
+3.2219	0.0024
+3.2919	0.0019
+3.3619	0.0015
+3.4320	0.0012
+3.5020	0.0009
+Gene2	1
+250	150
+1	2
+2	4	5
+-3.5862	0.0008
+-3.5124	0.0010
+-3.4385	0.0013
+-3.3647	0.0016
+-3.2909	0.0020
+-3.2171	0.0026
+-3.1432	0.0032
+-3.0694	0.0041
+-2.9956	0.0050
+-2.9218	0.0062
+-2.8479	0.0077
+-2.7741	0.0094
+-2.7003	0.0114
+-2.6264	0.0138
+-2.5526	0.0166
+-2.4788	0.0199
+-2.4050	0.0237
+-2.3311	0.0281
+-2.2573	0.0331
+-2.1835	0.0388
+-2.1097	0.0453
+-2.0358	0.0526
+-1.9620	0.0607
+-1.8882	0.0696
+-1.8143	0.0795
+-1.7405	0.0903
+-1.6667	0.1021
+-1.5929	0.1147
+-1.5190	0.1282
+-1.4452	0.1426
+-1.3714	0.1578
+-1.2976	0.1736
+-1.2237	0.1900
+-1.1499	0.2069
+-1.0761	0.2241
+-1.0022	0.2414
+-0.9284	0.2587
+-0.8546	0.2758
+-0.7808	0.2924
+-0.7069	0.3084
+-0.6331	0.3236
+-0.5593	0.3377
+-0.4855	0.3506
+-0.4116	0.3621
+-0.3378	0.3719
+-0.2640	0.3800
+-0.1901	0.3863
+-0.1163	0.3905
+-0.0425	0.3927
+0.0313	0.3929
+0.1052	0.3910
+0.1790	0.3870
+0.2528	0.3811
+0.3266	0.3732
+0.4005	0.3636
+0.4743	0.3524
+0.5481	0.3397
+0.6220	0.3258
+0.6958	0.3108
+0.7696	0.2949
+0.8434	0.2783
+0.9173	0.2613
+0.9911	0.2440
+1.0649	0.2267
+1.1387	0.2095
+1.2126	0.1925
+1.2864	0.1760
+1.3602	0.1601
+1.4341	0.1449
+1.5079	0.1304
+1.5817	0.1167
+1.6555	0.1039
+1.7294	0.0920
+1.8032	0.0811
+1.8770	0.0711
+1.9508	0.0620
+2.0247	0.0537
+2.0985	0.0464
+2.1723	0.0398
+2.2462	0.0340
+2.3200	0.0288
+2.3938	0.0243
+2.4676	0.0205
+2.5415	0.0171
+2.6153	0.0142
+2.6891	0.0117
+2.7629	0.0097
+2.8368	0.0079
+2.9106	0.0064
+2.9844	0.0052
+3.0583	0.0042
+3.1321	0.0034
+3.2059	0.0027
+3.2797	0.0021
+3.3536	0.0017
+3.4274	0.0013
+3.5012	0.0010
+3.5750	0.0008
+3.6489	0.0006
+3.7227	0.0005
+3.7965	0.0004
+Gene3	1
+250	150
+2	1	3
+1	5
+-4.3571	0.0001
+-4.2762	0.0001
+-4.1954	0.0001
+-4.1145	0.0001
+-4.0336	0.0002
+-3.9527	0.0002
+-3.8719	0.0003
+-3.7910	0.0004
+-3.7101	0.0006
+-3.6293	0.0008
+-3.5484	0.0010
+-3.4675	0.0013
+-3.3866	0.0018
+-3.3058	0.0023
+-3.2249	0.0029
+-3.1440	0.0037
+-3.0632	0.0047
+-2.9823	0.0059
+-2.9014	0.0074
+-2.8205	0.0092
+-2.7397	0.0113
+-2.6588	0.0139
+-2.5779	0.0170
+-2.4971	0.0206
+-2.4162	0.0248
+-2.3353	0.0297
+-2.2544	0.0354
+-2.1736	0.0419
+-2.0927	0.0493
+-2.0118	0.0576
+-1.9310	0.0669
+-1.8501	0.0773
+-1.7692	0.0887
+-1.6883	0.1012
+-1.6075	0.1147
+-1.5266	0.1292
+-1.4457	0.1447
+-1.3648	0.1610
+-1.2840	0.1781
+-1.2031	0.1958
+-1.1222	0.2139
+-1.0414	0.2323
+-0.9605	0.2507
+-0.8796	0.2688
+-0.7987	0.2866
+-0.7179	0.3036
+-0.6370	0.3197
+-0.5561	0.3345
+-0.4753	0.3479
+-0.3944	0.3597
+-0.3135	0.3695
+-0.2326	0.3773
+-0.1518	0.3828
+-0.0709	0.3861
+0.0100	0.3870
+0.0908	0.3855
+0.1717	0.3817
+0.2526	0.3756
+0.3335	0.3673
+0.4143	0.3570
+0.4952	0.3449
+0.5761	0.3311
+0.6569	0.3160
+0.7378	0.2996
+0.8187	0.2824
+0.8996	0.2645
+0.9804	0.2463
+1.0613	0.2279
+1.1422	0.2095
+1.2230	0.1915
+1.3039	0.1740
+1.3848	0.1570
+1.4657	0.1409
+1.5465	0.1256
+1.6274	0.1114
+1.7083	0.0981
+1.7891	0.0859
+1.8700	0.0747
+1.9509	0.0646
+2.0318	0.0555
+2.1126	0.0474
+2.1935	0.0402
+2.2744	0.0340
+2.3552	0.0285
+2.4361	0.0237
+2.5170	0.0197
+2.5979	0.0162
+2.6787	0.0132
+2.7596	0.0108
+2.8405	0.0087
+2.9213	0.0070
+3.0022	0.0056
+3.0831	0.0044
+3.1640	0.0035
+3.2448	0.0027
+3.3257	0.0021
+3.4066	0.0016
+3.4874	0.0013
+3.5683	0.0010
+3.6492	0.0007
+3.7301	0.0006
+Phenotype	1
+250	150
+2	3	4
+0
+-3.5574	0.0010
+-3.4806	0.0013
+-3.4037	0.0016
+-3.3268	0.0021
+-3.2499	0.0026
+-3.1731	0.0033
+-3.0962	0.0042
+-3.0193	0.0052
+-2.9425	0.0065
+-2.8656	0.0080
+-2.7887	0.0098
+-2.7118	0.0120
+-2.6350	0.0146
+-2.5581	0.0176
+-2.4812	0.0212
+-2.4044	0.0253
+-2.3275	0.0300
+-2.2506	0.0354
+-2.1737	0.0416
+-2.0969	0.0486
+-2.0200	0.0564
+-1.9431	0.0651
+-1.8663	0.0748
+-1.7894	0.0854
+-1.7125	0.0970
+-1.6356	0.1096
+-1.5588	0.1230
+-1.4819	0.1374
+-1.4050	0.1526
+-1.3282	0.1685
+-1.2513	0.1850
+-1.1744	0.2021
+-1.0975	0.2195
+-1.0207	0.2370
+-0.9438	0.2545
+-0.8669	0.2718
+-0.7901	0.2887
+-0.7132	0.3049
+-0.6363	0.3202
+-0.5594	0.3344
+-0.4826	0.3473
+-0.4057	0.3587
+-0.3288	0.3684
+-0.2520	0.3763
+-0.1751	0.3822
+-0.0982	0.3860
+-0.0213	0.3877
+0.0555	0.3872
+0.1324	0.3846
+0.2093	0.3798
+0.2861	0.3731
+0.3630	0.3644
+0.4399	0.3539
+0.5168	0.3418
+0.5936	0.3283
+0.6705	0.3136
+0.7474	0.2979
+0.8242	0.2813
+0.9011	0.2643
+0.9780	0.2468
+1.0549	0.2293
+1.1317	0.2118
+1.2086	0.1945
+1.2855	0.1777
+1.3623	0.1614
+1.4392	0.1458
+1.5161	0.1310
+1.5930	0.1170
+1.6698	0.1039
+1.7467	0.0918
+1.8236	0.0806
+1.9004	0.0704
+1.9773	0.0612
+2.0542	0.0529
+2.1311	0.0454
+2.2079	0.0388
+2.2848	0.0329
+2.3617	0.0278
+2.4385	0.0234
+2.5154	0.0195
+2.5923	0.0162
+2.6692	0.0134
+2.7460	0.0110
+2.8229	0.0090
+2.8998	0.0073
+2.9766	0.0059
+3.0535	0.0047
+3.1304	0.0038
+3.2073	0.0030
+3.2841	0.0024
+3.3610	0.0019
+3.4379	0.0015
+3.5147	0.0011
+3.5916	0.0009
+3.6685	0.0007
+3.7454	0.0005
+3.8222	0.0004
+3.8991	0.0003
+3.9760	0.0002
+4.0528	0.0002
+4.1297	0.0001
diff --git a/sourcecodes/data/example_sci_bk/Llunet_figure_new.txt b/sourcecodes/data/example_sci_bk/Llunet_figure_new.txt
new file mode 100644
index 00000000..7e6f0d97
--- /dev/null
+++ b/sourcecodes/data/example_sci_bk/Llunet_figure_new.txt
@@ -0,0 +1,433 @@
+1	
+5
+1200	1200	
+Genotype	0	0
+Gene1	120	200
+Gene2	0	400
+Gene3	120	600
+Phenotype	0	800
+Genotype	2
+250	150
+0
+2	2	4
+1.0000	1.0000
+Gene1	1
+250	150
+1	1
+1	3
+-3.5013	0.0000
+-3.4313	0.0000
+-3.3613	0.0000
+-3.2912	0.0000
+-3.2212	0.0000
+-3.1512	0.0000
+-3.0811	0.0000
+-3.0111	0.0000
+-2.9411	0.0000
+-2.8710	0.0000
+-2.8010	0.0000
+-2.7310	0.0000
+-2.6609	0.0000
+-2.5909	0.0000
+-2.5209	0.0001
+-2.4508	0.0002
+-2.3808	0.0004
+-2.3108	0.0007
+-2.2407	0.0014
+-2.1707	0.0026
+-2.1007	0.0046
+-2.0306	0.0079
+-1.9606	0.0133
+-1.8906	0.0217
+-1.8205	0.0344
+-1.7505	0.0529
+-1.6805	0.0791
+-1.6104	0.1147
+-1.5404	0.1615
+-1.4704	0.2207
+-1.4003	0.2928
+-1.3303	0.3771
+-1.2603	0.4715
+-1.1902	0.5723
+-1.1202	0.6743
+-1.0502	0.7713
+-0.9801	0.8564
+-0.9101	0.9232
+-0.8401	0.9660
+-0.7700	0.9813
+-0.7000	0.9676
+-0.6300	0.9263
+-0.5599	0.8608
+-0.4899	0.7765
+-0.4199	0.6800
+-0.3498	0.5781
+-0.2798	0.4771
+-0.2098	0.3822
+-0.1397	0.2973
+-0.0697	0.2244
+0.0003	0.1645
+0.0704	0.1170
+0.1404	0.0808
+0.2104	0.0542
+0.2805	0.0353
+0.3505	0.0223
+0.4205	0.0137
+0.4906	0.0081
+0.5606	0.0047
+0.6306	0.0026
+0.7007	0.0014
+0.7707	0.0008
+0.8407	0.0004
+0.9108	0.0002
+0.9808	0.0001
+1.0508	0.0000
+1.1209	0.0000
+1.1909	0.0000
+1.2609	0.0000
+1.3310	0.0000
+1.4010	0.0000
+1.4710	0.0000
+1.5411	0.0000
+1.6111	0.0000
+1.6811	0.0000
+1.7512	0.0000
+1.8212	0.0000
+1.8912	0.0000
+1.9613	0.0000
+2.0313	0.0000
+2.1013	0.0000
+2.1714	0.0000
+2.2414	0.0000
+2.3114	0.0000
+2.3815	0.0000
+2.4515	0.0000
+2.5215	0.0000
+2.5916	0.0000
+2.6616	0.0000
+2.7316	0.0000
+2.8017	0.0000
+2.8717	0.0000
+2.9417	0.0000
+3.0118	0.0000
+3.0818	0.0000
+3.1518	0.0000
+3.2219	0.0000
+3.2919	0.0000
+3.3619	0.0000
+3.4320	0.0000
+3.5020	0.0000
+Gene2	1
+250	150
+1	2
+2	4	5
+-3.5862	0.0000
+-3.5124	0.0000
+-3.4385	0.0000
+-3.3647	0.0000
+-3.2909	0.0000
+-3.2171	0.0001
+-3.1432	0.0001
+-3.0694	0.0002
+-2.9956	0.0003
+-2.9218	0.0005
+-2.8479	0.0008
+-2.7741	0.0012
+-2.7003	0.0018
+-2.6264	0.0028
+-2.5526	0.0041
+-2.4788	0.0060
+-2.4050	0.0087
+-2.3311	0.0124
+-2.2573	0.0175
+-2.1835	0.0242
+-2.1097	0.0329
+-2.0358	0.0441
+-1.9620	0.0583
+-1.8882	0.0759
+-1.8143	0.0974
+-1.7405	0.1230
+-1.6667	0.1530
+-1.5929	0.1874
+-1.5190	0.2262
+-1.4452	0.2689
+-1.3714	0.3148
+-1.2976	0.3631
+-1.2237	0.4126
+-1.1499	0.4617
+-1.0761	0.5089
+-1.0022	0.5525
+-0.9284	0.5908
+-0.8546	0.6224
+-0.7808	0.6458
+-0.7069	0.6600
+-0.6331	0.6644
+-0.5593	0.6588
+-0.4855	0.6434
+-0.4116	0.6190
+-0.3378	0.5866
+-0.2640	0.5475
+-0.1901	0.5034
+-0.1163	0.4558
+-0.0425	0.4066
+0.0313	0.3573
+0.1052	0.3092
+0.1790	0.2636
+0.2528	0.2213
+0.3266	0.1830
+0.4005	0.1491
+0.4743	0.1197
+0.5481	0.0946
+0.6220	0.0736
+0.6958	0.0565
+0.7696	0.0426
+0.8434	0.0317
+0.9173	0.0233
+0.9911	0.0168
+1.0649	0.0119
+1.1387	0.0084
+1.2126	0.0058
+1.2864	0.0039
+1.3602	0.0026
+1.4341	0.0017
+1.5079	0.0011
+1.5817	0.0007
+1.6555	0.0005
+1.7294	0.0003
+1.8032	0.0002
+1.8770	0.0001
+1.9508	0.0001
+2.0247	0.0000
+2.0985	0.0000
+2.1723	0.0000
+2.2462	0.0000
+2.3200	0.0000
+2.3938	0.0000
+2.4676	0.0000
+2.5415	0.0000
+2.6153	0.0000
+2.6891	0.0000
+2.7629	0.0000
+2.8368	0.0000
+2.9106	0.0000
+2.9844	0.0000
+3.0583	0.0000
+3.1321	0.0000
+3.2059	0.0000
+3.2797	0.0000
+3.3536	0.0000
+3.4274	0.0000
+3.5012	0.0000
+3.5750	0.0000
+3.6489	0.0000
+3.7227	0.0000
+3.7965	0.0000
+Gene3	1
+250	150
+2	1	3
+1	5
+-4.3571	0.0002
+-4.2762	0.0002
+-4.1954	0.0003
+-4.1145	0.0004
+-4.0336	0.0005
+-3.9527	0.0007
+-3.8719	0.0010
+-3.7910	0.0013
+-3.7101	0.0017
+-3.6293	0.0022
+-3.5484	0.0028
+-3.4675	0.0036
+-3.3866	0.0046
+-3.3058	0.0059
+-3.2249	0.0074
+-3.1440	0.0093
+-3.0632	0.0115
+-2.9823	0.0143
+-2.9014	0.0175
+-2.8205	0.0214
+-2.7397	0.0260
+-2.6588	0.0313
+-2.5779	0.0374
+-2.4971	0.0445
+-2.4162	0.0526
+-2.3353	0.0617
+-2.2544	0.0719
+-2.1736	0.0833
+-2.0927	0.0958
+-2.0118	0.1095
+-1.9310	0.1243
+-1.8501	0.1403
+-1.7692	0.1572
+-1.6883	0.1750
+-1.6075	0.1936
+-1.5266	0.2127
+-1.4457	0.2322
+-1.3648	0.2518
+-1.2840	0.2713
+-1.2031	0.2904
+-1.1222	0.3088
+-1.0414	0.3263
+-0.9605	0.3424
+-0.8796	0.3570
+-0.7987	0.3698
+-0.7179	0.3806
+-0.6370	0.3890
+-0.5561	0.3951
+-0.4753	0.3987
+-0.3944	0.3996
+-0.3135	0.3980
+-0.2326	0.3937
+-0.1518	0.3869
+-0.0709	0.3778
+0.0100	0.3665
+0.0908	0.3532
+0.1717	0.3381
+0.2526	0.3216
+0.3335	0.3039
+0.4143	0.2852
+0.4952	0.2660
+0.5761	0.2464
+0.6569	0.2268
+0.7378	0.2074
+0.8187	0.1884
+0.8996	0.1700
+0.9804	0.1524
+1.0613	0.1358
+1.1422	0.1201
+1.2230	0.1056
+1.3039	0.0922
+1.3848	0.0800
+1.4657	0.0690
+1.5465	0.0591
+1.6274	0.0502
+1.7083	0.0425
+1.7891	0.0357
+1.8700	0.0297
+1.9509	0.0246
+2.0318	0.0203
+2.1126	0.0166
+2.1935	0.0135
+2.2744	0.0109
+2.3552	0.0087
+2.4361	0.0070
+2.5170	0.0055
+2.5979	0.0043
+2.6787	0.0034
+2.7596	0.0026
+2.8405	0.0020
+2.9213	0.0015
+3.0022	0.0012
+3.0831	0.0009
+3.1640	0.0007
+3.2448	0.0005
+3.3257	0.0004
+3.4066	0.0003
+3.4874	0.0002
+3.5683	0.0001
+3.6492	0.0001
+3.7301	0.0001
+Phenotype	1
+250	150
+2	3	4
+0
+-3.5574	0.0004
+-3.4806	0.0006
+-3.4037	0.0008
+-3.3268	0.0012
+-3.2499	0.0016
+-3.1731	0.0022
+-3.0962	0.0030
+-3.0193	0.0040
+-2.9425	0.0054
+-2.8656	0.0071
+-2.7887	0.0093
+-2.7118	0.0121
+-2.6350	0.0155
+-2.5581	0.0198
+-2.4812	0.0250
+-2.4044	0.0313
+-2.3275	0.0389
+-2.2506	0.0479
+-2.1737	0.0584
+-2.0969	0.0706
+-2.0200	0.0846
+-1.9431	0.1005
+-1.8663	0.1184
+-1.7894	0.1381
+-1.7125	0.1597
+-1.6356	0.1831
+-1.5588	0.2081
+-1.4819	0.2343
+-1.4050	0.2615
+-1.3282	0.2893
+-1.2513	0.3173
+-1.1744	0.3448
+-1.0975	0.3714
+-1.0207	0.3966
+-0.9438	0.4197
+-0.8669	0.4402
+-0.7901	0.4576
+-0.7132	0.4716
+-0.6363	0.4816
+-0.5594	0.4875
+-0.4826	0.4891
+-0.4057	0.4864
+-0.3288	0.4794
+-0.2520	0.4684
+-0.1751	0.4535
+-0.0982	0.4353
+-0.0213	0.4140
+0.0555	0.3904
+0.1324	0.3648
+0.2093	0.3379
+0.2861	0.3102
+0.3630	0.2822
+0.4399	0.2545
+0.5168	0.2275
+0.5936	0.2016
+0.6705	0.1770
+0.7474	0.1541
+0.8242	0.1329
+0.9011	0.1136
+0.9780	0.0963
+1.0549	0.0809
+1.1317	0.0673
+1.2086	0.0556
+1.2855	0.0455
+1.3623	0.0368
+1.4392	0.0296
+1.5161	0.0236
+1.5930	0.0186
+1.6698	0.0146
+1.7467	0.0113
+1.8236	0.0087
+1.9004	0.0066
+1.9773	0.0050
+2.0542	0.0037
+2.1311	0.0028
+2.2079	0.0020
+2.2848	0.0015
+2.3617	0.0011
+2.4385	0.0008
+2.5154	0.0005
+2.5923	0.0004
+2.6692	0.0003
+2.7460	0.0002
+2.8229	0.0001
+2.8998	0.0001
+2.9766	0.0001
+3.0535	0.0000
+3.1304	0.0000
+3.2073	0.0000
+3.2841	0.0000
+3.3610	0.0000
+3.4379	0.0000
+3.5147	0.0000
+3.5916	0.0000
+3.6685	0.0000
+3.7454	0.0000
+3.8222	0.0000
+3.8991	0.0000
+3.9760	0.0000
+4.0528	0.0000
+4.1297	0.0000
diff --git a/sourcecodes/data/example_sci_bk/Llunlevels.txt b/sourcecodes/data/example_sci_bk/Llunlevels.txt
new file mode 100644
index 00000000..714e56bd
--- /dev/null
+++ b/sourcecodes/data/example_sci_bk/Llunlevels.txt
@@ -0,0 +1,2 @@
+Genotype	1	2
+
diff --git a/sourcecodes/data/example_sci_bk/Llunnode.txt b/sourcecodes/data/example_sci_bk/Llunnode.txt
new file mode 100644
index 00000000..7ed6ff82
--- /dev/null
+++ b/sourcecodes/data/example_sci_bk/Llunnode.txt
@@ -0,0 +1 @@
+5
diff --git a/sourcecodes/data/example_sci_bk/Llunrows.txt b/sourcecodes/data/example_sci_bk/Llunrows.txt
new file mode 100644
index 00000000..c15fb720
--- /dev/null
+++ b/sourcecodes/data/example_sci_bk/Llunrows.txt
@@ -0,0 +1 @@
+501
diff --git a/sourcecodes/data/example_sci_bk/Lluparent.txt b/sourcecodes/data/example_sci_bk/Lluparent.txt
new file mode 100644
index 00000000..b8626c4c
--- /dev/null
+++ b/sourcecodes/data/example_sci_bk/Lluparent.txt
@@ -0,0 +1 @@
+4
diff --git a/sourcecodes/data/example_sci_bk/Llurun_evidencemodified.sh b/sourcecodes/data/example_sci_bk/Llurun_evidencemodified.sh
new file mode 100644
index 00000000..ee0dde13
--- /dev/null
+++ b/sourcecodes/data/example_sci_bk/Llurun_evidencemodified.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+# script for execution of deployed applications
+#
+# Sets up the MCR environment for the current $ARCH and executes 
+# the specified command.
+#
+exe_name=$0
+exe_dir=`dirname "$0"`
+echo "------------------------------------------"
+if [ "x$1" = "x" ]; then
+  echo Usage:
+  echo    $0 \<deployedMCRroot\> args
+else
+  echo Setting up environment variables
+  MCRROOT="$1"
+  echo ---
+  LD_LIBRARY_PATH=.:${MCRROOT}/runtime/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/bin/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/sys/os/glnxa64;
+	MCRJRE=${MCRROOT}/sys/java/jre/glnxa64/jre/lib/amd64 ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/native_threads ; 
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/server ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/client ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE} ;  
+  XAPPLRESDIR=${MCRROOT}/X11/app-defaults ;
+  export LD_LIBRARY_PATH;
+  export XAPPLRESDIR;
+  echo LD_LIBRARY_PATH is ${LD_LIBRARY_PATH};
+  shift 1
+  args=
+  while [ $# -gt 0 ]; do
+      token=`echo "$1" | sed 's/ /\\\\ /g'`   # Add blackslash before each blank
+      args="${args} ${token}" 
+      shift
+  done
+  "${exe_dir}"/evidencemodified Llu
+fi
+exit
diff --git a/sourcecodes/data/example_sci_bk/Llurun_initialstructure.sh b/sourcecodes/data/example_sci_bk/Llurun_initialstructure.sh
new file mode 100644
index 00000000..adde14dd
--- /dev/null
+++ b/sourcecodes/data/example_sci_bk/Llurun_initialstructure.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+# script for execution of deployed applications
+#
+# Sets up the MCR environment for the current $ARCH and executes 
+# the specified command.
+#
+exe_name=$0
+exe_dir=`dirname "$0"`
+echo "------------------------------------------"
+if [ "x$1" = "x" ]; then
+  echo Usage:
+  echo    $0 \<deployedMCRroot\> args
+else
+  echo Setting up environment variables
+  MCRROOT="$1"
+  echo ---
+  LD_LIBRARY_PATH=.:${MCRROOT}/runtime/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/bin/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/sys/os/glnxa64;
+	MCRJRE=${MCRROOT}/sys/java/jre/glnxa64/jre/lib/amd64 ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/native_threads ; 
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/server ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/client ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE} ;  
+  XAPPLRESDIR=${MCRROOT}/X11/app-defaults ;
+  export LD_LIBRARY_PATH;
+  export XAPPLRESDIR;
+  echo LD_LIBRARY_PATH is ${LD_LIBRARY_PATH};
+  shift 1
+  args=
+  while [ $# -gt 0 ]; do
+      token=`echo "$1" | sed 's/ /\\\\ /g'`   # Add blackslash before each blank
+      args="${args} ${token}" 
+      shift
+  done
+  "${exe_dir}"/initialstructure Llu
+fi
+exit
diff --git a/sourcecodes/data/example_sci_bk/Llustructure_input.txt b/sourcecodes/data/example_sci_bk/Llustructure_input.txt
new file mode 100644
index 00000000..bcf72d97
--- /dev/null
+++ b/sourcecodes/data/example_sci_bk/Llustructure_input.txt
@@ -0,0 +1,6 @@
+Genotype	Gene3	Gene2	Phenotype	Gene1	
+0	1	0	0	1	
+0	0	0	1	0	
+0	1	0	1	0	
+0	0	0	0	0	
+0	0	1	0	0	
diff --git a/sourcecodes/data/example_sci_bk/Llustructure_input_temp.txt b/sourcecodes/data/example_sci_bk/Llustructure_input_temp.txt
new file mode 100644
index 00000000..95aa7a5d
--- /dev/null
+++ b/sourcecodes/data/example_sci_bk/Llustructure_input_temp.txt
@@ -0,0 +1,6 @@
+Genotype	Gene3	Gene2	Phenotype	Gene1	
+0.000000	0.999929	0.183248	0.000431	1.000000	
+0.000000	0.000000	0.000000	1.000000	0.000000	
+0.000000	0.935752	0.000000	1.000000	0.000000	
+0.000000	0.000000	0.000000	0.000000	0.000000	
+0.000000	0.053385	0.881001	0.156255	0.000000	
diff --git a/sourcecodes/data/example_sci_bk/Llustructure_old.txt b/sourcecodes/data/example_sci_bk/Llustructure_old.txt
new file mode 100644
index 00000000..5b464577
--- /dev/null
+++ b/sourcecodes/data/example_sci_bk/Llustructure_old.txt
@@ -0,0 +1,5 @@
+Genotype	0.4860	0.5140
+Gene3	0.0001	0.0001	0.0001	0.0001	0.0002	0.0002	0.0003	0.0004	0.0006	0.0008	0.0010	0.0013	0.0018	0.0023	0.0029	0.0037	0.0047	0.0059	0.0074	0.0092	0.0113	0.0139	0.0170	0.0206	0.0248	0.0297	0.0354	0.0419	0.0493	0.0576	0.0669	0.0773	0.0887	0.1012	0.1147	0.1292	0.1447	0.1610	0.1781	0.1958	0.2139	0.2323	0.2507	0.2688	0.2866	0.3036	0.3197	0.3345	0.3479	0.3597	0.3695	0.3773	0.3828	0.3861	0.3870	0.3855	0.3817	0.3756	0.3673	0.3570	0.3449	0.3311	0.3160	0.2996	0.2824	0.2645	0.2463	0.2279	0.2095	0.1915	0.1740	0.1570	0.1409	0.1256	0.1114	0.0981	0.0859	0.0747	0.0646	0.0555	0.0474	0.0402	0.0340	0.0285	0.0237	0.0197	0.0162	0.0132	0.0108	0.0087	0.0070	0.0056	0.0044	0.0035	0.0027	0.0021	0.0016	0.0013	0.0010	0.0007	0.0006
+Gene1	0.0009	0.0012	0.0015	0.0019	0.0024	0.0030	0.0037	0.0046	0.0056	0.0069	0.0083	0.0101	0.0121	0.0145	0.0174	0.0206	0.0243	0.0286	0.0335	0.0389	0.0451	0.0520	0.0597	0.0682	0.0775	0.0876	0.0986	0.1105	0.1231	0.1366	0.1508	0.1657	0.1811	0.1971	0.2134	0.2300	0.2467	0.2633	0.2797	0.2956	0.3110	0.3256	0.3392	0.3517	0.3629	0.3726	0.3808	0.3873	0.3920	0.3948	0.3958	0.3948	0.3920	0.3872	0.3807	0.3726	0.3628	0.3516	0.3391	0.3254	0.3108	0.2955	0.2795	0.2631	0.2465	0.2299	0.2133	0.1969	0.1810	0.1655	0.1507	0.1365	0.1230	0.1103	0.0985	0.0875	0.0774	0.0681	0.0596	0.0520	0.0451	0.0389	0.0334	0.0286	0.0243	0.0206	0.0173	0.0145	0.0121	0.0101	0.0083	0.0068	0.0056	0.0046	0.0037	0.0030	0.0024	0.0019	0.0015	0.0012	0.0009
+Phenotype	0.0010	0.0013	0.0016	0.0021	0.0026	0.0033	0.0042	0.0052	0.0065	0.0080	0.0098	0.0120	0.0146	0.0176	0.0212	0.0253	0.0300	0.0354	0.0416	0.0486	0.0564	0.0651	0.0748	0.0854	0.0970	0.1096	0.1230	0.1374	0.1526	0.1685	0.1850	0.2021	0.2195	0.2370	0.2545	0.2718	0.2887	0.3049	0.3202	0.3344	0.3473	0.3587	0.3684	0.3763	0.3822	0.3860	0.3877	0.3872	0.3846	0.3798	0.3731	0.3644	0.3539	0.3418	0.3283	0.3136	0.2979	0.2813	0.2643	0.2468	0.2293	0.2118	0.1945	0.1777	0.1614	0.1458	0.1310	0.1170	0.1039	0.0918	0.0806	0.0704	0.0612	0.0529	0.0454	0.0388	0.0329	0.0278	0.0234	0.0195	0.0162	0.0134	0.0110	0.0090	0.0073	0.0059	0.0047	0.0038	0.0030	0.0024	0.0019	0.0015	0.0011	0.0009	0.0007	0.0005	0.0004	0.0003	0.0002	0.0002	0.0001
+Gene2	0.0008	0.0010	0.0013	0.0016	0.0020	0.0026	0.0032	0.0041	0.0050	0.0062	0.0077	0.0094	0.0114	0.0138	0.0166	0.0199	0.0237	0.0281	0.0331	0.0388	0.0453	0.0526	0.0607	0.0696	0.0795	0.0903	0.1021	0.1147	0.1282	0.1426	0.1578	0.1736	0.1900	0.2069	0.2241	0.2414	0.2587	0.2758	0.2924	0.3084	0.3236	0.3377	0.3506	0.3621	0.3719	0.3800	0.3863	0.3905	0.3927	0.3929	0.3910	0.3870	0.3811	0.3732	0.3636	0.3524	0.3397	0.3258	0.3108	0.2949	0.2783	0.2613	0.2440	0.2267	0.2095	0.1925	0.1760	0.1601	0.1449	0.1304	0.1167	0.1039	0.0920	0.0811	0.0711	0.0620	0.0537	0.0464	0.0398	0.0340	0.0288	0.0243	0.0205	0.0171	0.0142	0.0117	0.0097	0.0079	0.0064	0.0052	0.0042	0.0034	0.0027	0.0021	0.0017	0.0013	0.0010	0.0008	0.0006	0.0005	0.0004
diff --git a/sourcecodes/data/example_sci_bk/Lluthr.txt b/sourcecodes/data/example_sci_bk/Lluthr.txt
new file mode 100644
index 00000000..2eb3c4fe
--- /dev/null
+++ b/sourcecodes/data/example_sci_bk/Lluthr.txt
@@ -0,0 +1 @@
+0.5
diff --git a/sourcecodes/data/example_sci_bk/Llutier.txt b/sourcecodes/data/example_sci_bk/Llutier.txt
new file mode 100644
index 00000000..da7084fb
--- /dev/null
+++ b/sourcecodes/data/example_sci_bk/Llutier.txt
@@ -0,0 +1 @@
+3,Tier1,1,Genotype,Tier2,3,Gene1,Gene2,Gene3,Tier3,1,Phenotype,
\ No newline at end of file
diff --git a/sourcecodes/data/example_sci_bk/Llutype.txt b/sourcecodes/data/example_sci_bk/Llutype.txt
new file mode 100644
index 00000000..9ea66ce4
--- /dev/null
+++ b/sourcecodes/data/example_sci_bk/Llutype.txt
@@ -0,0 +1,2 @@
+Genotype	Gene3	Gene2	Phenotype	Gene1
+2	1	1	1	1	
diff --git a/sourcecodes/data/example_sci_bk/Lluvar.txt b/sourcecodes/data/example_sci_bk/Lluvar.txt
new file mode 100644
index 00000000..56a6051c
--- /dev/null
+++ b/sourcecodes/data/example_sci_bk/Lluvar.txt
@@ -0,0 +1 @@
+1
\ No newline at end of file
diff --git a/sourcecodes/data/example_sci_bk/Lluvardata.txt b/sourcecodes/data/example_sci_bk/Lluvardata.txt
new file mode 100644
index 00000000..56a6051c
--- /dev/null
+++ b/sourcecodes/data/example_sci_bk/Lluvardata.txt
@@ -0,0 +1 @@
+1
\ No newline at end of file
diff --git a/sourcecodes/data/example_sci_bk/Lluvarname.txt b/sourcecodes/data/example_sci_bk/Lluvarname.txt
new file mode 100644
index 00000000..3fe283bd
--- /dev/null
+++ b/sourcecodes/data/example_sci_bk/Lluvarname.txt
@@ -0,0 +1 @@
+Genotype
\ No newline at end of file
diff --git a/sourcecodes/data/example_sci_bk/Lluwhite.txt b/sourcecodes/data/example_sci_bk/Lluwhite.txt
new file mode 100644
index 00000000..83e81b8b
--- /dev/null
+++ b/sourcecodes/data/example_sci_bk/Lluwhite.txt
@@ -0,0 +1 @@
+From	To
diff --git a/sourcecodes/data/example_time_series/TEbban.txt b/sourcecodes/data/example_time_series/TEbban.txt
new file mode 100644
index 00000000..7b0aa551
--- /dev/null
+++ b/sourcecodes/data/example_time_series/TEbban.txt
@@ -0,0 +1,73 @@
+From	To
+TraitA_T1	Genotype
+TraitB_T1	Genotype
+TraitC_T1	Genotype
+TraitA_T2	Genotype
+TraitB_T2	Genotype
+TraitC_T2	Genotype
+TraitA_T3	Genotype
+TraitB_T3	Genotype
+TraitC_T3	Genotype
+TraitA_T1	Genotype
+TraitB_T1	Genotype
+TraitC_T1	Genotype
+TraitA_T2	TraitA_T1
+TraitA_T2	TraitB_T1
+TraitA_T2	TraitC_T1
+TraitB_T2	TraitA_T1
+TraitB_T2	TraitB_T1
+TraitB_T2	TraitC_T1
+TraitC_T2	TraitA_T1
+TraitC_T2	TraitB_T1
+TraitC_T2	TraitC_T1
+TraitA_T3	TraitA_T1
+TraitA_T3	TraitB_T1
+TraitA_T3	TraitC_T1
+TraitB_T3	TraitA_T1
+TraitB_T3	TraitB_T1
+TraitB_T3	TraitC_T1
+TraitC_T3	TraitA_T1
+TraitC_T3	TraitB_T1
+TraitC_T3	TraitC_T1
+TraitA_T2	Genotype
+TraitB_T2	Genotype
+TraitC_T2	Genotype
+TraitA_T2	TraitA_T1
+TraitA_T2	TraitB_T1
+TraitA_T2	TraitC_T1
+TraitB_T2	TraitA_T1
+TraitB_T2	TraitB_T1
+TraitB_T2	TraitC_T1
+TraitC_T2	TraitA_T1
+TraitC_T2	TraitB_T1
+TraitC_T2	TraitC_T1
+TraitA_T3	TraitA_T2
+TraitA_T3	TraitB_T2
+TraitA_T3	TraitC_T2
+TraitB_T3	TraitA_T2
+TraitB_T3	TraitB_T2
+TraitB_T3	TraitC_T2
+TraitC_T3	TraitA_T2
+TraitC_T3	TraitB_T2
+TraitC_T3	TraitC_T2
+TraitA_T3	Genotype
+TraitB_T3	Genotype
+TraitC_T3	Genotype
+TraitA_T3	TraitA_T1
+TraitA_T3	TraitB_T1
+TraitA_T3	TraitC_T1
+TraitB_T3	TraitA_T1
+TraitB_T3	TraitB_T1
+TraitB_T3	TraitC_T1
+TraitC_T3	TraitA_T1
+TraitC_T3	TraitB_T1
+TraitC_T3	TraitC_T1
+TraitA_T3	TraitA_T2
+TraitA_T3	TraitB_T2
+TraitA_T3	TraitC_T2
+TraitB_T3	TraitA_T2
+TraitB_T3	TraitB_T2
+TraitB_T3	TraitC_T2
+TraitC_T3	TraitA_T2
+TraitC_T3	TraitB_T2
+TraitC_T3	TraitC_T2
diff --git a/sourcecodes/data/example_time_series/TEbcontinuous_input.txt b/sourcecodes/data/example_time_series/TEbcontinuous_input.txt
new file mode 100644
index 00000000..34b3b957
--- /dev/null
+++ b/sourcecodes/data/example_time_series/TEbcontinuous_input.txt
@@ -0,0 +1,503 @@
+Genotype	TraitA_T1	TraitA_T2	TraitA_T3	TraitB_T1	TraitB_T2	TraitB_T3	TraitC_T1	TraitC_T2	TraitC_T3
+2	1	1	1	1	1	1	1	1	1
+1	1.4297	-0.13715	-0.33041	1.3972	-0.17802	1.0272	-1.322	0.0027715	0.85527
+1	2.0687	-2.5819	-0.71386	-0.25338	0.64604	-0.25402	-1.1947	0.60348	1.5977
+2	0.52771	0.19656	0.40967	0.039336	1.57	-0.036341	-1.6301	-0.15434	0.93397
+1	1.7929	-0.85399	-0.21102	0.36528	0.14997	-0.072283	0.25214	1.8044	1.4149
+1	-0.090929	-0.17288	-2.808	0.79192	-1.5175	-0.90041	0.39689	-0.18146	-0.55432
+1	0.86086	-0.049472	-0.82074	0.18954	0.51157	0.30995	-0.50952	-0.047852	0.25632
+1	0.37794	-0.49737	-1.5634	-0.61123	-1.6172	-0.025387	-0.50463	1.0061	-0.55909
+1	0.061886	-1.3173	-0.38674	0.66584	0.023432	-1.0821	0.14268	-0.21189	-0.60498
+1	0.96427	-1.6652	-0.61177	-0.295	0.12641	-1.6644	-1.0372	0.033566	1.3366
+2	0.16295	0.59047	0.7747	-0.32623	1.6996	-0.042892	-0.0034198	-0.30944	0.67765
+1	1.7419	-0.94567	-1.8121	0.80385	0.23144	-1.4004	2.0605	-0.83835	1.3823
+2	-0.92772	0.34934	0.87438	-0.62792	0.7641	-0.5865	0.24522	0.6353	-0.0017539
+2	-2.9367	1.609	2.0928	0.61651	-2.0775	-0.24164	-0.3587	-0.95545	-3.0393
+1	0.52613	0.43773	0.75866	0.73066	0.46388	-1.4681	-1.5908	1.6872	0.89314
+2	-0.10721	1.7759	1.6821	-0.56868	1.6447	-0.92002	-0.27447	-0.62549	0.91373
+1	-1.073	-1.8228	-0.34751	-0.54007	-1.7593	-0.7431	0.61821	-0.054988	-1.7414
+2	-1.0532	1.0319	1.0531	-0.09473	-0.82174	0.45084	-0.38299	-0.6361	-0.90619
+1	1.7064	-1.8984	-2.6061	0.99661	-0.67065	0.17936	0.97103	0.38751	-0.11531
+2	-3.2527	-1.1361	0.56795	-0.39584	-1.5189	-1.7637	1.2149	-1.3971	-1.8622
+1	2.3471	-2.1036	-2.092	1.544	-0.21178	0.3446	1.0474	-0.64427	0.73628
+2	-0.63792	1.3156	0.92169	-0.67815	1.4089	1.1938	0.82905	0.16566	0.09164
+2	-2.0379	0.74861	0.16368	0.58693	-0.67589	0.81824	0.33633	-0.19727	-1.243
+2	-1.7441	2.4915	0.89809	-1.0265	0.35767	-1.159	0.63023	0.97341	0.29971
+2	-1.9637	0.94259	1.169	1.9451	-0.96485	0.49152	-1.1393	-1.2415	-0.58885
+2	-1.0536	2.4253	0.94996	-2.3874	0.23825	0.224	-0.073329	-1.2231	-0.24801
+1	-0.032849	-1.1426	-1.1507	-0.10711	-1.6383	-0.80394	1.5126	0.28303	0.083105
+2	-2.2192	0.84322	0.73021	0.71513	-0.79164	0.61126	-1.2986	0.89057	-1.4685
+1	0.42429	-0.65294	-1.9493	-0.77983	-1.2761	0.99263	0.051924	0.83436	-0.0079187
+2	-0.85155	0.9691	1.1731	1.0504	0.39302	0.030178	-0.70262	-0.014959	-0.31945
+1	-1.4662	-0.5934	-2.0914	-0.76279	-1.7903	0.94245	0.96374	-1.6733	-1.8091
+1	2.0716	-0.52844	-0.183	-0.032514	1.4843	0.28402	0.37221	-1.4476	2.8712
+2	-1.0437	1.5094	-0.23396	-0.84804	0.43785	0.19966	0.3728	0.15043	0.10549
+1	1.0647	-0.35638	-1.0854	0.78756	-0.99107	0.098816	-0.32975	-0.68451	0.71344
+1	0.58146	-0.46614	-2.9113	-0.032848	0.052376	-0.36411	0.87461	0.28033	-0.61848
+2	-0.6251	1.3257	0.36072	-0.042944	0.66071	-0.33981	2.0873	1.2161	0.089706
+1	1.57	-1.26	-2.0278	1.5331	-1.5343	0.019093	-0.73556	1.0316	0.41452
+2	-1.6998	1.0471	-0.0095397	-0.72037	0.30428	0.18062	0.86143	-0.31801	-0.86127
+2	-1.0544	1.9761	1.1994	1.7876	-0.24561	0.01978	1.4123	0.19675	-0.022687
+2	0.38235	2.3798	0.42045	0.97856	1.7099	0.20914	1.0505	1.9808	1.482
+1	1.8991	-2.1024	-0.53897	0.20839	1.3568	-1.4725	0.16263	0.069291	1.5719
+2	-2.2901	1.333	1.1433	-0.53918	-0.41394	-1.0484	-1.2332	0.068735	-2.0475
+1	1.9123	0.027091	-0.067604	-0.86429	-0.73426	0.65875	-0.59697	1.1903	-0.068242
+2	-1.8834	1.7232	1.3404	-0.096031	-0.1779	1.2453	0.23601	-0.81722	-0.8237
+1	-0.33029	-1.4141	-0.24236	0.3117	-0.28893	-1.536	0.63391	0.97915	-0.30591
+2	-1.0004	-0.17153	0.80903	-1.3152	-0.28004	-2.5356	0.25062	-1.6221	-0.2114
+2	0.92525	0.78374	0.44585	0.87215	0.67229	1.6991	-0.45347	0.21751	0.95898
+1	0.47842	-0.79727	0.0099566	0.8919	0.31135	-0.62503	-0.99073	1.5268	0.43918
+1	-0.52618	-0.57407	-1.5704	-1.9977	-1.8715	0.99632	1.124	2.1038	-1.3776
+2	-0.8334	1.5897	0.82506	-0.045645	0.23407	-1.1836	-0.86756	0.52102	0.23901
+1	1.0179	-0.6531	-0.53277	0.32403	1.226	-0.27361	-1.5967	-0.20229	1.5482
+2	-0.82762	0.26361	2.4807	-0.49628	-0.44792	1.295	-1.0416	0.29424	-1.0789
+1	1.569	0.14532	-1.3216	-1.1622	-0.46791	0.10723	-0.74658	1.7246	0.087136
+1	0.93783	-1.0786	-1.6758	-2.3367	-1.4745	-0.78743	0.85399	0.0085691	0.79439
+2	-2.9555	1.122	1.8506	0.65602	-0.66402	0.25697	0.75048	0.21667	-2.1374
+2	-1.5843	0.24076	0.71071	-0.16959	-1.0254	0.44363	1.1218	1.0872	-1.2214
+2	0.82202	1.2273	-0.2641	1.1674	0.72576	-0.6655	-0.33565	-0.57264	1.0462
+1	0.83408	-0.90235	-0.3935	0.086621	1.5353	-0.37978	-0.040736	0.54884	1.0078
+2	-0.30426	0.26772	1.1941	0.52251	1.9104	-0.10785	0.40619	1.0277	1.0258
+1	0.81767	-2.1549	-1.0066	-1.1068	-0.3204	0.70458	-1.0728	0.7519	0.49365
+1	0.67964	-1.4603	-1.4347	0.76332	-0.97228	-0.9221	1.0028	0.98058	-0.18843
+1	1.3794	1.3504	-0.081978	0.31556	0.32948	-2.6404	-1.0646	-1.2234	0.23259
+2	0.11139	1.1587	0.66712	-0.46969	0.42	0.31504	0.4697	2.6848	0.14172
+2	0.28767	-0.065134	1.3282	0.43016	1.4838	-0.63014	0.62746	0.93536	1.6029
+1	2.4805	-0.73041	-2.1434	-0.61007	0.89886	-0.34815	0.53564	-0.83092	1.359
+2	-1.7925	1.8972	1.3604	-1.0549	-1.2652	1.3518	-0.049884	-1.2196	-0.88755
+2	0.47058	1.4302	-0.034783	-0.11473	1.0041	1.0036	-0.46028	1.0611	1.2613
+1	2.6579	-0.31683	-1.1155	-0.65359	0.96673	0.64757	1.2194	-0.90696	1.8217
+2	-0.29097	0.91367	1.5236	-1.0735	0.71821	-2.1156	0.11456	-0.37247	0.64467
+1	0.68355	0.40105	-1.7852	1.3169	0.6179	-1.3712	0.05004	-0.65314	1.1103
+2	-1.8738	2.4006	1.8782	-2.1995	0.49239	-0.6918	-0.70293	-0.74597	-0.3239
+2	-0.36364	1.0943	0.62818	0.1429	0.85651	-0.96809	0.12213	-0.94343	0.42158
+1	0.40116	-1.4861	-0.049336	0.72652	0.1255	-1.1187	-0.38912	0.060771	-0.29816
+1	1.1364	-0.828	-0.44475	0.81314	-0.45463	0.73019	-0.57071	0.32484	0.046647
+1	0.91034	-0.95145	0.43201	0.76891	-1.5873	-0.38206	0.28662	0.23105	0.11712
+2	-0.27208	2.2223	1.2591	0.70003	0.89367	1.0322	0.41848	0.96986	0.17078
+1	1.0624	0.048938	-1.002	-1.0531	-0.28385	0.30108	0.62074	0.39829	0.27699
+1	0.57701	0.094694	-1.3989	0.15018	-0.44071	0.74259	-1.2663	0.33047	-0.45917
+2	0.11706	2.795	0.35611	-0.68956	2.1138	0.36961	-1.3806	-1.1414	1.9844
+2	-1.2526	0.11214	0.40367	0.83874	0.37692	1.4445	-0.77317	-0.40136	-0.42244
+2	-1.4336	-0.32339	1.3392	0.7596	0.0091892	1.0806	-0.81666	-0.39415	-1.9858
+2	0.5554	1.0643	0.50191	0.37325	2.0674	0.38376	-0.13487	-0.37455	0.64987
+1	1.6028	1.107	-0.9114	0.97541	0.88036	1.66	1.4044	-0.46919	0.80681
+1	1.6228	-1.3906	-1.8136	0.56649	-0.87823	-1.8194	0.30195	1.2461	-0.07587
+2	-0.97076	1.5212	1.1269	0.4029	0.19516	-1.5031	0.85567	0.18958	-0.20832
+1	1.3197	-1.8366	-0.24704	0.34608	-0.77044	1.1945	1.6826	0.91217	0.30079
+2	-0.38255	-0.2812	0.27203	-1.2858	0.86735	-0.54848	-1.3505	0.57415	0.12916
+2	-2.878	1.5199	0.74535	-1.4308	-2.2635	-1.4245	0.89574	0.037623	-2.7177
+2	-1.7715	0.74699	0.96279	-1.306	-0.36677	-0.36708	1.4602	-0.85456	-0.40898
+2	-1.3391	1.2012	0.7409	-1.3102	0.40133	-0.076096	0.51637	0.33495	0.25003
+1	0.65017	-0.57483	-1.7053	0.21131	-0.38338	1.6998	-0.70762	1.5248	0.1473
+1	-0.14679	-1.5979	-1.2765	1.041	-0.00072624	-0.19359	0.17338	-0.96136	0.51031
+1	1.8145	-1.0318	-1.0633	-0.098291	1.1755	-0.57137	1.7174	-0.14248	1.4282
+1	0.80523	-0.96777	-1.8989	0.063236	-1.2783	0.72214	-0.99392	-0.017507	-0.52743
+1	1.479	-1.2772	-1.1642	0.13841	0.83641	0.12311	1.2557	-0.37799	1.6174
+2	-1.423	-0.24793	0.49465	1.1461	-1.0896	-0.16348	-0.76872	-0.40631	-1.8538
+1	1.5733	-0.26875	0.42772	-0.75241	-0.0059677	0.65109	0.67958	0.47183	-0.10405
+1	1.7405	-1.3987	-0.91804	0.30851	-0.37195	-0.30858	-1.2002	0.51775	0.60525
+1	1.0571	1.4951	-2.5784	0.023453	0.064363	0.2392	0.93292	-0.37825	0.58165
+2	-0.35492	0.69359	1.5161	0.58499	-0.44209	-0.09004	-0.70298	-1.1197	-0.12251
+1	0.61469	-1.1159	0.11919	0.1796	-0.94894	0.012732	-0.69651	0.21311	-0.52283
+1	-1.2282	-0.050497	-0.83443	-0.28534	-2.0051	-1.3528	0.096769	-0.67245	-1.2668
+1	1.0411	-0.016327	-1.927	-0.10683	-0.70277	-1.4696	-0.021181	-0.34105	0.46198
+2	0.64635	0.84883	1.6319	0.2406	1.8836	0.31359	-0.69264	0.96691	1.3021
+2	-0.3604	0.050276	0.95661	0.18902	1.5034	1.3017	-0.045011	-0.92727	0.70494
+2	0.60646	1.598	1.395	-1.3791	1.8106	0.097276	0.74515	-0.4425	0.62478
+2	-0.099653	-0.54799	-0.1078	-0.18908	1.4643	-0.49221	0.050585	-1.2949	1.4842
+2	-0.98803	0.016928	1.2978	-0.29336	-0.2433	-0.90577	-0.18704	-0.22856	-0.39148
+2	-1.2267	0.82318	0.77338	0.0029744	0.15114	1.4265	1.6722	-0.18878	0.083877
+2	0.32455	0.48697	0.87077	-1.2598	0.89457	-0.2656	-0.4774	-0.22382	0.86019
+2	-1.6768	0.28366	1.7541	1.4309	-1.0277	-0.49835	-0.31204	-0.04057	-2.2507
+2	-0.83915	0.98617	0.024566	0.14541	0.40801	-0.010211	1.7726	-1.3709	0.30366
+2	-0.12663	0.15335	0.70774	2.1504	1.6066	-0.39836	1.078	-0.017324	0.94477
+1	1.1185	-0.39853	-0.011251	-0.0047654	-0.018256	-0.97102	1.8801	0.5724	0.70777
+2	-0.96731	-0.023776	1.2924	-0.94814	1.0413	0.3092	-0.06342	-0.032081	-0.22356
+1	1.1481	-1.0434	-2.2223	-1.2686	0.27026	-0.40422	-0.34583	2.2763	-0.16972
+2	-0.73981	1.2266	0.71139	-1.5638	0.084373	0.09421	-0.94629	-0.73173	-0.13897
+1	0.10133	0.032746	-1.5397	-1.7164	-0.96537	0.18106	0.47324	-0.32186	-0.44953
+1	2.3032	0.37332	-1.7518	-0.97719	0.21786	-0.29424	-1.6122	-0.3313	0.34243
+2	0.30487	0.96988	0.7649	1.2021	0.93113	-0.55965	-1.8153	-0.34231	1.0416
+1	0.9734	-1.1492	0.54826	0.24535	-1.1123	-0.013547	-0.72623	0.9444	-0.19613
+1	1.3053	-1.4227	-2.1548	-0.99601	0.99751	0.37094	-0.24703	-0.92319	0.81674
+2	-0.0084211	1.8266	0.94339	-0.96922	2.2496	0.14622	2.3348	-0.34993	1.4151
+1	0.64848	-1.4999	-0.79935	-0.18624	-2.4443	0.91037	-0.16866	-0.15122	-1.2117
+1	0.99806	-1.9897	-0.90507	0.86062	-0.34118	-0.4535	-0.54746	1.5108	0.91863
+1	-0.30169	-1.2768	-1.1305	-0.01759	0.06726	-0.39978	0.52015	0.96655	0.12442
+1	0.76671	-0.91781	-2.0919	0.37685	-0.19301	0.73072	1.2156	1.439	0.0070513
+2	0.66141	0.90111	1.0491	-0.66199	1.9568	-1.2392	0.18616	1.0926	1.652
+1	2.2346	0.19579	-0.82941	0.65367	0.48104	-0.33862	0.11669	0.66087	1.1783
+2	-1.3061	1.9587	1.3667	1.1907	-0.51821	-0.2974	-1.0178	0.34352	-0.018939
+2	-2.4636	0.65586	1.618	-0.50642	-0.63857	-0.65954	-0.9133	0.027975	-1.4977
+1	0.89124	-0.8583	0.34126	-0.30785	0.91808	-2.22	1.2944	-0.27909	1.487
+1	1.9669	-0.26343	-2.0878	-0.29226	1.7407	0.64013	0.32367	0.44562	1.1292
+2	-1.6773	1.1266	1.5663	0.16226	-0.34514	0.84293	-0.44423	1.0172	-0.78509
+2	-0.7714	0.64263	0.67055	-0.12578	0.030391	0.57791	-0.87634	0.28154	-0.261
+2	-1.0233	1.1382	0.044689	-1.1241	0.94709	-0.58888	-0.6081	-1.1033	0.0014883
+1	-0.89032	0.083064	-0.12604	-0.88751	-0.91556	0.98782	-0.96295	0.75564	-0.69265
+1	1.3655	-1.0533	-2.2171	0.66166	0.025806	0.67579	0.34249	-0.62323	1.0886
+1	0.56399	-0.71728	-2.1219	0.31633	-0.71031	0.87407	-0.34701	0.53176	0.10037
+1	-0.29942	-2.2988	-3.1477	0.24441	-0.72899	0.88463	-0.8288	-1.1141	-0.93797
+2	-1.6019	1.5308	0.77275	-0.1597	-0.62304	-0.59345	2.1367	0.64165	-1.6089
+1	0.43998	-1.5333	-1.9005	0.44722	-0.13187	0.57419	-0.61413	-0.37988	0.13118
+1	0.32451	-0.97656	-0.87335	0.35494	-1.1928	-0.086298	-1.1026	-0.97919	-0.21726
+1	1.1693	-0.39422	-1.1447	-0.52351	-0.30333	-0.48954	-2.0032	0.46507	0.28567
+2	-1.0178	-0.043439	0.70679	0.14463	0.58141	0.098977	-0.88721	-0.15542	-0.56848
+2	-1.864	0.19456	0.95611	-0.51705	-0.71043	0.72604	-0.62148	0.50157	-1.4442
+1	1.1946	-2.0839	-0.6101	-0.83583	-0.63001	-2.1693	0.72895	-1.5658	-0.082817
+1	1.1312	-0.95042	-0.78674	-0.86549	-1.6625	-1.463	0.99593	-0.16553	-0.34155
+1	0.1384	-1.7694	-1.1965	0.66966	-0.69619	0.30805	-0.080061	-1.5587	-0.319
+1	1.4232	0.30662	-1.3935	-0.69947	-0.00055014	-0.019403	1.7703	1.0318	0.42129
+1	1.3138	-1.6567	-1.8236	-0.83594	0.59818	-1.9568	-0.73185	0.59719	0.62349
+1	2.1276	-1.5641	-1.0272	-0.22706	-0.61297	-0.86845	-0.16811	1.1233	0.63294
+1	0.86327	-1.1672	-0.4862	0.32957	-0.080302	0.81128	0.71627	0.55966	0.56367
+2	-1.1147	1.2413	0.85755	-0.98983	0.37471	-1.5058	0.52838	0.36411	-0.48627
+1	0.75511	-1.5314	-1.2234	-0.066617	0.54207	-0.84565	-0.12893	1.9402	0.7808
+1	1.1796	-1.5249	-0.84271	0.7095	0.87459	0.4211	0.58894	-0.13679	0.9324
+1	0.93365	-0.83064	-1.7063	-0.39808	-0.20153	-0.35447	-0.30854	-0.57078	0.36515
+1	1.8917	-1.3609	-1.8857	-0.17194	1.2951	1.1315	1.4558	-0.089841	1.2983
+2	-2.5895	-0.48061	0.79532	0.78346	-0.065639	-1.4548	-0.32083	-0.6721	-0.66455
+2	-0.63117	1.7367	0.74948	-0.57156	0.163	0.86543	0.20003	-0.75063	-0.21691
+1	0.95464	-0.59931	0.43364	-1.307	0.20536	-1.2766	1.1449	0.17596	0.4256
+2	0.38623	0.55334	1.5367	-1.3081	1.5091	-0.032931	0.56364	0.54856	0.53007
+1	1.1646	-2.9641	-0.86913	-0.68118	-0.086229	0.93707	-0.76042	0.057056	0.064744
+2	-0.51373	2.3748	0.37243	1.8737	1.2164	0.68405	-1.2926	0.33967	0.46045
+2	-1.716	-0.27518	0.71898	2.139	-1.1262	-0.42262	0.11487	1.2112	-1.1357
+1	0.81098	-1.6862	-1.1448	1.5806	0.07478	2.1746	-1.067	-1.0274	0.15241
+2	-0.52225	1.1834	1.2802	-1.2321	0.53041	-0.29027	1.498	-0.42998	0.29824
+1	1.4067	-0.73586	-1.4675	0.36902	1.0718	1.0513	1.6971	-0.35651	1.4181
+1	1.6396	-0.50918	-1.5239	0.079563	-0.21164	0.21185	1.565	-0.65063	0.82484
+2	-1.8129	1.1552	0.21773	0.85556	-0.54894	-1.3206	-0.70958	-0.76325	-0.45363
+1	0.08024	-2.4412	-2.6136	0.63901	-0.43723	0.30985	-0.87622	0.32545	-0.64188
+2	-1.3992	1.86	0.38514	-0.16959	-0.24569	-0.82319	-0.33765	-1.4312	-1.2661
+2	-0.86537	1.8958	0.18147	-1.9666	-0.72909	0.10657	-0.67092	-0.092301	-0.26755
+1	2.036	-0.70975	-0.61637	-0.56185	0.88033	0.41052	-1.1744	1.3238	1.9451
+1	-0.72085	-1.0706	-1.5233	-1.0609	-2.2981	-0.92031	0.85305	0.92412	-2.0596
+1	0.55799	-0.18829	-1.3832	-0.54916	-0.1609	1.5505	0.19265	-0.46904	-0.37963
+1	0.57613	-0.29024	-0.82884	-0.28827	-0.62227	-1.1992	-0.81165	1.2746	-0.14435
+2	-2.1458	-0.13362	1.3613	-0.6849	0.26747	0.16034	0.47253	-1.0468	-1.4435
+1	0.75481	-0.80985	-1.7562	0.11274	-1.361	0.2692	-0.33398	-1.981	-0.45146
+2	-0.63689	1.4115	1.1256	-0.48954	0.22227	0.083383	-0.68005	-1.3527	0.15794
+1	0.20488	-0.8585	-1.7057	-0.10785	-0.51512	-0.21105	-0.2347	0.50991	-0.2296
+1	0.33051	-0.82281	-1.4551	-0.49943	-2.2164	-1.243	0.92027	-0.28432	-0.9815
+2	-1.5323	1.4825	0.19568	-1.2659	0.39757	-0.31925	-1.2746	1.0148	-1.2882
+1	1.5044	0.37718	-2.1235	-0.61248	0.60182	2.0258	1.4868	-1.3682	0.2884
+2	-1.6985	1.5229	0.84929	-0.10283	0.041132	0.4637	0.8772	0.68429	-0.14624
+2	-1.3935	1.1026	0.31729	1.3348	0.69002	0.8169	-1.0187	-1.2712	-0.32986
+2	-0.86151	1.1122	1.3	-0.32921	-0.41074	-0.70612	0.6009	0.3163	-0.097953
+2	-2.0673	1.6355	0.097123	0.91473	0.5959	1.3796	-1.1231	1.8893	-0.22321
+2	-2.4777	1.7124	-0.15192	-0.52093	-0.16443	0.4923	0.66793	-1.2934	-0.85227
+2	-1.3134	0.016105	1.4176	-1.6019	0.1775	0.25622	-0.55297	0.3436	-0.7072
+2	-1.0597	1.7595	0.80528	-1.8325	0.76506	-0.3233	-1.6869	2.265	-0.08971
+1	1.1695	1.0881	-0.63283	-1.785	-1.7752	-0.58415	0.69137	0.82675	-0.3004
+1	2.1262	-1.8156	-0.39282	-0.80595	0.050324	-0.16373	-0.47151	0.80027	0.54389
+1	1.063	0.25296	0.17061	-0.1157	-0.59899	-0.43356	0.60152	-1.3515	1.3947
+1	-0.10155	-0.81702	-0.9886	-1.1247	-1.0497	-1.185	-0.15332	0.4469	-0.096871
+2	-0.57577	0.74889	1.8408	0.28509	1.5472	1.9763	1.6429	-2.0436	0.74455
+1	-0.75989	-1.2425	-0.34199	-0.818	-2.3858	0.47522	-0.23387	-0.28078	-1.309
+2	-2.0495	2.5682	1.5694	-0.41676	-0.74454	-2.4393	-1.1153	-0.57367	-0.54138
+1	0.77924	-2.4438	0.15312	1.4288	-1.2908	0.81841	-1.6958	-0.26358	0.81237
+1	1.3679	0.40158	0.13439	-1.4677	0.89536	0.41708	-1.1908	0.96858	0.56786
+2	-1.4326	-0.13779	0.41395	-0.42952	-0.17306	2.1264	-1.3315	0.86756	-1.089
+1	0.88958	-2.3905	-0.67529	1.2911	-0.38016	-0.3412	1.1386	0.057707	-0.36773
+2	-1.5711	0.45979	1.0688	0.26169	-1.6144	-0.35448	-0.53559	0.42875	-1.6729
+1	1.0892	-0.40625	-1.2024	-0.24455	0.22748	0.98424	0.43801	-0.59885	0.46111
+2	-0.99813	0.68247	1.2314	-1.1455	0.047651	0.30609	0.32837	0.35498	-0.81578
+2	-0.68839	1.6801	2.0582	-1.4603	-0.88636	1.3908	-0.57986	-0.0037434	-0.53515
+1	0.40464	-2.6344	-0.28752	-0.51213	-0.48685	0.69834	-1.2208	0.065339	-0.45076
+2	-2.4333	-0.012759	1.469	2.659	-0.5377	-0.71507	1.0595	-0.18563	-1.5926
+2	-0.6268	1.4389	1.2319	0.08302	0.44274	0.39782	-0.67528	0.38559	-0.65921
+2	0.8026	0.80659	1.1495	0.74086	1.2964	0.062532	-0.28188	1.5504	1.1851
+1	0.21066	-1.3587	-1.018	-0.87592	-0.69085	-0.72849	0.38214	0.62269	0.18878
+1	1.0048	-0.91952	-0.66448	-1.3416	0.25265	-1.2612	-0.049135	0.82484	1.005
+2	-1.7507	1.7795	1.0866	1.9423	0.058961	0.96838	-0.3094	-0.2146	-0.7414
+1	0.97472	-0.061041	-0.36624	-0.7592	0.64262	0.81729	0.82749	1.823	0.34266
+1	-0.18399	0.0091627	0.45289	-1.2116	-1.9977	1.0641	0.8541	-0.49246	-0.92098
+1	2.9043	-1.4253	-1.4868	1.7467	0.4367	0.05544	0.35801	-0.91383	1.8223
+2	-2.5691	0.54849	1.5138	-0.75521	-1.646	0.98134	-0.18735	-0.6348	-1.9734
+1	2.3396	0.33806	0.69458	1.1091	1.2125	0.33828	-0.35002	1.1751	2.2485
+1	1.6685	-1.3783	-1.9317	-0.42944	1.2029	-1.4867	0.066998	-0.79486	1.4035
+2	-2.0928	0.53632	0.66581	1.2841	-0.60555	0.040915	3.1538	-0.056627	-0.83943
+1	1.5062	-0.82059	-0.74344	0.44647	0.59511	0.72422	0.62593	1.4268	1.2028
+1	0.37623	-2.4777	-1.3103	0.80402	-1.0351	-0.65952	1.4683	0.29902	-0.49379
+1	1.4315	-2.0349	-0.31206	0.050746	-0.13336	-0.038433	-0.51562	0.99598	0.8749
+1	0.46095	-1.5658	-1.8801	-0.54485	-0.65584	0.76544	0.2493	-1.0033	0.76074
+1	2.6758	-1.3401	-0.74083	-0.48907	1.4859	0.80109	0.084022	-1.1922	2.1735
+1	2.0061	-1.4527	-1.0237	-0.0063521	0.45363	-0.80533	0.53272	1.6309	1.1671
+2	-0.13994	1.3236	0.36193	-1.5754	0.31655	-0.87259	-0.30997	0.42034	0.078694
+1	0.48288	-1.4314	-1.2834	-0.79288	-0.031895	-1.3756	1.1439	0.092314	-0.51815
+2	-0.47435	0.79761	0.43073	0.79731	0.57061	-0.28187	-0.50956	0.11834	-0.90176
+1	0.29318	-0.50799	-1.2929	0.33339	-1.3628	-0.65651	1.332	-0.60648	-0.83894
+2	-1.606	1.6449	0.77136	-2.1167	-0.16742	1.837	0.85353	-0.61236	-0.63417
+1	-0.1001	-0.77059	-1.5772	-1.6877	-0.97173	0.63499	-0.3566	0.22712	-0.64236
+1	1.2767	0.51264	-1.027	-1.5029	0.52605	1.3738	0.83457	0.29704	0.33919
+1	1.1191	-0.064296	-0.48267	-1.782	-1.2738	0.17159	-0.28188	0.29923	-0.58741
+2	-0.63826	1.8527	1.7133	-0.056135	1.8808	-1.6172	-1.0494	0.61158	0.043977
+1	1.2643	0.64783	-1.0678	0.74684	0.01604	0.0964	3.1502	1.0929	0.73344
+1	0.12706	-0.4412	-0.89289	-1.3539	-0.058561	0.67775	-0.3655	0.095055	0.96019
+2	-3.0835	1.5862	0.75303	-0.24237	-1.08	-0.96917	-0.3816	-0.81532	-2.8002
+1	0.51225	-1.7399	-0.75798	-0.067637	-1.3492	-1.6732	0.13661	0.60332	-0.10099
+2	-1.7725	0.80999	1.2954	1.1806	-0.26584	1.0747	-1.4449	-0.67675	-0.87535
+1	0.14033	-1.4421	-0.77783	-0.66938	-0.73477	0.79103	-1.159	-0.063733	0.25614
+2	0.076697	0.50986	1.3258	1.965	0.90572	-0.69409	-0.34803	-0.63785	0.081812
+1	0.66949	-1.0812	-0.32498	1.1384	-0.35031	0.88344	1.5788	0.36127	0.94262
+1	1.8522	-1.2292	0.14775	-0.72146	-0.62468	0.46004	1.3635	-0.57543	0.34048
+1	1.0906	-0.60665	-0.65963	1.0382	-0.42593	1.3403	-0.15771	0.76656	-0.12989
+1	0.27921	-0.21562	-0.17954	0.91419	-2.0093	1.7467	-0.4308	-1.0916	-1.2044
+1	1.1757	-1.4632	0.1861	-0.99194	0.13545	2.4954	0.10044	-0.27133	0.69247
+2	-0.99062	-0.018655	1.4302	0.24467	1.1165	1.0648	-1.6885	1.0959	0.95405
+2	0.86302	0.92628	1.1209	2.4521	0.28548	0.38878	1.5759	-0.85559	0.53646
+1	0.69515	-0.49791	-1.0236	-0.92469	-1.2116	1.3456	-0.79874	1.204	-0.56016
+2	-2.4796	1.3958	0.87657	0.44706	-0.16121	1.5481	0.71852	0.27896	-0.66289
+1	0.43301	-0.79901	-0.59228	0.77222	-1.3966	0.25029	1.254	0.29857	-0.62542
+1	-0.27647	-1.1822	0.41671	-1.3611	-0.55777	-0.50963	-0.30934	-0.59363	0.061939
+1	0.38513	-2.9318	-0.54247	0.37014	-0.073925	1.5321	0.23051	-0.57138	0.11674
+2	-1.8571	0.45699	1.201	0.10404	-0.60138	-1.7736	0.42053	-0.79846	-1.4224
+1	0.62359	-1.7125	-0.62582	-0.042918	-0.36669	-0.56715	-0.062339	0.89859	0.30456
+2	-1.6533	0.84354	1.6735	-1.2605	-0.43289	0.48404	0.28039	0.78245	-0.57258
+2	-0.080794	1.1924	1.4788	-0.67232	0.47322	1.1845	-0.012908	-1.4312	0.93776
+1	0.16058	-0.57081	-2.6514	1.4884	-2.1855	0.65477	0.47093	0.15081	-1.1277
+2	-1.1955	0.99242	0.9036	0.18329	0.18	-1.2844	-0.11974	0.18755	-0.45505
+1	1.1671	-2.6976	-0.50301	-0.58948	-0.51739	-0.45284	-0.012968	0.20125	0.57372
+1	-0.32345	-1.1455	-1.2572	0.10599	-0.55736	-0.50023	-0.14238	-0.46824	-1.259
+1	-0.25853	-1.7978	-0.029919	-0.29829	-1.0868	1.6792	-1.0787	-2.2796	-0.53019
+1	-0.36174	-1.3337	-1.1195	-0.31725	-0.95852	1.0132	1.7214	-1.0866	-0.13132
+2	-1.1173	0.24817	1.2532	-0.7469	0.27598	-0.84941	-0.49835	0.56046	0.59012
+2	0.30144	2.7931	0.91519	-0.84696	0.23668	-0.88296	0.72892	1.0513	0.19212
+1	1.4905	-0.4007	-0.54397	0.15127	-0.74687	0.61323	-1.8356	0.59089	1.1093
+1	-0.35132	-1.9883	-1.256	0.93049	-0.70667	-0.28659	-0.42879	-1.362	-0.50144
+1	1.2429	-1.5525	-0.20626	0.072086	-0.39782	0.68157	-0.53323	1.8666	0.045473
+2	-1.2196	0.14752	-0.53211	-0.7467	1.1406	-0.56244	0.29943	-1.4297	0.46157
+2	-1.6198	1.9155	1.2365	-0.95186	-0.06658	0.96942	-0.18211	-0.49517	-0.41439
+2	-1.0683	0.96089	1.1544	-1.6614	-0.35334	-0.4625	-0.21637	-0.32475	-0.10647
+2	-1.6914	1.0877	0.4725	-1.5111	0.83773	0.32967	-0.94111	1.3745	1.1852
+1	0.84313	-0.24952	-0.56678	-0.27797	-0.54407	-1.3431	-0.25809	1.282	-0.056027
+1	-0.035988	-2.0608	0.40945	0.30565	-0.62316	0.29468	-0.23983	-1.3008	-0.22695
+2	0.075977	1.9441	0.49189	0.37696	0.70796	-0.86073	0.4114	0.22453	0.98819
+2	0.28842	1.232	0.33576	0.038484	0.8227	-0.67275	0.41736	0.022429	1.0885
+1	1.6374	0.024546	-1.7459	-0.57923	0.68063	0.16658	0.0016636	0.47144	1.1552
+1	1.8588	-0.93368	0.28434	-0.7861	1.8997	1.5632	0.67609	1.9808	2.1869
+1	1.1439	-2.5158	-0.94428	1.3944	0.47815	1.0813	-0.82034	-0.4671	1.6872
+1	-0.83643	-1.1109	0.74783	0.14825	-1.8961	0.53083	0.12628	-0.97035	-1.2131
+1	0.80792	-1.2206	-0.53769	-1.9796	-2.0225	-1.3183	1.5367	-0.089998	-0.63818
+1	0.46322	-1.6832	-0.68896	-0.11466	0.82291	0.49543	0.64194	-0.78985	0.7928
+1	1.1134	-0.7632	-0.52309	0.050666	-0.11115	0.22091	-0.50697	-0.083966	0.28955
+1	1.6489	-1.4257	-0.079768	-0.17866	1.3682	0.99716	-0.14071	0.57401	2.0271
+2	-3.4201	1.1332	0.55733	1.7639	-1.0408	0.49521	-0.89075	0.63786	-2.4173
+2	0.049496	0.17018	0.63955	0.82924	0.50401	1.7456	1.2791	-0.82747	-0.056268
+1	0.82888	-1.6152	-0.67552	-0.18412	-0.8324	0.63814	-0.32875	0.56435	0.45993
+1	0.38504	-0.014272	-0.79157	0.17829	-1.0883	0.34832	-1.2247	-0.11977	-0.48077
+2	-1.4876	0.61139	0.9406	-0.32299	-0.4817	0.91219	0.97626	-0.25486	-0.64597
+1	1.3562	-0.30066	-1.6972	-0.51976	-0.31725	-0.76347	0.90608	-1.1069	1.1407
+2	-2.5614	0.1045	1.6435	0.97534	-1.3122	-0.7861	-0.20101	0.13606	-1.6992
+2	-2.6662	0.95905	-0.35403	-0.3552	-1.8512	-0.15132	-0.41612	0.31836	-2.2106
+2	-0.00031444	0.62953	0.088267	0.68222	1.0037	-0.97501	0.05455	2.1016	0.79972
+2	0.22638	1.2227	1.4105	0.80602	0.55541	-1.5322	0.0043904	-0.15507	0.68087
+2	-2.334	1.5675	1.163	0.272	-1.2525	0.60333	-0.37448	0.8214	-1.9516
+1	1.2905	-0.88687	-1.3286	-2.4723	-0.20557	-0.46225	-0.43282	0.0080673	0.6155
+1	0.4564	-0.76149	-1.0996	0.91754	-1.2544	0.85041	-1.4562	1.2935	-0.46559
+1	1.4499	-0.66586	-0.35765	-1.2333	0.27339	0.71405	0.31118	0.35473	0.29444
+2	-0.77922	-0.42723	1.5001	0.0051638	1.708	-1.1243	-1.7226	0.88573	1.091
+1	1.4447	-0.16076	-0.43264	-1.3692	0.49062	0.72536	1.0569	-1.0645	1.0431
+2	-2.1249	1.55	1.0703	-0.33715	-0.93988	-0.46815	0.37327	0.14989	-1.378
+2	-2.1409	1.9364	0.89125	-1.3418	0.0029328	-0.62313	-0.08749	0.8668	-0.022832
+1	1.3168	-0.52716	-1.8803	-0.036537	0.018738	-0.35049	-1.0451	0.91575	0.5615
+2	-0.71066	1.9845	1.49	0.34891	1.2436	-1.4879	-0.19868	-1.2859	1.4068
+1	1.5001	-2.1148	-0.77803	2.3299	1.4564	-2.0676	-0.022721	-0.10446	0.26055
+2	-0.6739	0.41846	1.7318	0.68893	0.13108	-0.31544	-1.5612	1.2954	-0.92584
+1	1.4702	-1.0425	0.6928	0.072418	0.54485	0.85063	0.0081416	-1.4887	1.4283
+1	0.70021	-0.96049	0.073815	-0.42884	-0.069394	-0.21559	-0.026326	1.4426	-0.1714
+2	-1.1011	1.959	0.42525	-1.1689	-0.59141	0.10594	0.018948	0.20462	-0.52074
+1	1.4069	0.39853	1.1331	0.19914	-0.10243	0.018621	-0.43318	-0.66927	0.39015
+1	0.87655	-1.0124	-1.224	-0.46666	-0.07615	0.58575	-2.5462	0.94584	0.028689
+2	-1.4734	0.60836	0.57896	-0.63359	0.57633	-1.7896	0.17572	1.9757	-0.63815
+1	1.0333	-1.5614	-1.5383	1.438	0.52141	0.24245	-0.53578	1.6605	1.2533
+2	-0.3273	1.0926	1.1519	0.16952	1.0365	-0.23815	0.64169	0.60631	0.070148
+1	1.7758	-1.2199	-0.5642	-0.30348	-0.64616	0.58837	0.3667	-0.22602	0.18959
+1	1.5199	-1.4167	0.75493	-0.56876	-0.25767	-0.15304	-0.50137	0.95964	0.82786
+1	1.4824	-1.6233	0.43914	-0.42964	-1.3404	0.22643	-0.1404	-0.61313	0.084143
+1	0.44429	-0.57239	-0.87756	0.35081	0.18739	-0.3721	-0.026971	0.30198	0.1578
+2	-0.99851	1.6131	-0.023407	0.93921	-0.39113	0.3954	0.61223	-1.5171	-0.23186
+1	1.5526	-0.53216	-1.2919	0.2302	-1.4551	-0.78631	0.76506	-1.3068	-0.65802
+1	0.94848	-0.51015	-1.0914	2.9383	0.26782	-0.85511	-0.60545	0.54075	0.66057
+1	1.3473	-1.6193	-1.3367	0.35306	1.0269	0.9064	0.45715	1.1513	1.8352
+2	-1.8273	2.0565	1.3104	0.29618	0.35044	-0.48547	0.88384	0.14121	-0.5916
+1	1.5566	0.31096	-1.8396	-0.42655	1.4972	-0.77059	0.19228	-0.23885	1.1498
+2	-0.91541	1.1099	-0.025734	0.51863	0.20206	-1.1191	-1.1133	0.045123	-0.50422
+1	0.51812	-0.60581	-0.51525	-0.27024	-0.24289	-0.12177	0.08843	-1.1701	0.54732
+2	-2.2517	1.8548	0.3887	-0.48496	-0.44221	0.94129	0.86746	-1.3026	-1.1678
+2	0.18212	0.78036	0.37111	-0.27298	1.7074	0.34353	-1.4465	0.42845	1.358
+1	1.4023	-2.1882	-1.587	-1.7672	-1.0834	1.6286	-1.2021	-1.6029	-0.13929
+2	-1.2956	2.1152	2.7519	0.066883	1.1916	-0.43506	1.3982	0.50402	0.12064
+1	2.3367	-0.27214	-1.3764	0.11017	1.453	-1.5568	0.8465	-0.078289	1.7156
+2	-0.50576	1.8409	0.39684	-0.67433	0.52285	0.39823	0.79306	-0.45694	-0.26349
+1	1	-0.59182	-0.31766	0.98958	-0.2262	0.51294	-0.60031	1.0725	0.59729
+2	0.19153	0.8046	1.643	0.034662	0.859	0.7859	-0.32844	0.67515	0.20322
+1	1.7901	-0.59357	-1.2522	-1.4543	-0.68975	0.39807	0.66376	-0.34466	1.1902
+1	1.7089	-0.060397	0.35043	0.80625	0.099879	0.35182	-0.79309	-1.5215	1.0715
+2	0.1343	0.95427	0.96941	1.4958	1.5293	0.80648	0.27086	0.22725	1.1392
+1	2.8634	0.47861	-2.0142	0.11694	1.8637	0.021456	-0.030072	1.0836	2.0311
+2	0.48387	-0.64355	1.4169	0.74074	1.2122	-1.1388	-0.27931	0.32164	0.54646
+2	-0.74265	2.4938	2.0609	0.27613	0.097949	0.19312	-0.5424	0.075476	-0.43488
+2	-0.29163	0.040455	0.82654	-0.28016	1.2311	1.9005	0.3332	0.84937	1.0188
+1	1.4611	0.12262	-1.6808	0.83668	0.73216	-0.78731	-0.78309	0.048527	1.9664
+1	0.18222	-1.1837	-0.45627	-0.39739	-1.7104	0.031619	1.0594	-0.63454	-1.8183
+1	-0.65677	-0.84807	-1.6193	-0.47942	-1.0684	0.88853	-0.89937	0.52119	-1.4839
+1	1.2698	-1.435	-0.63897	-0.01313	-0.99173	2.5522	-0.56152	-0.56106	-1.1274
+1	1.385	-0.13768	-1.0754	-0.47919	-0.003611	-1.5125	0.052625	1.5811	-0.12839
+2	-1.0548	0.052238	0.2412	0.27463	0.22433	1.4336	1.0572	0.26996	0.41029
+1	0.7721	-0.67292	0.39868	0.37861	-1.4934	-0.47718	0.17927	0.85268	-0.72091
+1	1.2427	-1.9735	-0.29186	-0.52621	-0.11644	-0.43715	-0.24664	-0.93071	0.31767
+2	-2.8043	1.0978	1.4787	0.36056	-0.96764	0.88555	-0.15218	0.98887	-1.5008
+2	-1.2951	0.83324	1.171	-1.2691	0.36927	0.76625	-0.92005	0.24768	-0.054118
+2	1.3095	0.99843	0.13992	0.66979	2.1828	0.89717	-0.72625	-0.34445	2.1892
+1	1.2584	0.38994	-0.68463	-0.18974	-0.78064	0.77286	-0.83635	-0.60385	0.92861
+2	-1.0711	2.0033	1.0809	-0.51058	-0.023381	0.67482	-0.59591	1.1403	-0.45183
+2	0.21944	1.3571	1.4359	0.78966	1.663	1.6785	0.58208	-0.74842	0.20906
+1	0.011518	-1.0425	-1.1304	-0.070319	-2.5168	0.39814	-0.33423	-0.78894	-2.0357
+2	0.69198	0.5718	0.47852	0.63681	1.8381	-0.38219	-0.27264	-0.64378	2.0531
+1	1.7602	-0.041861	-1.5806	1.2187	0.62789	0.63859	-0.56816	1.0461	1.2766
+1	1.3974	-0.72864	-1.3122	0.98553	-0.40148	0.73259	-0.54019	1.2025	0.62291
+1	2.0292	-1.17	-0.92469	-0.4438	1.0769	0.3171	1.863	-1.4777	2.183
+1	0.82444	-0.11125	-1.7986	0.22037	-0.58058	-0.28998	-0.36893	0.1951	-0.014686
+1	-0.26775	-1.8824	-1.0596	-1.1796	-0.88341	-0.41298	0.2225	-0.34038	-1.9099
+1	1.0464	-1.5432	-1.1439	-0.16887	-0.58282	-0.58015	0.071053	-2.0172	0.40629
+2	0.48496	0.88721	0.068703	-0.062814	1.8539	0.76736	-0.69119	2.5673	1.7942
+2	-2.5964	1.666	0.64624	0.29818	-1.2247	-1.7919	-0.46627	-0.48313	-2.4143
+1	1.2985	-0.65098	0.20448	-0.94345	0.87214	-1.6734	-0.068609	-0.4095	1.9333
+2	0.22616	1.0924	1.3477	0.055694	1.4254	1.8744	0.11516	1.7865	-0.63249
+2	-0.088217	0.9008	0.6155	-0.80262	1.0367	0.52624	0.47333	-0.99159	1.1763
+2	0.49566	0.27083	0.36027	0.81907	2.1477	-0.09016	-0.060519	-0.84038	1.2276
+2	-0.95509	0.76962	1.617	-0.18465	0.54306	0.11383	-0.74663	1.2036	-0.15892
+2	-2.1626	0.76688	0.61098	-0.58151	-0.48433	-1.65	-0.4727	-0.81084	-1.991
+1	1.7072	-1.4061	-0.93099	0.20659	-0.6383	-0.52376	-0.59362	0.73275	0.14137
+1	1.1248	-0.25303	-0.59647	0.88007	0.15399	0.51682	0.81114	0.50757	1.0622
+2	-0.71804	0.42061	1.375	-0.1329	-0.13315	0.694	0.51403	0.7759	-0.19636
+2	-0.78286	1.5434	1.1806	-1.684	-0.84914	-0.26491	-0.18979	-0.39503	-0.52299
+2	0.014488	1.8201	0.1954	-0.95429	1.2411	-0.58396	0.55811	-0.46832	0.47374
+1	1.0749	0.50186	-1.2937	-0.90643	-1.2159	-0.19162	0.7674	1.3112	0.1246
+1	0.68887	-0.44578	-1.0028	-0.11492	-0.20396	0.84785	-0.15439	0.32438	-0.039298
+2	0.16742	2.9261	-0.74973	-0.39068	1.7798	0.42686	-0.080223	0.42411	1.6039
+1	-0.18087	-1.5505	-0.62971	0.016341	-1.5144	-1.0188	2.0846	0.043907	-1.1922
+1	0.95661	-2.0166	-2.1997	0.90248	0.54062	0.041709	0.90484	-0.85369	-0.13388
+2	-0.31077	0.51779	0.95641	-0.4625	1.0018	-1.0891	-1.3434	0.41807	0.50029
+1	0.91328	-0.44549	-2.0298	-1.174	-1.034	0.4279	-2.5807	0.4737	-0.85271
+1	-0.23575	-2.037	-0.2611	-1.4787	-2.7359	-0.17981	0.87371	0.47744	-2.3323
+2	-1.4541	0.20996	-0.05013	0.84273	0.46742	1.5516	-1.0325	0.70636	0.30572
+2	-1.2945	0.85979	1.4434	0.58762	0.48371	-0.71804	-0.9537	-0.78726	-0.53815
+2	0.74344	0.32219	0.79813	-0.31128	2.9169	-0.23629	1.4931	-0.35416	1.8392
+1	0.17191	-0.10805	-0.90104	-1.2155	-1.8461	0.41305	-1.3882	-0.70599	-1.4386
+2	-0.40498	1.9161	0.64926	-0.022772	0.98396	-0.26674	1.295	1.3676	0.78339
+2	-0.37054	1.509	1.6115	-0.58429	0.1452	1.167	-1.1994	0.076682	-0.76871
+2	0.61117	-0.31328	1.4496	-1.0086	1.5965	-0.44863	0.87281	-0.013992	1.2945
+2	-2.5627	2.5993	1.1595	-0.14098	0.0029615	0.58802	-1.7538	-0.44999	-1.599
+2	-0.871	0.043195	1.076	-0.56146	0.50375	0.85785	-0.11991	0.58565	-0.12111
+1	0.26437	-1.5194	-0.99247	2.0087	-0.53643	-0.028452	-0.60254	-1.0593	-0.44553
+1	1.4337	-0.4955	-0.38857	1.7006	-0.029221	0.72542	-0.5476	-0.25228	0.99248
+1	1.2526	-1.0033	-1.5107	-0.50129	0.52008	1.8291	0.25094	0.8054	1.4381
+2	-1.2973	0.63457	0.23922	-0.83426	-0.3921	0.48332	0.6937	-0.90008	0.28163
+2	-0.68226	1.0692	1.7561	0.16471	0.93344	-0.85611	0.17721	-2.744	0.79804
+1	1.1524	-2.2292	-0.55308	1.0928	-0.12293	-1.1935	1.2415	-0.70506	1.079
+1	0.9021	-0.91029	-2.3501	-0.4621	0.22359	0.6318	0.020605	1.0348	0.40828
+2	-0.76595	0.8248	1.9282	-2.1827	0.12486	0.79045	-1.0793	0.85428	-0.38859
+2	-1.8465	1.2372	1.4255	-0.64113	1.7146	1.75	1.0757	2.1723	-0.10888
+1	0.4124	-0.023721	-0.75091	0.0023936	-0.28659	-0.41428	-0.016011	0.6957	0.69187
+2	-0.45813	0.69702	1.7516	1.0408	0.15944	0.1227	0.38587	0.74631	-0.89003
+1	0.538	-0.35454	-0.3801	-0.53212	-0.68379	1.224	-0.77711	-0.90789	0.49391
+1	-0.20833	-2.8331	-1.3705	1.1197	-1.344	-0.82517	1.523	-0.91541	-0.96558
+1	0.7891	-1.2808	-1.1525	0.88602	-0.16858	-1.7123	0.77873	-0.20954	-0.16867
+2	-1.3314	2.8851	0.58893	1.7864	-0.23105	0.055718	-0.12725	0.76001	-1.5992
+1	0.73632	-1.3301	-2.9522	0.52725	-1.08	-0.06714	-0.94698	0.45418	0.41486
+1	-0.35063	-1.2931	-1.7601	0.69363	-1.4744	0.24266	-0.53511	0.79048	-1.1274
+1	0.49595	-1.7854	-2.069	-0.16771	-0.40006	0.44868	-0.4303	-1.5395	-1.066
+2	-0.83194	1.8975	0.64283	0.057645	-0.11672	-0.27891	0.11427	0.37462	-1.1174
+1	0.13137	-1.3172	-1.3952	0.60281	-0.59451	0.40422	-1.903	0.19047	0.63287
+1	0.79379	-2.4506	-0.74815	0.095119	-0.99504	0.56827	-0.27855	1.1757	-0.06042
+1	-0.082568	-3.4167	0.10544	-0.46771	-0.47642	-1.255	1.1708	-1.1147	-0.49832
+1	2.2039	-1.3601	-2.4033	-0.96653	0.33475	1.6743	-0.18215	0.26277	1.2449
+2	-2.4832	1.2267	1.3225	-0.44129	-0.82506	-0.44882	-1.3962	-0.7991	-1.6171
+2	-0.46149	0.35062	0.24453	0.83174	1.0664	-0.43189	-0.035901	-0.01857	-0.36555
+1	1.3889	0.052183	-1.2924	1.3615	-0.04596	-2.3656	0.38864	-1.7679	0.75491
+1	-0.68146	-1.242	-1.0646	-1.43	-1.2204	-0.57024	1.9686	-1.3026	-1.5174
+2	-1.7219	1.7273	1.3099	-1.4944	0.38043	-0.45523	-0.1014	0.22334	-0.28025
+1	0.4601	-1.2706	-3.0004	0.76391	-1.0926	-0.62232	-1.4501	1.8045	-0.8909
+2	0.63508	0.82051	0.86771	-0.03764	2.0161	0.47394	0.72173	0.1272	0.90096
+2	-0.50664	0.34365	-0.25494	-0.017548	0.40843	-0.051173	-0.39524	0.91238	-0.53873
+2	-2.0811	0.89924	1.0192	0.43669	-0.49654	-0.23137	0.41548	-0.30013	-1.4364
+1	-0.056347	-1.55	-0.99371	-1.2894	-0.54273	0.29751	0.20504	-0.42535	-0.30966
+1	0.63831	-1.9968	-0.82023	0.55724	-2.0781	0.85777	0.23729	-0.92902	-1.6423
+1	0.7966	-1.5913	-0.52401	-0.19794	-1.6834	-0.3534	-0.46345	1.1393	-0.65595
+2	0.10773	-0.33975	-0.087855	0.29636	0.96272	-0.39449	-0.9227	0.43119	0.37524
+1	1.0429	-2.6154	-1.0715	-0.95629	-0.89564	0.66231	0.11241	1.2325	0.32819
+2	-1.6843	1.3516	0.30108	0.72455	-0.23492	1.5917	0.52992	0.55089	-0.67923
+1	0.83236	-1.7333	-1.3285	-0.84552	-1.5398	0.63718	-0.92241	0.65631	-0.20652
+2	-1.4221	2.5458	0.98922	-0.97179	0.27368	0.51406	0.34173	0.18592	-1.2884
+2	-1.7862	0.7866	0.99765	-1.3351	0.49844	-0.43267	-0.53121	-1.4309	-0.56164
+1	1.4776	-0.21831	-0.99715	-0.43224	-0.74575	-0.54461	-0.93794	0.96267	-0.10238
+1	1.7229	-1.0653	-1.0424	-0.3796	0.61655	0.95133	0.98557	-0.36444	0.86756
+2	-0.23995	-0.13066	0.42758	2.147	1.4597	-0.19292	-0.86687	-0.39257	0.27569
+2	-0.20121	0.59656	1.9887	0.13145	0.1327	-0.19727	-0.05865	0.48741	0.25007
+2	-0.34495	2.2333	1.1524	-0.3531	0.51244	-1.0083	-0.22929	0.97338	0.57683
+2	0.03843	2.0985	1.5399	-0.44067	0.39468	0.66165	0.66233	2.0593	-0.89779
+2	-0.79583	-0.26167	1.7969	-0.83981	0.44149	0.7226	0.89209	0.58699	-0.022219
+1	0.44433	-0.9731	-1.1557	0.30092	-2.0491	-0.64077	-1.2024	0.27957	-0.594
+1	-0.5687	-1.2111	-0.75535	0.14432	-2.5169	2.0343	0.43688	0.19656	-1.4058
+1	0.74067	-2.7385	-0.5607	-0.1682	0.75534	-0.10032	-0.57514	-0.6271	0.86134
+1	1.3443	-1.3033	-2.9093	-1.1089	0.13087	-0.64097	0.3585	0.68683	0.40175
+1	0.34499	-1.2307	-1.0615	-0.056169	-0.66885	1.0018	0.82215	-1.2896	0.33605
+1	1.7055	-1.6123	-1.7269	1.149	0.91344	0.15816	0.08206	-1.0272	1.1846
+2	-2.257	1.8592	0.85977	1.5261	0.41802	1.6948	0.56961	2.0545	-1.7022
+2	-1.1666	0.71643	1.5052	0.88419	0.97675	-1.125	0.3411	-1.8831	-0.36783
+2	-2.8249	1.0453	1.0209	1.1005	-1.2481	-0.97923	-0.2972	1.2716	-1.4542
+1	-0.22349	-1.4876	0.16086	1.2627	-1.3753	-1.4312	1.5506	-0.28627	-0.13164
+2	-1.6498	0.87841	0.00037123	0.074895	-0.55409	-0.36662	1.0731	2.664	-0.749
+2	-0.46646	0.70235	1.1324	-2.5793	0.67907	0.35468	-0.32694	-1.1455	0.56525
+1	1.2694	0.46784	-1.4293	-0.50127	-2.0587	-1.8261	0.36831	1.7871	-1.5834
+1	1.5754	-1.0397	-0.5639	2.0739	0.53841	-0.70667	-0.65273	1.3444	0.45546
+1	-0.13986	-0.92734	0.87918	-0.72209	-0.5052	0.39414	-1.8605	0.98483	-0.37829
+2	-0.95014	0.83973	1.4337	-1.1105	0.072627	-1.2172	-1.6062	0.079614	-0.040378
+1	1.1359	-1.4676	-0.79366	0.068314	0.20653	-0.21332	0.8022	0.58405	0.92071
+2	-4.4596	1.8899	1.1644	0.58514	-2.6451	-0.26627	1.6536	1.2677	-3.7338
+1	1.5815	-1.7598	-1.5736	0.46493	0.015353	-0.31082	-2.2055	0.14685	0.11537
+2	-0.79178	0.27783	0.5954	-0.78667	0.40642	0.42974	-0.63366	1.0762	0.62431
+2	-1.0134	1.2166	1.1865	1.5637	1.1099	2.4594	0.40801	-0.85353	0.72663
+1	0.77943	-1.4202	-1.6749	0.0012415	-0.83458	-0.12672	-0.94554	0.89884	0.012849
+2	-1.4274	0.9359	0.88402	-0.76419	-0.50766	0.55146	-0.63931	-0.65644	-1.0529
+2	-0.71825	0.92276	1.0007	1.2904	1.4708	-0.52982	0.9275	0.94508	0.4575
+1	0.502	-1.2444	-0.25346	1.2023	0.16167	0.85576	0.034795	0.46868	1.3265
+1	-0.025698	1.1754	-1.0638	1.0218	-2.0164	0.55502	-0.12178	-0.10811	-1.6111
+2	-0.86777	0.31084	1.7383	0.39918	0.22035	0.14221	1.646	-0.97712	-0.59459
+2	-0.19808	1.9089	0.60873	0.12475	0.10092	-0.5944	-0.66923	0.055193	0.31899
+2	-1.0644	2.2357	0.13503	1.2076	1.657	-0.83795	-0.46089	0.42362	0.29853
+2	-0.53265	0.76969	1.0687	-0.79048	1.1924	0.53681	-0.38366	-1.1613	0.42401
+2	-1.4567	1.5038	1.7125	-1.9757	1.1075	-0.81071	0.29591	0.95985	-0.25161
+2	-2.7546	-0.21024	-0.041926	-0.24552	-0.6494	1.8608	0.86785	1.3512	-0.89236
+2	-0.54365	0.8237	-0.31856	-1.6296	0.73174	0.89915	0.91228	-0.66788	0.075926
+1	0.65472	-2.4675	-1.2267	-0.64632	-0.24147	0.5015	-0.24368	1.7307	-0.33117
+1	1.9061	-2.4358	-0.62051	-0.40306	0.35877	0.13681	0.5665	1.1077	0.90585
+1	-0.34786	-0.97138	-1.3607	0.74793	-2.3185	1.1517	0.35912	-0.22501	-1.7136
+1	1.509	-0.58183	-1.336	0.095131	-1.0719	-0.17454	-0.42425	0.21663	0.41672
+2	-1.1281	0.73596	1.3241	0.75066	-0.0098067	0.94941	-0.88569	0.96608	-0.58258
+1	2.0808	-1.2665	-0.27892	0.034005	1.5957	0.34276	-1.3939	0.20516	1.0361
+2	-0.27208	1.3514	0.78429	0.54442	1.2344	-1.0745	0.28837	-0.84074	-0.20416
+1	2.5732	-1.8429	0.35018	0.47113	-0.22532	-1.779	1.5326	-1.0015	1.0285
+1	1.524	-2.2514	-1.7375	-0.45648	1.0921	-1.1141	1.436	0.99093	1.3581
+1	0.60324	-0.46804	-0.11489	-2.454	-2.7665	0.61676	-1.5213	-1.192	-1.4163
+2	0.29712	1.188	0.57954	1.3259	0.95488	-0.70707	0.067457	0.47216	1.0369
+2	-0.97992	0.019053	1.3311	-0.33347	0.2814	-1.2616	0.90909	-1.0725	-0.62617
+2	-0.9056	0.73973	0.35093	-2.111	-0.50769	1.2491	0.64846	-1.0716	-0.35201
+1	1.3209	1.9154	-0.56509	0.70008	-1.6874	-0.92485	1.2406	1.7231	0.39622
+2	0.10632	0.88089	1.1544	0.27737	2.4332	-0.063819	-0.084136	-0.58305	1.1337
+1	0.7003	-1.4112	0.77725	0.95921	-1.239	-2.6684	-0.48008	-0.92359	-0.94882
+2	-2.0912	0.21124	1.0428	1.3279	-0.6659	-0.89398	0.5482	-0.029518	-1.2925
+2	-1.1484	2.2537	1.3423	-0.20816	0.31427	1.3603	1.6596	-0.49629	-0.63146
+1	1.2996	-2.8499	-0.97843	0.57176	-1.0424	-0.30734	-1.7632	-0.64856	-0.28028
+1	2.4392	-0.85404	-0.1262	-0.054289	0.1684	-1.3913	-0.4719	1.0582	1.4183
+2	-2.8357	2.1818	1.307	-1.1424	-0.97969	0.53689	0.33598	-0.11592	-2.0398
+2	-3.381	0.65778	0.8815	0.35115	-1.0556	-0.15942	-0.15958	0.57712	-2.8992
+1	1.9169	-0.15977	-1.1239	0.80773	-0.63434	-0.77712	-0.74684	0.97499	0.8461
+1	1.3703	-1.0164	0.45114	0.073799	1.259	0.40628	-0.11775	0.14354	2.0331
+2	-0.57067	-0.26266	0.56169	0.65535	0.78349	-0.66788	-0.41928	-0.77901	-0.27518
+1	-0.31373	-3.348	0.66363	-0.88205	-0.69595	1.0783	-1.9735	1.7579	-0.011735
+
diff --git a/sourcecodes/data/example_time_series/TEbgraphviz.txt b/sourcecodes/data/example_time_series/TEbgraphviz.txt
new file mode 100644
index 00000000..d8bbfe4b
--- /dev/null
+++ b/sourcecodes/data/example_time_series/TEbgraphviz.txt
@@ -0,0 +1,11 @@
+digraph G {
+size="10,10";  ratio = fill;
+node [shape=square,width=1.5];
+Genotype -> TraitA_T1;
+Genotype -> TraitA_T2;
+Genotype -> TraitA_T3;
+Genotype -> TraitB_T2;
+TraitA_T1 -> TraitB_T2;
+TraitA_T1 -> TraitC_T3;
+TraitB_T2 -> TraitC_T3;
+}
\ No newline at end of file
diff --git a/sourcecodes/data/example_time_series/TEbk.txt b/sourcecodes/data/example_time_series/TEbk.txt
new file mode 100644
index 00000000..29d6383b
--- /dev/null
+++ b/sourcecodes/data/example_time_series/TEbk.txt
@@ -0,0 +1 @@
+100
diff --git a/sourcecodes/data/example_time_series/TEbmap.txt b/sourcecodes/data/example_time_series/TEbmap.txt
new file mode 100644
index 00000000..a9e0ef24
--- /dev/null
+++ b/sourcecodes/data/example_time_series/TEbmap.txt
@@ -0,0 +1,10 @@
+Genotype	1	0.499053	1.462000
+TraitA_T1	1	1.306059	0.037189
+TraitA_T2	1	1.304164	-0.061147
+TraitA_T3	1	1.174305	-0.083449
+TraitB_T1	2	0.929161	-0.056347
+TraitB_T2	1	1.021691	-0.045299
+TraitB_T3	1	0.940946	0.012204
+TraitC_T1	1	0.907725	-0.001607
+TraitC_T2	1	0.923711	0.091657
+TraitC_T3	1	1.015189	0.017718
diff --git a/sourcecodes/data/example_time_series/TEbmapdata.txt b/sourcecodes/data/example_time_series/TEbmapdata.txt
new file mode 100644
index 00000000..7e9af6ce
--- /dev/null
+++ b/sourcecodes/data/example_time_series/TEbmapdata.txt
@@ -0,0 +1 @@
+TraitC_T2	TraitC_T1	TraitB_T3	TraitB_T1	Genotype	TraitA_T3	TraitA_T2	TraitA_T1	TraitB_T2	TraitC_T3
diff --git a/sourcecodes/data/example_time_series/TEbname.txt b/sourcecodes/data/example_time_series/TEbname.txt
new file mode 100644
index 00000000..69919d0f
--- /dev/null
+++ b/sourcecodes/data/example_time_series/TEbname.txt
@@ -0,0 +1 @@
+Genotype	TraitA_T1	TraitA_T2	TraitA_T3	TraitB_T1	TraitB_T2	TraitB_T3	TraitC_T1	TraitC_T2	TraitC_T3
diff --git a/sourcecodes/data/example_time_series/TEbnet_figure.txt b/sourcecodes/data/example_time_series/TEbnet_figure.txt
new file mode 100644
index 00000000..7b46ba95
--- /dev/null
+++ b/sourcecodes/data/example_time_series/TEbnet_figure.txt
@@ -0,0 +1,963 @@
+10
+1500	1200	
+TraitC_T2	0	0
+TraitC_T1	250	0
+TraitB_T3	500	0
+TraitB_T1	750	0
+Genotype	1000	0
+TraitA_T3	275	240
+TraitA_T2	650	240
+TraitA_T1	1025	240
+TraitB_T2	500	480
+TraitC_T3	650	720
+TraitC_T2	1
+250	150
+0
+0
+-4.0699	0.0001
+-3.9911	0.0002
+-3.9123	0.0002
+-3.8335	0.0003
+-3.7548	0.0004
+-3.6760	0.0005
+-3.5972	0.0007
+-3.5185	0.0009
+-3.4397	0.0012
+-3.3609	0.0015
+-3.2821	0.0020
+-3.2034	0.0025
+-3.1246	0.0032
+-3.0458	0.0041
+-2.9670	0.0052
+-2.8883	0.0065
+-2.8095	0.0081
+-2.7307	0.0101
+-2.6520	0.0124
+-2.5732	0.0152
+-2.4944	0.0185
+-2.4156	0.0224
+-2.3369	0.0269
+-2.2581	0.0322
+-2.1793	0.0382
+-2.1006	0.0451
+-2.0218	0.0529
+-1.9430	0.0617
+-1.8642	0.0716
+-1.7855	0.0824
+-1.7067	0.0944
+-1.6279	0.1074
+-1.5492	0.1215
+-1.4704	0.1366
+-1.3916	0.1526
+-1.3128	0.1695
+-1.2341	0.1871
+-1.1553	0.2052
+-1.0765	0.2238
+-0.9978	0.2425
+-0.9190	0.2612
+-0.8402	0.2796
+-0.7614	0.2975
+-0.6827	0.3147
+-0.6039	0.3308
+-0.5251	0.3456
+-0.4464	0.3588
+-0.3676	0.3703
+-0.2888	0.3799
+-0.2100	0.3873
+-0.1313	0.3924
+-0.0525	0.3952
+0.0263	0.3956
+0.1050	0.3936
+0.1838	0.3892
+0.2626	0.3826
+0.3414	0.3737
+0.4201	0.3629
+0.4989	0.3502
+0.5777	0.3358
+0.6564	0.3202
+0.7352	0.3033
+0.8140	0.2857
+0.8928	0.2674
+0.9715	0.2487
+1.0503	0.2300
+1.1291	0.2114
+1.2078	0.1930
+1.2866	0.1753
+1.3654	0.1581
+1.4442	0.1418
+1.5229	0.1264
+1.6017	0.1120
+1.6805	0.0986
+1.7592	0.0863
+1.8380	0.0751
+1.9168	0.0649
+1.9956	0.0558
+2.0743	0.0476
+2.1531	0.0404
+2.2319	0.0341
+2.3106	0.0286
+2.3894	0.0238
+2.4682	0.0197
+2.5470	0.0163
+2.6257	0.0133
+2.7045	0.0108
+2.7833	0.0087
+2.8620	0.0070
+2.9408	0.0056
+3.0196	0.0045
+3.0984	0.0035
+3.1771	0.0028
+3.2559	0.0021
+3.3347	0.0017
+3.4134	0.0013
+3.4922	0.0010
+3.5710	0.0007
+3.6498	0.0006
+3.7285	0.0004
+3.8073	0.0003
+TraitC_T1	1
+250	150
+0
+0
+-3.8413	0.0003
+-3.7581	0.0004
+-3.6749	0.0005
+-3.5917	0.0007
+-3.5086	0.0009
+-3.4254	0.0012
+-3.3422	0.0016
+-3.2591	0.0021
+-3.1759	0.0028
+-3.0927	0.0036
+-3.0095	0.0046
+-2.9264	0.0059
+-2.8432	0.0074
+-2.7600	0.0093
+-2.6768	0.0116
+-2.5937	0.0144
+-2.5105	0.0178
+-2.4273	0.0218
+-2.3441	0.0265
+-2.2610	0.0320
+-2.1778	0.0384
+-2.0946	0.0457
+-2.0114	0.0540
+-1.9283	0.0635
+-1.8451	0.0741
+-1.7619	0.0859
+-1.6787	0.0989
+-1.5956	0.1131
+-1.5124	0.1284
+-1.4292	0.1448
+-1.3460	0.1623
+-1.2629	0.1806
+-1.1797	0.1995
+-1.0965	0.2190
+-1.0133	0.2388
+-0.9302	0.2585
+-0.8470	0.2781
+-0.7638	0.2970
+-0.6806	0.3151
+-0.5975	0.3320
+-0.5143	0.3475
+-0.4311	0.3612
+-0.3479	0.3729
+-0.2648	0.3824
+-0.1816	0.3894
+-0.0984	0.3939
+-0.0152	0.3957
+0.0679	0.3949
+0.1511	0.3914
+0.2343	0.3852
+0.3174	0.3766
+0.4006	0.3657
+0.4838	0.3527
+0.5670	0.3379
+0.6501	0.3215
+0.7333	0.3038
+0.8165	0.2851
+0.8997	0.2657
+0.9828	0.2460
+1.0660	0.2262
+1.1492	0.2066
+1.2324	0.1874
+1.3155	0.1689
+1.3987	0.1511
+1.4819	0.1343
+1.5651	0.1186
+1.6482	0.1040
+1.7314	0.0905
+1.8146	0.0783
+1.8978	0.0673
+1.9809	0.0574
+2.0641	0.0486
+2.1473	0.0409
+2.2305	0.0342
+2.3136	0.0284
+2.3968	0.0234
+2.4800	0.0192
+2.5632	0.0156
+2.6463	0.0126
+2.7295	0.0101
+2.8127	0.0081
+2.8959	0.0064
+2.9790	0.0050
+3.0622	0.0039
+3.1454	0.0030
+3.2286	0.0023
+3.3117	0.0018
+3.3949	0.0014
+3.4781	0.0010
+3.5613	0.0008
+3.6444	0.0006
+3.7276	0.0004
+3.8108	0.0003
+3.8940	0.0002
+3.9771	0.0002
+4.0603	0.0001
+4.1435	0.0001
+4.2266	0.0001
+4.3098	0.0000
+4.3930	0.0000
+4.4762	0.0000
+TraitB_T3	1
+250	150
+0
+0
+-3.8488	0.0003
+-3.7734	0.0004
+-3.6979	0.0005
+-3.6224	0.0006
+-3.5469	0.0008
+-3.4714	0.0011
+-3.3959	0.0014
+-3.3205	0.0017
+-3.2450	0.0022
+-3.1695	0.0028
+-3.0940	0.0036
+-3.0185	0.0045
+-2.9430	0.0056
+-2.8676	0.0069
+-2.7921	0.0085
+-2.7166	0.0105
+-2.6411	0.0128
+-2.5656	0.0155
+-2.4902	0.0187
+-2.4147	0.0225
+-2.3392	0.0268
+-2.2637	0.0318
+-2.1882	0.0375
+-2.1127	0.0440
+-2.0373	0.0513
+-1.9618	0.0596
+-1.8863	0.0687
+-1.8108	0.0788
+-1.7353	0.0899
+-1.6598	0.1020
+-1.5844	0.1151
+-1.5089	0.1291
+-1.4334	0.1440
+-1.3579	0.1597
+-1.2824	0.1762
+-1.2070	0.1933
+-1.1315	0.2108
+-1.0560	0.2286
+-0.9805	0.2466
+-0.9050	0.2645
+-0.8295	0.2821
+-0.7541	0.2992
+-0.6786	0.3155
+-0.6031	0.3309
+-0.5276	0.3451
+-0.4521	0.3579
+-0.3766	0.3691
+-0.3012	0.3785
+-0.2257	0.3860
+-0.1502	0.3914
+-0.0747	0.3947
+0.0008	0.3958
+0.0762	0.3946
+0.1517	0.3913
+0.2272	0.3858
+0.3027	0.3783
+0.3782	0.3689
+0.4537	0.3577
+0.5291	0.3448
+0.6046	0.3306
+0.6801	0.3152
+0.7556	0.2988
+0.8311	0.2817
+0.9066	0.2641
+0.9820	0.2462
+1.0575	0.2283
+1.1330	0.2104
+1.2085	0.1929
+1.2840	0.1758
+1.3595	0.1594
+1.4349	0.1437
+1.5104	0.1288
+1.5859	0.1148
+1.6614	0.1018
+1.7369	0.0897
+1.8123	0.0786
+1.8878	0.0685
+1.9633	0.0594
+2.0388	0.0512
+2.1143	0.0439
+2.1898	0.0374
+2.2652	0.0317
+2.3407	0.0267
+2.4162	0.0224
+2.4917	0.0186
+2.5672	0.0155
+2.6427	0.0127
+2.7181	0.0104
+2.7936	0.0085
+2.8691	0.0069
+2.9446	0.0056
+3.0201	0.0044
+3.0955	0.0035
+3.1710	0.0028
+3.2465	0.0022
+3.3220	0.0017
+3.3975	0.0014
+3.4730	0.0010
+3.5484	0.0008
+3.6239	0.0006
+3.6994	0.0005
+TraitB_T1	1
+250	150
+0
+0
+-3.7153	0.0004
+-3.6359	0.0006
+-3.5565	0.0008
+-3.4772	0.0010
+-3.3978	0.0013
+-3.3184	0.0018
+-3.2390	0.0023
+-3.1596	0.0029
+-3.0802	0.0037
+-3.0009	0.0047
+-2.9215	0.0059
+-2.8421	0.0074
+-2.7627	0.0093
+-2.6833	0.0114
+-2.6039	0.0141
+-2.5246	0.0172
+-2.4452	0.0209
+-2.3658	0.0252
+-2.2864	0.0302
+-2.2070	0.0360
+-2.1277	0.0427
+-2.0483	0.0502
+-1.9689	0.0587
+-1.8895	0.0683
+-1.8101	0.0789
+-1.7307	0.0906
+-1.6514	0.1034
+-1.5720	0.1173
+-1.4926	0.1322
+-1.4132	0.1481
+-1.3338	0.1649
+-1.2544	0.1824
+-1.1751	0.2006
+-1.0957	0.2192
+-1.0163	0.2381
+-0.9369	0.2570
+-0.8575	0.2756
+-0.7781	0.2938
+-0.6988	0.3112
+-0.6194	0.3277
+-0.5400	0.3429
+-0.4606	0.3565
+-0.3812	0.3685
+-0.3019	0.3784
+-0.2225	0.3863
+-0.1431	0.3918
+-0.0637	0.3950
+0.0157	0.3957
+0.0951	0.3940
+0.1744	0.3899
+0.2538	0.3834
+0.3332	0.3747
+0.4126	0.3640
+0.4920	0.3513
+0.5714	0.3370
+0.6507	0.3213
+0.7301	0.3045
+0.8095	0.2867
+0.8889	0.2683
+0.9683	0.2495
+1.0477	0.2306
+1.1270	0.2118
+1.2064	0.1934
+1.2858	0.1754
+1.3652	0.1582
+1.4446	0.1417
+1.5239	0.1262
+1.6033	0.1117
+1.6827	0.0982
+1.7621	0.0859
+1.8415	0.0746
+1.9209	0.0644
+2.0002	0.0553
+2.0796	0.0471
+2.1590	0.0399
+2.2384	0.0336
+2.3178	0.0281
+2.3972	0.0234
+2.4765	0.0194
+2.5559	0.0159
+2.6353	0.0130
+2.7147	0.0105
+2.7941	0.0085
+2.8735	0.0068
+2.9528	0.0054
+3.0322	0.0043
+3.1116	0.0034
+3.1910	0.0026
+3.2704	0.0020
+3.3497	0.0016
+3.4291	0.0012
+3.5085	0.0009
+3.5879	0.0007
+3.6673	0.0005
+3.7467	0.0004
+3.8260	0.0003
+3.9054	0.0002
+3.9848	0.0002
+4.0642	0.0001
+4.1436	0.0001
+4.2230	0.0001
+Genotype	2
+250	150
+0
+4	6	7	8	9
+1	0.5380
+2	0.4620
+TraitA_T3	1
+250	150
+1	5
+0
+-3.6094	0.0007
+-3.5392	0.0008
+-3.4689	0.0011
+-3.3987	0.0013
+-3.3285	0.0017
+-3.2582	0.0021
+-3.1880	0.0027
+-3.1177	0.0033
+-3.0475	0.0041
+-2.9773	0.0050
+-2.9070	0.0062
+-2.8368	0.0075
+-2.7665	0.0092
+-2.6963	0.0111
+-2.6261	0.0133
+-2.5558	0.0159
+-2.4856	0.0189
+-2.4154	0.0224
+-2.3451	0.0264
+-2.2749	0.0310
+-2.2046	0.0362
+-2.1344	0.0421
+-2.0642	0.0486
+-1.9939	0.0559
+-1.9237	0.0641
+-1.8534	0.0730
+-1.7832	0.0828
+-1.7130	0.0934
+-1.6427	0.1049
+-1.5725	0.1172
+-1.5022	0.1304
+-1.4320	0.1443
+-1.3618	0.1589
+-1.2915	0.1742
+-1.2213	0.1900
+-1.1510	0.2062
+-1.0808	0.2227
+-1.0106	0.2394
+-0.9403	0.2561
+-0.8701	0.2727
+-0.7999	0.2889
+-0.7296	0.3046
+-0.6594	0.3195
+-0.5891	0.3336
+-0.5189	0.3467
+-0.4487	0.3585
+-0.3784	0.3688
+-0.3082	0.3777
+-0.2379	0.3849
+-0.1677	0.3903
+-0.0975	0.3939
+-0.0272	0.3956
+0.0430	0.3954
+0.1133	0.3933
+0.1835	0.3893
+0.2537	0.3834
+0.3240	0.3759
+0.3942	0.3666
+0.4645	0.3559
+0.5347	0.3438
+0.6049	0.3306
+0.6752	0.3162
+0.7454	0.3011
+0.8156	0.2853
+0.8859	0.2690
+0.9561	0.2524
+1.0264	0.2357
+1.0966	0.2190
+1.1668	0.2025
+1.2371	0.1864
+1.3073	0.1707
+1.3776	0.1556
+1.4478	0.1411
+1.5180	0.1273
+1.5883	0.1144
+1.6585	0.1022
+1.7288	0.0909
+1.7990	0.0805
+1.8692	0.0709
+1.9395	0.0622
+2.0097	0.0542
+2.0799	0.0471
+2.1502	0.0407
+2.2204	0.0350
+2.2907	0.0299
+2.3609	0.0255
+2.4311	0.0216
+2.5014	0.0182
+2.5716	0.0153
+2.6419	0.0128
+2.7121	0.0106
+2.7823	0.0088
+2.8526	0.0072
+2.9228	0.0059
+2.9931	0.0048
+3.0633	0.0039
+3.1335	0.0032
+3.2038	0.0025
+3.2740	0.0020
+3.3443	0.0016
+3.4145	0.0013
+TraitA_T2	1
+250	150
+1	5
+0
+-3.5730	0.0007
+-3.5043	0.0009
+-3.4357	0.0012
+-3.3670	0.0015
+-3.2984	0.0019
+-3.2298	0.0023
+-3.1611	0.0029
+-3.0925	0.0036
+-3.0239	0.0044
+-2.9552	0.0054
+-2.8866	0.0066
+-2.8180	0.0079
+-2.7493	0.0096
+-2.6807	0.0115
+-2.6121	0.0138
+-2.5434	0.0164
+-2.4748	0.0194
+-2.4062	0.0229
+-2.3375	0.0269
+-2.2689	0.0314
+-2.2003	0.0365
+-2.1316	0.0423
+-2.0630	0.0487
+-1.9943	0.0559
+-1.9257	0.0638
+-1.8571	0.0725
+-1.7884	0.0820
+-1.7198	0.0923
+-1.6512	0.1035
+-1.5825	0.1154
+-1.5139	0.1281
+-1.4453	0.1416
+-1.3766	0.1558
+-1.3080	0.1705
+-1.2394	0.1859
+-1.1707	0.2016
+-1.1021	0.2177
+-1.0335	0.2340
+-0.9648	0.2503
+-0.8962	0.2666
+-0.8276	0.2825
+-0.7589	0.2981
+-0.6903	0.3131
+-0.6216	0.3272
+-0.5530	0.3405
+-0.4844	0.3526
+-0.4157	0.3635
+-0.3471	0.3730
+-0.2785	0.3810
+-0.2098	0.3873
+-0.1412	0.3919
+-0.0726	0.3948
+-0.0039	0.3958
+0.0647	0.3950
+0.1333	0.3923
+0.2020	0.3879
+0.2706	0.3818
+0.3392	0.3740
+0.4079	0.3647
+0.4765	0.3539
+0.5451	0.3419
+0.6138	0.3288
+0.6824	0.3147
+0.7511	0.2998
+0.8197	0.2844
+0.8883	0.2684
+0.9570	0.2522
+1.0256	0.2359
+1.0942	0.2196
+1.1629	0.2034
+1.2315	0.1876
+1.3001	0.1723
+1.3688	0.1574
+1.4374	0.1432
+1.5060	0.1296
+1.5747	0.1168
+1.6433	0.1048
+1.7119	0.0936
+1.7806	0.0832
+1.8492	0.0736
+1.9178	0.0648
+1.9865	0.0568
+2.0551	0.0495
+2.1238	0.0430
+2.1924	0.0372
+2.2610	0.0320
+2.3297	0.0274
+2.3983	0.0233
+2.4669	0.0198
+2.5356	0.0167
+2.6042	0.0141
+2.6728	0.0118
+2.7415	0.0098
+2.8101	0.0081
+2.8787	0.0067
+2.9474	0.0055
+3.0160	0.0045
+3.0846	0.0037
+3.1533	0.0030
+3.2219	0.0024
+3.2905	0.0019
+TraitA_T1	1
+250	150
+1	5
+2	9	10
+-4.4430	0.0000
+-4.3666	0.0000
+-4.2903	0.0000
+-4.2139	0.0001
+-4.1375	0.0001
+-4.0611	0.0001
+-3.9847	0.0002
+-3.9083	0.0002
+-3.8320	0.0003
+-3.7556	0.0004
+-3.6792	0.0005
+-3.6028	0.0007
+-3.5264	0.0009
+-3.4500	0.0011
+-3.3737	0.0015
+-3.2973	0.0019
+-3.2209	0.0024
+-3.1445	0.0030
+-3.0681	0.0039
+-2.9918	0.0048
+-2.9154	0.0060
+-2.8390	0.0075
+-2.7626	0.0093
+-2.6862	0.0114
+-2.6098	0.0139
+-2.5335	0.0168
+-2.4571	0.0203
+-2.3807	0.0243
+-2.3043	0.0290
+-2.2279	0.0344
+-2.1515	0.0406
+-2.0752	0.0475
+-1.9988	0.0554
+-1.9224	0.0642
+-1.8460	0.0740
+-1.7696	0.0848
+-1.6932	0.0965
+-1.6169	0.1093
+-1.5405	0.1231
+-1.4641	0.1378
+-1.3877	0.1534
+-1.3113	0.1698
+-1.2350	0.1869
+-1.1586	0.2044
+-1.0822	0.2224
+-1.0058	0.2406
+-0.9294	0.2587
+-0.8530	0.2767
+-0.7767	0.2941
+-0.7003	0.3109
+-0.6239	0.3268
+-0.5475	0.3415
+-0.4711	0.3548
+-0.3947	0.3666
+-0.3184	0.3765
+-0.2420	0.3845
+-0.1656	0.3905
+-0.0892	0.3942
+-0.0128	0.3957
+0.0636	0.3950
+0.1399	0.3920
+0.2163	0.3868
+0.2927	0.3794
+0.3691	0.3701
+0.4455	0.3590
+0.5218	0.3461
+0.5982	0.3319
+0.6746	0.3164
+0.7510	0.2999
+0.8274	0.2826
+0.9038	0.2648
+0.9801	0.2467
+1.0565	0.2285
+1.1329	0.2105
+1.2093	0.1927
+1.2857	0.1755
+1.3621	0.1588
+1.4384	0.1430
+1.5148	0.1280
+1.5912	0.1139
+1.6676	0.1007
+1.7440	0.0886
+1.8204	0.0775
+1.8967	0.0674
+1.9731	0.0583
+2.0495	0.0501
+2.1259	0.0428
+2.2023	0.0364
+2.2786	0.0307
+2.3550	0.0258
+2.4314	0.0216
+2.5078	0.0179
+2.5842	0.0148
+2.6606	0.0122
+2.7369	0.0099
+2.8133	0.0081
+2.8897	0.0065
+2.9661	0.0052
+3.0425	0.0042
+3.1189	0.0033
+3.1952	0.0026
+TraitB_T2	1
+250	150
+2	5	8
+1	10
+-3.6634	0.0006
+-3.5878	0.0008
+-3.5122	0.0010
+-3.4365	0.0013
+-3.3609	0.0017
+-3.2853	0.0021
+-3.2097	0.0027
+-3.1340	0.0034
+-3.0584	0.0043
+-2.9828	0.0053
+-2.9072	0.0066
+-2.8315	0.0081
+-2.7559	0.0100
+-2.6803	0.0122
+-2.6046	0.0148
+-2.5290	0.0178
+-2.4534	0.0214
+-2.3778	0.0255
+-2.3021	0.0302
+-2.2265	0.0357
+-2.1509	0.0419
+-2.0753	0.0489
+-1.9996	0.0568
+-1.9240	0.0655
+-1.8484	0.0752
+-1.7727	0.0858
+-1.6971	0.0975
+-1.6215	0.1100
+-1.5459	0.1235
+-1.4702	0.1379
+-1.3946	0.1532
+-1.3190	0.1692
+-1.2434	0.1858
+-1.1677	0.2029
+-1.0921	0.2204
+-1.0165	0.2381
+-0.9408	0.2557
+-0.8652	0.2732
+-0.7896	0.2902
+-0.7140	0.3066
+-0.6383	0.3222
+-0.5627	0.3366
+-0.4871	0.3498
+-0.4115	0.3615
+-0.3358	0.3715
+-0.2602	0.3797
+-0.1846	0.3859
+-0.1089	0.3901
+-0.0333	0.3921
+0.0423	0.3920
+0.1179	0.3897
+0.1936	0.3853
+0.2692	0.3788
+0.3448	0.3704
+0.4205	0.3602
+0.4961	0.3483
+0.5717	0.3350
+0.6473	0.3204
+0.7230	0.3047
+0.7986	0.2882
+0.8742	0.2711
+0.9498	0.2536
+1.0255	0.2359
+1.1011	0.2183
+1.1767	0.2008
+1.2524	0.1838
+1.3280	0.1672
+1.4036	0.1513
+1.4792	0.1362
+1.5549	0.1219
+1.6305	0.1085
+1.7061	0.0960
+1.7817	0.0845
+1.8574	0.0740
+1.9330	0.0644
+2.0086	0.0558
+2.0843	0.0480
+2.1599	0.0411
+2.2355	0.0350
+2.3111	0.0296
+2.3868	0.0250
+2.4624	0.0209
+2.5380	0.0174
+2.6136	0.0144
+2.6893	0.0119
+2.7649	0.0097
+2.8405	0.0079
+2.9162	0.0064
+2.9918	0.0052
+3.0674	0.0041
+3.1430	0.0033
+3.2187	0.0026
+3.2943	0.0021
+3.3699	0.0016
+3.4455	0.0013
+3.5212	0.0010
+3.5968	0.0008
+3.6724	0.0006
+3.7481	0.0004
+3.8237	0.0003
+3.8993	0.0003
+TraitC_T3	1
+250	150
+2	8	9
+0
+-4.6954	0.0000
+-4.6103	0.0000
+-4.5253	0.0000
+-4.4402	0.0000
+-4.3551	0.0000
+-4.2701	0.0001
+-4.1850	0.0001
+-4.1000	0.0001
+-4.0149	0.0002
+-3.9298	0.0002
+-3.8448	0.0003
+-3.7597	0.0005
+-3.6746	0.0006
+-3.5896	0.0008
+-3.5045	0.0011
+-3.4195	0.0015
+-3.3344	0.0019
+-3.2493	0.0025
+-3.1643	0.0033
+-3.0792	0.0042
+-2.9942	0.0054
+-2.9091	0.0069
+-2.8240	0.0087
+-2.7390	0.0109
+-2.6539	0.0135
+-2.5688	0.0167
+-2.4838	0.0205
+-2.3987	0.0250
+-2.3137	0.0303
+-2.2286	0.0364
+-2.1435	0.0435
+-2.0585	0.0516
+-1.9734	0.0608
+-1.8884	0.0711
+-1.8033	0.0826
+-1.7182	0.0953
+-1.6332	0.1091
+-1.5481	0.1242
+-1.4630	0.1403
+-1.3780	0.1575
+-1.2929	0.1755
+-1.2079	0.1943
+-1.1228	0.2136
+-1.0377	0.2331
+-0.9527	0.2527
+-0.8676	0.2721
+-0.7825	0.2910
+-0.6975	0.3090
+-0.6124	0.3259
+-0.5274	0.3413
+-0.4423	0.3550
+-0.3572	0.3667
+-0.2722	0.3762
+-0.1871	0.3833
+-0.1021	0.3878
+-0.0170	0.3897
+0.0681	0.3889
+0.1531	0.3854
+0.2382	0.3793
+0.3233	0.3708
+0.4083	0.3599
+0.4934	0.3470
+0.5784	0.3322
+0.6635	0.3159
+0.7486	0.2983
+0.8336	0.2797
+0.9187	0.2605
+1.0038	0.2410
+1.0888	0.2214
+1.1739	0.2019
+1.2589	0.1829
+1.3440	0.1646
+1.4291	0.1471
+1.5141	0.1305
+1.5992	0.1150
+1.6842	0.1007
+1.7693	0.0875
+1.8544	0.0755
+1.9394	0.0648
+2.0245	0.0551
+2.1096	0.0466
+2.1946	0.0391
+2.2797	0.0326
+2.3647	0.0270
+2.4498	0.0222
+2.5349	0.0182
+2.6199	0.0147
+2.7050	0.0119
+2.7900	0.0095
+2.8751	0.0075
+2.9602	0.0060
+3.0452	0.0047
+3.1303	0.0036
+3.2154	0.0028
+3.3004	0.0022
+3.3855	0.0016
+3.4705	0.0012
+3.5556	0.0009
+3.6407	0.0007
+3.7257	0.0005
+3.8108	0.0004
diff --git a/sourcecodes/data/example_time_series/TEbnet_figure_new.txt b/sourcecodes/data/example_time_series/TEbnet_figure_new.txt
new file mode 100644
index 00000000..4dd4fcc9
--- /dev/null
+++ b/sourcecodes/data/example_time_series/TEbnet_figure_new.txt
@@ -0,0 +1,864 @@
+8	
+10
+1500	1200	
+TraitC_T2	0	0
+TraitC_T1	250	0
+TraitB_T3	500	0
+TraitB_T1	750	0
+Genotype	1000	0
+TraitA_T3	275	240
+TraitA_T2	650	240
+TraitA_T1	1025	240
+TraitB_T2	500	480
+TraitC_T3	650	720
+TraitC_T2	1
+250	150
+0
+0
+-4.0699	0.0001
+-3.9911	0.0002
+-3.9123	0.0002
+-3.8335	0.0003
+-3.7548	0.0004
+-3.6760	0.0005
+-3.5972	0.0007
+-3.5185	0.0009
+-3.4397	0.0012
+-3.3609	0.0015
+-3.2821	0.0020
+-3.2034	0.0025
+-3.1246	0.0032
+-3.0458	0.0041
+-2.9670	0.0052
+-2.8883	0.0065
+-2.8095	0.0081
+-2.7307	0.0101
+-2.6520	0.0124
+-2.5732	0.0152
+-2.4944	0.0185
+-2.4156	0.0224
+-2.3369	0.0269
+-2.2581	0.0322
+-2.1793	0.0382
+-2.1006	0.0451
+-2.0218	0.0529
+-1.9430	0.0617
+-1.8642	0.0716
+-1.7855	0.0824
+-1.7067	0.0944
+-1.6279	0.1074
+-1.5492	0.1215
+-1.4704	0.1366
+-1.3916	0.1526
+-1.3128	0.1695
+-1.2341	0.1871
+-1.1553	0.2052
+-1.0765	0.2238
+-0.9978	0.2425
+-0.9190	0.2612
+-0.8402	0.2796
+-0.7614	0.2975
+-0.6827	0.3147
+-0.6039	0.3308
+-0.5251	0.3456
+-0.4464	0.3588
+-0.3676	0.3703
+-0.2888	0.3799
+-0.2100	0.3873
+-0.1313	0.3924
+-0.0525	0.3952
+0.0263	0.3956
+0.1050	0.3936
+0.1838	0.3892
+0.2626	0.3826
+0.3414	0.3737
+0.4201	0.3629
+0.4989	0.3502
+0.5777	0.3358
+0.6564	0.3202
+0.7352	0.3033
+0.8140	0.2857
+0.8928	0.2674
+0.9715	0.2487
+1.0503	0.2300
+1.1291	0.2114
+1.2078	0.1930
+1.2866	0.1753
+1.3654	0.1581
+1.4442	0.1418
+1.5229	0.1264
+1.6017	0.1120
+1.6805	0.0986
+1.7592	0.0863
+1.8380	0.0751
+1.9168	0.0649
+1.9956	0.0558
+2.0743	0.0476
+2.1531	0.0404
+2.2319	0.0341
+2.3106	0.0286
+2.3894	0.0238
+2.4682	0.0197
+2.5470	0.0163
+2.6257	0.0133
+2.7045	0.0108
+2.7833	0.0087
+2.8620	0.0070
+2.9408	0.0056
+3.0196	0.0045
+3.0984	0.0035
+3.1771	0.0028
+3.2559	0.0021
+3.3347	0.0017
+3.4134	0.0013
+3.4922	0.0010
+3.5710	0.0007
+3.6498	0.0006
+3.7285	0.0004
+3.8073	0.0003
+TraitC_T1	1
+250	150
+0
+0
+-3.8413	0.0003
+-3.7581	0.0004
+-3.6749	0.0005
+-3.5917	0.0007
+-3.5086	0.0009
+-3.4254	0.0012
+-3.3422	0.0016
+-3.2591	0.0021
+-3.1759	0.0028
+-3.0927	0.0036
+-3.0095	0.0046
+-2.9264	0.0059
+-2.8432	0.0074
+-2.7600	0.0093
+-2.6768	0.0116
+-2.5937	0.0144
+-2.5105	0.0178
+-2.4273	0.0218
+-2.3441	0.0265
+-2.2610	0.0320
+-2.1778	0.0384
+-2.0946	0.0457
+-2.0114	0.0540
+-1.9283	0.0635
+-1.8451	0.0741
+-1.7619	0.0859
+-1.6787	0.0989
+-1.5956	0.1131
+-1.5124	0.1284
+-1.4292	0.1448
+-1.3460	0.1623
+-1.2629	0.1806
+-1.1797	0.1995
+-1.0965	0.2190
+-1.0133	0.2388
+-0.9302	0.2585
+-0.8470	0.2781
+-0.7638	0.2970
+-0.6806	0.3151
+-0.5975	0.3320
+-0.5143	0.3475
+-0.4311	0.3612
+-0.3479	0.3729
+-0.2648	0.3824
+-0.1816	0.3894
+-0.0984	0.3939
+-0.0152	0.3957
+0.0679	0.3949
+0.1511	0.3914
+0.2343	0.3852
+0.3174	0.3766
+0.4006	0.3657
+0.4838	0.3527
+0.5670	0.3379
+0.6501	0.3215
+0.7333	0.3038
+0.8165	0.2851
+0.8997	0.2657
+0.9828	0.2460
+1.0660	0.2262
+1.1492	0.2066
+1.2324	0.1874
+1.3155	0.1689
+1.3987	0.1511
+1.4819	0.1343
+1.5651	0.1186
+1.6482	0.1040
+1.7314	0.0905
+1.8146	0.0783
+1.8978	0.0673
+1.9809	0.0574
+2.0641	0.0486
+2.1473	0.0409
+2.2305	0.0342
+2.3136	0.0284
+2.3968	0.0234
+2.4800	0.0192
+2.5632	0.0156
+2.6463	0.0126
+2.7295	0.0101
+2.8127	0.0081
+2.8959	0.0064
+2.9790	0.0050
+3.0622	0.0039
+3.1454	0.0030
+3.2286	0.0023
+3.3117	0.0018
+3.3949	0.0014
+3.4781	0.0010
+3.5613	0.0008
+3.6444	0.0006
+3.7276	0.0004
+3.8108	0.0003
+3.8940	0.0002
+3.9771	0.0002
+4.0603	0.0001
+4.1435	0.0001
+4.2266	0.0001
+4.3098	0.0000
+4.3930	0.0000
+4.4762	0.0000
+TraitB_T3	1
+250	150
+0
+0
+-3.8488	0.0003
+-3.7734	0.0004
+-3.6979	0.0005
+-3.6224	0.0006
+-3.5469	0.0008
+-3.4714	0.0011
+-3.3959	0.0014
+-3.3205	0.0017
+-3.2450	0.0022
+-3.1695	0.0028
+-3.0940	0.0036
+-3.0185	0.0045
+-2.9430	0.0056
+-2.8676	0.0069
+-2.7921	0.0085
+-2.7166	0.0105
+-2.6411	0.0128
+-2.5656	0.0155
+-2.4902	0.0187
+-2.4147	0.0225
+-2.3392	0.0268
+-2.2637	0.0318
+-2.1882	0.0375
+-2.1127	0.0440
+-2.0373	0.0513
+-1.9618	0.0596
+-1.8863	0.0687
+-1.8108	0.0788
+-1.7353	0.0899
+-1.6598	0.1020
+-1.5844	0.1151
+-1.5089	0.1291
+-1.4334	0.1440
+-1.3579	0.1597
+-1.2824	0.1762
+-1.2070	0.1933
+-1.1315	0.2108
+-1.0560	0.2286
+-0.9805	0.2466
+-0.9050	0.2645
+-0.8295	0.2821
+-0.7541	0.2992
+-0.6786	0.3155
+-0.6031	0.3309
+-0.5276	0.3451
+-0.4521	0.3579
+-0.3766	0.3691
+-0.3012	0.3785
+-0.2257	0.3860
+-0.1502	0.3914
+-0.0747	0.3947
+0.0008	0.3958
+0.0762	0.3946
+0.1517	0.3913
+0.2272	0.3858
+0.3027	0.3783
+0.3782	0.3689
+0.4537	0.3577
+0.5291	0.3448
+0.6046	0.3306
+0.6801	0.3152
+0.7556	0.2988
+0.8311	0.2817
+0.9066	0.2641
+0.9820	0.2462
+1.0575	0.2283
+1.1330	0.2104
+1.2085	0.1929
+1.2840	0.1758
+1.3595	0.1594
+1.4349	0.1437
+1.5104	0.1288
+1.5859	0.1148
+1.6614	0.1018
+1.7369	0.0897
+1.8123	0.0786
+1.8878	0.0685
+1.9633	0.0594
+2.0388	0.0512
+2.1143	0.0439
+2.1898	0.0374
+2.2652	0.0317
+2.3407	0.0267
+2.4162	0.0224
+2.4917	0.0186
+2.5672	0.0155
+2.6427	0.0127
+2.7181	0.0104
+2.7936	0.0085
+2.8691	0.0069
+2.9446	0.0056
+3.0201	0.0044
+3.0955	0.0035
+3.1710	0.0028
+3.2465	0.0022
+3.3220	0.0017
+3.3975	0.0014
+3.4730	0.0010
+3.5484	0.0008
+3.6239	0.0006
+3.6994	0.0005
+TraitB_T1	1
+250	150
+0
+0
+-3.7153	0.0004
+-3.6359	0.0006
+-3.5565	0.0008
+-3.4772	0.0010
+-3.3978	0.0013
+-3.3184	0.0018
+-3.2390	0.0023
+-3.1596	0.0029
+-3.0802	0.0037
+-3.0009	0.0047
+-2.9215	0.0059
+-2.8421	0.0074
+-2.7627	0.0093
+-2.6833	0.0114
+-2.6039	0.0141
+-2.5246	0.0172
+-2.4452	0.0209
+-2.3658	0.0252
+-2.2864	0.0302
+-2.2070	0.0360
+-2.1277	0.0427
+-2.0483	0.0502
+-1.9689	0.0587
+-1.8895	0.0683
+-1.8101	0.0789
+-1.7307	0.0906
+-1.6514	0.1034
+-1.5720	0.1173
+-1.4926	0.1322
+-1.4132	0.1481
+-1.3338	0.1649
+-1.2544	0.1824
+-1.1751	0.2006
+-1.0957	0.2192
+-1.0163	0.2381
+-0.9369	0.2570
+-0.8575	0.2756
+-0.7781	0.2938
+-0.6988	0.3112
+-0.6194	0.3277
+-0.5400	0.3429
+-0.4606	0.3565
+-0.3812	0.3685
+-0.3019	0.3784
+-0.2225	0.3863
+-0.1431	0.3918
+-0.0637	0.3950
+0.0157	0.3957
+0.0951	0.3940
+0.1744	0.3899
+0.2538	0.3834
+0.3332	0.3747
+0.4126	0.3640
+0.4920	0.3513
+0.5714	0.3370
+0.6507	0.3213
+0.7301	0.3045
+0.8095	0.2867
+0.8889	0.2683
+0.9683	0.2495
+1.0477	0.2306
+1.1270	0.2118
+1.2064	0.1934
+1.2858	0.1754
+1.3652	0.1582
+1.4446	0.1417
+1.5239	0.1262
+1.6033	0.1117
+1.6827	0.0982
+1.7621	0.0859
+1.8415	0.0746
+1.9209	0.0644
+2.0002	0.0553
+2.0796	0.0471
+2.1590	0.0399
+2.2384	0.0336
+2.3178	0.0281
+2.3972	0.0234
+2.4765	0.0194
+2.5559	0.0159
+2.6353	0.0130
+2.7147	0.0105
+2.7941	0.0085
+2.8735	0.0068
+2.9528	0.0054
+3.0322	0.0043
+3.1116	0.0034
+3.1910	0.0026
+3.2704	0.0020
+3.3497	0.0016
+3.4291	0.0012
+3.5085	0.0009
+3.5879	0.0007
+3.6673	0.0005
+3.7467	0.0004
+3.8260	0.0003
+3.9054	0.0002
+3.9848	0.0002
+4.0642	0.0001
+4.1436	0.0001
+4.2230	0.0001
+Genotype	2
+250	150
+0
+4	6	7	8	9
+1	0.9800
+2	0.0200
+TraitA_T3	1
+250	150
+1	5
+0
+-3.6094	0.0000
+-3.5392	0.0000
+-3.4689	0.0000
+-3.3987	0.0000
+-3.3285	0.0000
+-3.2582	0.0000
+-3.1880	0.0000
+-3.1177	0.0000
+-3.0475	0.0001
+-2.9773	0.0001
+-2.9070	0.0002
+-2.8368	0.0003
+-2.7665	0.0004
+-2.6963	0.0007
+-2.6261	0.0012
+-2.5558	0.0019
+-2.4856	0.0029
+-2.4154	0.0044
+-2.3451	0.0067
+-2.2749	0.0100
+-2.2046	0.0145
+-2.1344	0.0208
+-2.0642	0.0293
+-1.9939	0.0405
+-1.9237	0.0552
+-1.8534	0.0738
+-1.7832	0.0970
+-1.7130	0.1254
+-1.6427	0.1592
+-1.5725	0.1988
+-1.5022	0.2440
+-1.4320	0.2943
+-1.3618	0.3489
+-1.2915	0.4067
+-1.2213	0.4658
+-1.1510	0.5245
+-1.0808	0.5805
+-1.0106	0.6315
+-0.9403	0.6752
+-0.8701	0.7097
+-0.7999	0.7331
+-0.7296	0.7444
+-0.6594	0.7430
+-0.5891	0.7289
+-0.5189	0.7029
+-0.4487	0.6662
+-0.3784	0.6206
+-0.3082	0.5683
+-0.2379	0.5116
+-0.1677	0.4526
+-0.0975	0.3936
+-0.0272	0.3364
+0.0430	0.2827
+0.1133	0.2334
+0.1835	0.1895
+0.2537	0.1512
+0.3240	0.1186
+0.3942	0.0914
+0.4645	0.0692
+0.5347	0.0516
+0.6049	0.0378
+0.6752	0.0272
+0.7454	0.0192
+0.8156	0.0134
+0.8859	0.0091
+0.9561	0.0061
+1.0264	0.0040
+1.0966	0.0026
+1.1668	0.0017
+1.2371	0.0010
+1.3073	0.0006
+1.3776	0.0004
+1.4478	0.0002
+1.5180	0.0001
+1.5883	0.0001
+1.6585	0.0000
+1.7288	0.0000
+1.7990	0.0000
+1.8692	0.0000
+1.9395	0.0000
+2.0097	0.0000
+2.0799	0.0000
+2.1502	0.0000
+2.2204	0.0000
+2.2907	0.0000
+2.3609	0.0000
+2.4311	0.0000
+2.5014	0.0000
+2.5716	0.0000
+2.6419	0.0000
+2.7121	0.0000
+2.7823	0.0000
+2.8526	0.0000
+2.9228	0.0000
+2.9931	0.0000
+3.0633	0.0000
+3.1335	0.0000
+3.2038	0.0000
+3.2740	0.0000
+3.3443	0.0000
+3.4145	0.0000
+TraitA_T2	1
+250	150
+1	5
+0
+-3.5730	0.0000
+-3.5043	0.0000
+-3.4357	0.0000
+-3.3670	0.0000
+-3.2984	0.0000
+-3.2298	0.0000
+-3.1611	0.0000
+-3.0925	0.0000
+-3.0239	0.0000
+-2.9552	0.0000
+-2.8866	0.0001
+-2.8180	0.0001
+-2.7493	0.0002
+-2.6807	0.0003
+-2.6121	0.0005
+-2.5434	0.0009
+-2.4748	0.0015
+-2.4062	0.0024
+-2.3375	0.0037
+-2.2689	0.0058
+-2.2003	0.0087
+-2.1316	0.0130
+-2.0630	0.0190
+-1.9943	0.0273
+-1.9257	0.0384
+-1.8571	0.0532
+-1.7884	0.0722
+-1.7198	0.0963
+-1.6512	0.1260
+-1.5825	0.1620
+-1.5139	0.2043
+-1.4453	0.2531
+-1.3766	0.3078
+-1.3080	0.3674
+-1.2394	0.4305
+-1.1707	0.4954
+-1.1021	0.5595
+-1.0335	0.6205
+-0.9648	0.6755
+-0.8962	0.7219
+-0.8276	0.7575
+-0.7589	0.7803
+-0.6903	0.7891
+-0.6216	0.7834
+-0.5530	0.7635
+-0.4844	0.7306
+-0.4157	0.6863
+-0.3471	0.6330
+-0.2785	0.5731
+-0.2098	0.5094
+-0.1412	0.4445
+-0.0726	0.3808
+-0.0039	0.3203
+0.0647	0.2644
+0.1333	0.2144
+0.2020	0.1706
+0.2706	0.1333
+0.3392	0.1022
+0.4079	0.0770
+0.4765	0.0569
+0.5451	0.0413
+0.6138	0.0294
+0.6824	0.0206
+0.7511	0.0141
+0.8197	0.0095
+0.8883	0.0063
+0.9570	0.0041
+1.0256	0.0026
+1.0942	0.0016
+1.1629	0.0010
+1.2315	0.0006
+1.3001	0.0004
+1.3688	0.0002
+1.4374	0.0001
+1.5060	0.0001
+1.5747	0.0000
+1.6433	0.0000
+1.7119	0.0000
+1.7806	0.0000
+1.8492	0.0000
+1.9178	0.0000
+1.9865	0.0000
+2.0551	0.0000
+2.1238	0.0000
+2.1924	0.0000
+2.2610	0.0000
+2.3297	0.0000
+2.3983	0.0000
+2.4669	0.0000
+2.5356	0.0000
+2.6042	0.0000
+2.6728	0.0000
+2.7415	0.0000
+2.8101	0.0000
+2.8787	0.0000
+2.9474	0.0000
+3.0160	0.0000
+3.0846	0.0000
+3.1533	0.0000
+3.2219	0.0000
+3.2905	0.0000
+TraitA_T1	1
+250	150
+1	5
+2	9	10
+1.5029	1.0000
+TraitB_T2	1
+250	150
+2	5	8
+1	10
+-3.6634	0.0000
+-3.5878	0.0000
+-3.5122	0.0000
+-3.4365	0.0000
+-3.3609	0.0000
+-3.2853	0.0000
+-3.2097	0.0000
+-3.1340	0.0000
+-3.0584	0.0000
+-2.9828	0.0000
+-2.9072	0.0000
+-2.8315	0.0000
+-2.7559	0.0000
+-2.6803	0.0000
+-2.6046	0.0000
+-2.5290	0.0000
+-2.4534	0.0000
+-2.3778	0.0000
+-2.3021	0.0001
+-2.2265	0.0001
+-2.1509	0.0002
+-2.0753	0.0003
+-1.9996	0.0005
+-1.9240	0.0007
+-1.8484	0.0011
+-1.7727	0.0016
+-1.6971	0.0024
+-1.6215	0.0035
+-1.5459	0.0050
+-1.4702	0.0071
+-1.3946	0.0099
+-1.3190	0.0136
+-1.2434	0.0185
+-1.1677	0.0249
+-1.0921	0.0330
+-1.0165	0.0432
+-0.9408	0.0558
+-0.8652	0.0712
+-0.7896	0.0896
+-0.7140	0.1112
+-0.6383	0.1364
+-0.5627	0.1650
+-0.4871	0.1971
+-0.4115	0.2323
+-0.3358	0.2702
+-0.2602	0.3103
+-0.1846	0.3517
+-0.1089	0.3935
+-0.0333	0.4345
+0.0423	0.4735
+0.1179	0.5094
+0.1936	0.5408
+0.2692	0.5667
+0.3448	0.5862
+0.4205	0.5985
+0.4961	0.6030
+0.5717	0.5998
+0.6473	0.5888
+0.7230	0.5704
+0.7986	0.5455
+0.8742	0.5149
+0.9498	0.4797
+1.0255	0.4411
+1.1011	0.4004
+1.1767	0.3587
+1.2524	0.3171
+1.3280	0.2768
+1.4036	0.2384
+1.4792	0.2027
+1.5549	0.1701
+1.6305	0.1409
+1.7061	0.1152
+1.7817	0.0929
+1.8574	0.0740
+1.9330	0.0582
+2.0086	0.0451
+2.0843	0.0346
+2.1599	0.0261
+2.2355	0.0195
+2.3111	0.0144
+2.3868	0.0104
+2.4624	0.0075
+2.5380	0.0053
+2.6136	0.0037
+2.6893	0.0026
+2.7649	0.0017
+2.8405	0.0012
+2.9162	0.0008
+2.9918	0.0005
+3.0674	0.0003
+3.1430	0.0002
+3.2187	0.0001
+3.2943	0.0001
+3.3699	0.0001
+3.4455	0.0000
+3.5212	0.0000
+3.5968	0.0000
+3.6724	0.0000
+3.7481	0.0000
+3.8237	0.0000
+3.8993	0.0000
+TraitC_T3	1
+250	150
+2	8	9
+0
+-4.6954	0.0000
+-4.6103	0.0000
+-4.5253	0.0000
+-4.4402	0.0000
+-4.3551	0.0000
+-4.2701	0.0000
+-4.1850	0.0000
+-4.1000	0.0000
+-4.0149	0.0000
+-3.9298	0.0000
+-3.8448	0.0000
+-3.7597	0.0000
+-3.6746	0.0000
+-3.5896	0.0000
+-3.5045	0.0000
+-3.4195	0.0000
+-3.3344	0.0000
+-3.2493	0.0000
+-3.1643	0.0000
+-3.0792	0.0000
+-2.9942	0.0000
+-2.9091	0.0000
+-2.8240	0.0000
+-2.7390	0.0000
+-2.6539	0.0000
+-2.5688	0.0000
+-2.4838	0.0000
+-2.3987	0.0000
+-2.3137	0.0000
+-2.2286	0.0000
+-2.1435	0.0000
+-2.0585	0.0000
+-1.9734	0.0000
+-1.8884	0.0000
+-1.8033	0.0000
+-1.7182	0.0000
+-1.6332	0.0000
+-1.5481	0.0000
+-1.4630	0.0000
+-1.3780	0.0000
+-1.2929	0.0000
+-1.2079	0.0000
+-1.1228	0.0000
+-1.0377	0.0000
+-0.9527	0.0000
+-0.8676	0.0000
+-0.7825	0.0001
+-0.6975	0.0001
+-0.6124	0.0003
+-0.5274	0.0006
+-0.4423	0.0013
+-0.3572	0.0026
+-0.2722	0.0049
+-0.1871	0.0090
+-0.1021	0.0158
+-0.0170	0.0268
+0.0681	0.0438
+0.1531	0.0690
+0.2382	0.1047
+0.3233	0.1533
+0.4083	0.2161
+0.4934	0.2937
+0.5784	0.3846
+0.6635	0.4853
+0.7486	0.5902
+0.8336	0.6917
+0.9187	0.7812
+1.0038	0.8502
+1.0888	0.8917
+1.1739	0.9013
+1.2589	0.8779
+1.3440	0.8241
+1.4291	0.7455
+1.5141	0.6498
+1.5992	0.5459
+1.6842	0.4419
+1.7693	0.3448
+1.8544	0.2592
+1.9394	0.1878
+2.0245	0.1311
+2.1096	0.0882
+2.1946	0.0572
+2.2797	0.0358
+2.3647	0.0215
+2.4498	0.0125
+2.5349	0.0070
+2.6199	0.0038
+2.7050	0.0020
+2.7900	0.0010
+2.8751	0.0005
+2.9602	0.0002
+3.0452	0.0001
+3.1303	0.0000
+3.2154	0.0000
+3.3004	0.0000
+3.3855	0.0000
+3.4705	0.0000
+3.5556	0.0000
+3.6407	0.0000
+3.7257	0.0000
+3.8108	0.0000
diff --git a/sourcecodes/data/example_time_series/TEbnlevels.txt b/sourcecodes/data/example_time_series/TEbnlevels.txt
new file mode 100644
index 00000000..714e56bd
--- /dev/null
+++ b/sourcecodes/data/example_time_series/TEbnlevels.txt
@@ -0,0 +1,2 @@
+Genotype	1	2
+
diff --git a/sourcecodes/data/example_time_series/TEbnnode.txt b/sourcecodes/data/example_time_series/TEbnnode.txt
new file mode 100644
index 00000000..f599e28b
--- /dev/null
+++ b/sourcecodes/data/example_time_series/TEbnnode.txt
@@ -0,0 +1 @@
+10
diff --git a/sourcecodes/data/example_time_series/TEbnrows.txt b/sourcecodes/data/example_time_series/TEbnrows.txt
new file mode 100644
index 00000000..c15fb720
--- /dev/null
+++ b/sourcecodes/data/example_time_series/TEbnrows.txt
@@ -0,0 +1 @@
+501
diff --git a/sourcecodes/data/example_time_series/TEbparent.txt b/sourcecodes/data/example_time_series/TEbparent.txt
new file mode 100644
index 00000000..b8626c4c
--- /dev/null
+++ b/sourcecodes/data/example_time_series/TEbparent.txt
@@ -0,0 +1 @@
+4
diff --git a/sourcecodes/data/example_time_series/TEbrun_evidencemodified.sh b/sourcecodes/data/example_time_series/TEbrun_evidencemodified.sh
new file mode 100644
index 00000000..ff2eafcd
--- /dev/null
+++ b/sourcecodes/data/example_time_series/TEbrun_evidencemodified.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+# script for execution of deployed applications
+#
+# Sets up the MCR environment for the current $ARCH and executes 
+# the specified command.
+#
+exe_name=$0
+exe_dir=`dirname "$0"`
+echo "------------------------------------------"
+if [ "x$1" = "x" ]; then
+  echo Usage:
+  echo    $0 \<deployedMCRroot\> args
+else
+  echo Setting up environment variables
+  MCRROOT="$1"
+  echo ---
+  LD_LIBRARY_PATH=.:${MCRROOT}/runtime/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/bin/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/sys/os/glnxa64;
+	MCRJRE=${MCRROOT}/sys/java/jre/glnxa64/jre/lib/amd64 ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/native_threads ; 
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/server ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/client ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE} ;  
+  XAPPLRESDIR=${MCRROOT}/X11/app-defaults ;
+  export LD_LIBRARY_PATH;
+  export XAPPLRESDIR;
+  echo LD_LIBRARY_PATH is ${LD_LIBRARY_PATH};
+  shift 1
+  args=
+  while [ $# -gt 0 ]; do
+      token=`echo "$1" | sed 's/ /\\\\ /g'`   # Add blackslash before each blank
+      args="${args} ${token}" 
+      shift
+  done
+  "${exe_dir}"/evidencemodified TEb
+fi
+exit
diff --git a/sourcecodes/data/example_time_series/TEbrun_initialstructure.sh b/sourcecodes/data/example_time_series/TEbrun_initialstructure.sh
new file mode 100644
index 00000000..3417deda
--- /dev/null
+++ b/sourcecodes/data/example_time_series/TEbrun_initialstructure.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+# script for execution of deployed applications
+#
+# Sets up the MCR environment for the current $ARCH and executes 
+# the specified command.
+#
+exe_name=$0
+exe_dir=`dirname "$0"`
+echo "------------------------------------------"
+if [ "x$1" = "x" ]; then
+  echo Usage:
+  echo    $0 \<deployedMCRroot\> args
+else
+  echo Setting up environment variables
+  MCRROOT="$1"
+  echo ---
+  LD_LIBRARY_PATH=.:${MCRROOT}/runtime/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/bin/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/sys/os/glnxa64;
+	MCRJRE=${MCRROOT}/sys/java/jre/glnxa64/jre/lib/amd64 ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/native_threads ; 
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/server ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/client ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE} ;  
+  XAPPLRESDIR=${MCRROOT}/X11/app-defaults ;
+  export LD_LIBRARY_PATH;
+  export XAPPLRESDIR;
+  echo LD_LIBRARY_PATH is ${LD_LIBRARY_PATH};
+  shift 1
+  args=
+  while [ $# -gt 0 ]; do
+      token=`echo "$1" | sed 's/ /\\\\ /g'`   # Add blackslash before each blank
+      args="${args} ${token}" 
+      shift
+  done
+  "${exe_dir}"/initialstructure TEb
+fi
+exit
diff --git a/sourcecodes/data/example_time_series/TEbstructure_input.txt b/sourcecodes/data/example_time_series/TEbstructure_input.txt
new file mode 100644
index 00000000..0770c53d
--- /dev/null
+++ b/sourcecodes/data/example_time_series/TEbstructure_input.txt
@@ -0,0 +1,11 @@
+Genotype	TraitA_T1	TraitA_T2	TraitA_T3	TraitB_T1	TraitB_T2	TraitB_T3	TraitC_T1	TraitC_T2	TraitC_T3	
+0	1	1	1	0	1	0	0	0	0	
+0	0	0	0	0	1	0	0	0	1	
+0	0	0	0	0	0	0	0	0	0	
+0	0	0	0	0	0	0	0	0	0	
+0	0	0	0	0	0	0	0	0	0	
+0	0	0	0	0	0	0	0	0	1	
+0	0	0	0	0	0	0	0	0	0	
+0	0	0	0	0	0	0	0	0	0	
+0	0	0	0	0	0	0	0	0	0	
+0	0	0	0	0	0	0	0	0	0	
diff --git a/sourcecodes/data/example_time_series/TEbstructure_input_temp.txt b/sourcecodes/data/example_time_series/TEbstructure_input_temp.txt
new file mode 100644
index 00000000..975379b8
--- /dev/null
+++ b/sourcecodes/data/example_time_series/TEbstructure_input_temp.txt
@@ -0,0 +1,11 @@
+Genotype	TraitA_T1	TraitA_T2	TraitA_T3	TraitB_T1	TraitB_T2	TraitB_T3	TraitC_T1	TraitC_T2	TraitC_T3	
+0.000000	1.000000	1.000000	1.000000	0.048181	1.000000	0.000000	0.008486	0.000000	0.000000	
+0.000000	0.000000	0.125496	0.031272	0.018658	1.000000	0.010369	0.010548	0.064699	1.000000	
+0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.010256	0.000000	0.018179	0.038732	
+0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.010700	0.000000	0.000000	0.000000	
+0.000000	0.000000	0.041559	0.000000	0.000000	0.000000	0.011348	0.000000	0.009653	0.027519	
+0.000000	0.000000	0.000000	0.012552	0.000000	0.000000	0.010464	0.000000	0.017873	1.000000	
+0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.023996	
+0.000000	0.000000	0.000000	0.000000	0.010647	0.000000	0.032409	0.000000	0.435382	0.032829	
+0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.011094	0.000000	0.000000	0.047523	
+0.000000	0.000000	0.000000	0.236851	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	
diff --git a/sourcecodes/data/example_time_series/TEbstructure_old.txt b/sourcecodes/data/example_time_series/TEbstructure_old.txt
new file mode 100644
index 00000000..2d164e66
--- /dev/null
+++ b/sourcecodes/data/example_time_series/TEbstructure_old.txt
@@ -0,0 +1,6 @@
+Genotype	0.5380	0.4620
+TraitA_T1	0.0000	0.0000	0.0000	0.0001	0.0001	0.0001	0.0002	0.0002	0.0003	0.0004	0.0005	0.0007	0.0009	0.0011	0.0015	0.0019	0.0024	0.0030	0.0039	0.0048	0.0060	0.0075	0.0093	0.0114	0.0139	0.0168	0.0203	0.0243	0.0290	0.0344	0.0406	0.0475	0.0554	0.0642	0.0740	0.0848	0.0965	0.1093	0.1231	0.1378	0.1534	0.1698	0.1869	0.2044	0.2224	0.2406	0.2587	0.2767	0.2941	0.3109	0.3268	0.3415	0.3548	0.3666	0.3765	0.3845	0.3905	0.3942	0.3957	0.3950	0.3920	0.3868	0.3794	0.3701	0.3590	0.3461	0.3319	0.3164	0.2999	0.2826	0.2648	0.2467	0.2285	0.2105	0.1927	0.1755	0.1588	0.1430	0.1280	0.1139	0.1007	0.0886	0.0775	0.0674	0.0583	0.0501	0.0428	0.0364	0.0307	0.0258	0.0216	0.0179	0.0148	0.0122	0.0099	0.0081	0.0065	0.0052	0.0042	0.0033	0.0026
+TraitA_T2	0.0007	0.0009	0.0012	0.0015	0.0019	0.0023	0.0029	0.0036	0.0044	0.0054	0.0066	0.0079	0.0096	0.0115	0.0138	0.0164	0.0194	0.0229	0.0269	0.0314	0.0365	0.0423	0.0487	0.0559	0.0638	0.0725	0.0820	0.0923	0.1035	0.1154	0.1281	0.1416	0.1558	0.1705	0.1859	0.2016	0.2177	0.2340	0.2503	0.2666	0.2825	0.2981	0.3131	0.3272	0.3405	0.3526	0.3635	0.3730	0.3810	0.3873	0.3919	0.3948	0.3958	0.3950	0.3923	0.3879	0.3818	0.3740	0.3647	0.3539	0.3419	0.3288	0.3147	0.2998	0.2844	0.2684	0.2522	0.2359	0.2196	0.2034	0.1876	0.1723	0.1574	0.1432	0.1296	0.1168	0.1048	0.0936	0.0832	0.0736	0.0648	0.0568	0.0495	0.0430	0.0372	0.0320	0.0274	0.0233	0.0198	0.0167	0.0141	0.0118	0.0098	0.0081	0.0067	0.0055	0.0045	0.0037	0.0030	0.0024	0.0019
+TraitA_T3	0.0007	0.0008	0.0011	0.0013	0.0017	0.0021	0.0027	0.0033	0.0041	0.0050	0.0062	0.0075	0.0092	0.0111	0.0133	0.0159	0.0189	0.0224	0.0264	0.0310	0.0362	0.0421	0.0486	0.0559	0.0641	0.0730	0.0828	0.0934	0.1049	0.1172	0.1304	0.1443	0.1589	0.1742	0.1900	0.2062	0.2227	0.2394	0.2561	0.2727	0.2889	0.3046	0.3195	0.3336	0.3467	0.3585	0.3688	0.3777	0.3849	0.3903	0.3939	0.3956	0.3954	0.3933	0.3893	0.3834	0.3759	0.3666	0.3559	0.3438	0.3306	0.3162	0.3011	0.2853	0.2690	0.2524	0.2357	0.2190	0.2025	0.1864	0.1707	0.1556	0.1411	0.1273	0.1144	0.1022	0.0909	0.0805	0.0709	0.0622	0.0542	0.0471	0.0407	0.0350	0.0299	0.0255	0.0216	0.0182	0.0153	0.0128	0.0106	0.0088	0.0072	0.0059	0.0048	0.0039	0.0032	0.0025	0.0020	0.0016	0.0013
+TraitB_T2	0.0006	0.0008	0.0010	0.0013	0.0017	0.0021	0.0027	0.0034	0.0043	0.0053	0.0066	0.0081	0.0100	0.0122	0.0148	0.0178	0.0214	0.0255	0.0302	0.0357	0.0419	0.0489	0.0568	0.0655	0.0752	0.0858	0.0975	0.1100	0.1235	0.1379	0.1532	0.1692	0.1858	0.2029	0.2204	0.2381	0.2557	0.2732	0.2902	0.3066	0.3222	0.3366	0.3498	0.3615	0.3715	0.3797	0.3859	0.3901	0.3921	0.3920	0.3897	0.3853	0.3788	0.3704	0.3602	0.3483	0.3350	0.3204	0.3047	0.2882	0.2711	0.2536	0.2359	0.2183	0.2008	0.1838	0.1672	0.1513	0.1362	0.1219	0.1085	0.0960	0.0845	0.0740	0.0644	0.0558	0.0480	0.0411	0.0350	0.0296	0.0250	0.0209	0.0174	0.0144	0.0119	0.0097	0.0079	0.0064	0.0052	0.0041	0.0033	0.0026	0.0021	0.0016	0.0013	0.0010	0.0008	0.0006	0.0004	0.0003	0.0003
+TraitC_T3	0.0000	0.0000	0.0000	0.0000	0.0000	0.0001	0.0001	0.0001	0.0002	0.0002	0.0003	0.0005	0.0006	0.0008	0.0011	0.0015	0.0019	0.0025	0.0033	0.0042	0.0054	0.0069	0.0087	0.0109	0.0135	0.0167	0.0205	0.0250	0.0303	0.0364	0.0435	0.0516	0.0608	0.0711	0.0826	0.0953	0.1091	0.1242	0.1403	0.1575	0.1755	0.1943	0.2136	0.2331	0.2527	0.2721	0.2910	0.3090	0.3259	0.3413	0.3550	0.3667	0.3762	0.3833	0.3878	0.3897	0.3889	0.3854	0.3793	0.3708	0.3599	0.3470	0.3322	0.3159	0.2983	0.2797	0.2605	0.2410	0.2214	0.2019	0.1829	0.1646	0.1471	0.1305	0.1150	0.1007	0.0875	0.0755	0.0648	0.0551	0.0466	0.0391	0.0326	0.0270	0.0222	0.0182	0.0147	0.0119	0.0095	0.0075	0.0060	0.0047	0.0036	0.0028	0.0022	0.0016	0.0012	0.0009	0.0007	0.0005	0.0004
diff --git a/sourcecodes/data/example_time_series/TEbthr.txt b/sourcecodes/data/example_time_series/TEbthr.txt
new file mode 100644
index 00000000..2eb3c4fe
--- /dev/null
+++ b/sourcecodes/data/example_time_series/TEbthr.txt
@@ -0,0 +1 @@
+0.5
diff --git a/sourcecodes/data/example_time_series/TEbtier.txt b/sourcecodes/data/example_time_series/TEbtier.txt
new file mode 100644
index 00000000..29aafcbe
--- /dev/null
+++ b/sourcecodes/data/example_time_series/TEbtier.txt
@@ -0,0 +1 @@
+4,Tier1,1,Genotype,Tier2,3,TraitA_T1,TraitB_T1,TraitC_T1,Tier3,3,TraitA_T2,TraitB_T2,TraitC_T2,Tier4,3,TraitA_T3,TraitB_T3,TraitC_T3,
\ No newline at end of file
diff --git a/sourcecodes/data/example_time_series/TEbtype.txt b/sourcecodes/data/example_time_series/TEbtype.txt
new file mode 100644
index 00000000..e4d7d174
--- /dev/null
+++ b/sourcecodes/data/example_time_series/TEbtype.txt
@@ -0,0 +1,2 @@
+Genotype	TraitA_T1	TraitA_T2	TraitA_T3	TraitB_T1	TraitB_T2	TraitB_T3	TraitC_T1	TraitC_T2	TraitC_T3
+2	1	1	1	1	1	1	1	1	1	
diff --git a/sourcecodes/data/example_time_series/TEbvar.txt b/sourcecodes/data/example_time_series/TEbvar.txt
new file mode 100644
index 00000000..301160a9
--- /dev/null
+++ b/sourcecodes/data/example_time_series/TEbvar.txt
@@ -0,0 +1 @@
+8
\ No newline at end of file
diff --git a/sourcecodes/data/example_time_series/TEbvardata.txt b/sourcecodes/data/example_time_series/TEbvardata.txt
new file mode 100644
index 00000000..f36841a7
--- /dev/null
+++ b/sourcecodes/data/example_time_series/TEbvardata.txt
@@ -0,0 +1 @@
+1.5028501775188
\ No newline at end of file
diff --git a/sourcecodes/data/example_time_series/TEbvarname.txt b/sourcecodes/data/example_time_series/TEbvarname.txt
new file mode 100644
index 00000000..aa23daa0
--- /dev/null
+++ b/sourcecodes/data/example_time_series/TEbvarname.txt
@@ -0,0 +1 @@
+TraitA_T1
\ No newline at end of file
diff --git a/sourcecodes/data/example_time_series/TEbwhite.txt b/sourcecodes/data/example_time_series/TEbwhite.txt
new file mode 100644
index 00000000..83e81b8b
--- /dev/null
+++ b/sourcecodes/data/example_time_series/TEbwhite.txt
@@ -0,0 +1 @@
+From	To
diff --git a/sourcecodes/data/examplecar/OVIban.txt b/sourcecodes/data/examplecar/OVIban.txt
new file mode 100644
index 00000000..83e81b8b
--- /dev/null
+++ b/sourcecodes/data/examplecar/OVIban.txt
@@ -0,0 +1 @@
+From	To
diff --git a/sourcecodes/data/examplecar/OVIcontinuous_input.txt b/sourcecodes/data/examplecar/OVIcontinuous_input.txt
new file mode 100644
index 00000000..3a2846cf
--- /dev/null
+++ b/sourcecodes/data/examplecar/OVIcontinuous_input.txt
@@ -0,0 +1,1004 @@
+Starts	Dist	SpkQual	MFuse	Alter	Starter	StMotor	BatAge	Charging	PlugVolt	BatVolt	Timing	Cranks	Plugs	AirFilter	Air	Fuel	GasTank	GasFilter
+2	2	2	2	2	2	2	1	2	3	3	2	2	3	2	2	2	2	2
+2	2	2	2	2	2	2	1	2	3	3	2	2	3	2	2	2	2	2
+1	1	1	1	1	1	1	1.09219	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	8.35719	1	3	3	1	2	1	1	1	2	1	1
+2	1	1	1	1	2	1	4.87697	1	1	1	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	3.40886	2	3	3	1	2	1	1	1	2	1	1
+1	1	1	1	1	1	1	0.823531	1	1	1	1	1	1	1	1	2	1	1
+1	1	1	1	1	1	1	1.29151	1	1	1	1	1	1	1	1	1	1	1
+2	1	1	1	1	1	1	3.2245	1	1	1	1	2	1	1	1	2	1	1
+2	2	2	1	1	2	1	3.32396	1	3	1	2	2	2	1	2	1	1	1
+2	1	2	1	1	2	1	4.81455	2	3	3	1	2	3	1	1	1	1	1
+2	1	2	1	1	1	1	1.8855	2	2	2	2	1	1	2	2	1	1	1
+2	1	2	1	1	2	1	3.16074	2	3	3	1	2	1	1	1	1	1	1
+2	1	1	1	1	1	1	1.32025	1	1	1	2	1	1	1	2	1	1	1
+2	1	1	1	1	1	1	0.725881	1	1	1	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	9.15429	2	3	3	1	2	1	1	2	2	1	2
+2	1	2	1	1	1	1	1.29503	2	3	2	1	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	1.55555	1	1	1	1	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	0.899695	2	1	1	1	1	1	2	2	1	1	1
+2	1	2	1	1	2	1	0.972723	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	3.62187	2	3	3	2	2	3	1	1	1	1	1
+1	1	2	1	1	1	1	7.11136	1	1	1	1	1	2	1	1	1	1	1
+1	1	1	1	1	1	1	1.10928	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	2.61643	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	6.2605	1	2	2	1	2	1	1	2	1	1	1
+2	1	2	1	1	2	1	8.55173	1	1	1	1	2	3	1	1	1	1	1
+1	1	1	1	1	1	1	1.86787	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	1.23631	1	3	1	1	2	3	1	1	1	1	1
+2	1	2	1	1	1	1	0.728145	1	1	1	1	2	3	1	1	1	1	1
+2	1	2	1	1	2	1	4.66434	2	3	3	1	2	3	2	2	1	1	1
+2	1	2	1	1	1	1	3.56254	2	3	3	1	1	2	1	1	2	2	1
+2	1	2	1	1	2	1	2.63999	2	3	3	1	2	3	1	2	2	2	1
+2	1	2	1	1	2	1	0.715897	2	3	3	1	2	2	1	1	1	1	1
+2	1	2	1	1	2	1	1.85198	2	3	3	1	2	2	1	1	2	2	1
+2	1	1	1	1	1	1	3.63826	1	1	1	1	1	1	2	2	2	1	1
+2	1	2	1	1	1	1	7.73862	2	3	3	1	1	3	1	1	2	2	1
+2	1	2	1	1	2	1	10.1699	2	3	3	1	2	1	1	1	1	1	1
+2	1	1	1	1	2	2	2.97722	1	1	1	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	4.50117	2	2	2	1	1	3	1	1	1	1	1
+2	1	2	1	1	1	1	0.640869	2	2	2	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	1.72775	1	3	1	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	5.46047	2	3	3	1	2	3	1	1	1	1	1
+2	1	2	1	1	1	1	2.21929	1	2	2	1	2	2	1	1	2	1	1
+1	1	1	1	1	1	1	0.438026	1	1	1	1	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	0.0684539	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	4.15012	2	3	3	1	2	2	1	1	1	1	1
+2	1	2	1	1	2	1	0.161533	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	1.11862	2	3	3	1	2	2	1	1	2	1	2
+2	1	1	1	1	1	1	0.410719	1	1	1	1	2	1	1	1	2	1	1
+2	1	2	1	1	2	1	0.0322208	2	3	3	1	2	1	1	1	2	2	1
+1	1	1	1	1	1	1	3.37212	1	1	1	1	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	2.78532	1	1	1	1	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	1.40432	1	1	1	1	1	1	2	1	1	1	1
+2	1	2	1	1	2	1	3.22403	2	3	3	1	1	3	1	1	2	1	1
+2	1	2	1	1	2	1	1.7234	2	3	3	1	2	1	1	2	1	1	1
+2	1	2	1	1	2	1	0.674939	2	3	3	1	2	1	1	1	1	1	1
+1	1	1	1	1	1	1	6.9812	1	1	1	1	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	1.82705	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	0.935587	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	0.992564	1	1	1	1	1	3	1	1	1	1	1
+2	1	2	1	1	2	1	3.47892	1	2	2	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	6.52634	1	2	2	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	3.68841	1	1	1	1	1	3	1	1	2	2	1
+1	1	2	1	1	1	1	0.50506	2	2	2	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	4.33453	1	2	2	1	2	3	1	1	2	1	1
+2	1	2	1	1	1	1	3.39695	2	2	2	2	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	0.482289	1	2	1	1	2	2	1	1	1	1	1
+2	1	2	1	1	2	1	0.385094	2	3	3	1	2	1	1	1	1	1	1
+1	1	1	1	1	1	1	3.92753	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	9.63027	2	3	3	1	2	1	1	1	2	2	1
+1	1	1	1	1	1	1	1.77681	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	15.8749	2	2	2	1	1	1	2	2	1	1	1
+1	1	1	1	1	1	1	0.863939	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	3.5007	2	3	2	1	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	1.46447	1	1	1	2	1	1	2	2	1	1	1
+2	1	2	1	1	1	1	4.00622	2	2	2	1	1	3	1	1	2	1	1
+1	1	2	1	1	1	1	2.62894	1	1	1	1	1	2	1	1	1	1	1
+1	1	1	1	1	1	1	0.772251	1	1	1	1	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	0.254104	1	1	1	1	1	1	1	2	1	1	1
+2	1	2	1	1	1	1	1.35669	1	1	1	1	1	3	1	1	2	2	1
+1	1	1	1	1	1	1	0.408515	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	4.73523	2	3	3	1	2	3	1	1	1	1	1
+2	1	2	1	1	2	1	4.84404	2	3	3	1	2	1	1	1	1	1	1
+2	2	2	1	1	2	1	3.08909	2	3	3	2	2	1	1	1	2	2	1
+2	1	1	1	1	1	1	0.500373	1	1	1	2	1	1	1	2	1	1	1
+1	1	2	1	1	1	1	1.42352	1	1	1	1	1	3	2	1	1	1	1
+2	1	2	1	1	2	1	3.19283	2	2	2	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	2.65803	2	3	3	1	2	1	1	1	2	1	2
+1	1	1	1	1	1	1	4.35117	1	1	1	1	1	1	1	1	1	1	1
+2	1	1	1	1	1	1	0.448913	1	1	1	1	1	1	1	1	2	2	1
+2	1	2	1	1	2	1	4.59592	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	4.68035	1	1	1	1	1	3	2	2	2	2	1
+2	1	2	1	1	1	1	6.86362	2	3	3	1	2	1	1	1	1	1	1
+1	1	1	1	1	1	1	1.88662	1	1	1	1	1	1	1	2	1	1	1
+2	1	2	1	1	1	1	6.67913	2	3	3	1	2	3	1	1	1	1	1
+2	1	2	1	1	1	1	1.72634	1	2	1	1	2	1	1	1	1	1	1
+2	1	1	1	1	1	1	1.01307	1	1	1	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	1.1309	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	2.38128	2	2	2	1	1	1	1	1	2	1	1
+2	1	2	1	1	2	1	2.01195	1	3	3	1	2	3	1	1	1	1	1
+2	1	2	1	1	1	1	4.91973	2	3	3	1	1	2	1	1	2	1	1
+2	1	1	1	1	1	1	3.45795	1	1	1	2	2	1	1	1	1	1	1
+1	1	1	1	1	1	1	1.66261	1	1	1	2	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	12.2823	1	3	3	1	1	1	1	1	2	1	1
+2	1	2	1	1	2	1	4.98365	2	3	3	1	2	2	1	1	1	1	1
+2	1	2	1	1	1	1	2.28812	1	1	1	1	1	2	1	1	2	2	1
+2	1	2	1	1	1	1	1.98491	2	2	2	2	1	3	1	1	2	1	1
+1	1	1	1	1	1	1	0.441825	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	6.80856	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	1.14798	1	3	1	2	1	1	2	1	1	1	1
+2	1	2	1	1	2	1	3.47334	2	3	3	1	2	2	1	1	1	1	1
+2	1	2	1	1	2	1	4.29814	1	3	3	1	1	1	1	1	2	1	1
+1	1	2	1	1	1	1	2.14065	1	1	1	1	1	3	1	1	1	1	1
+2	1	1	1	1	1	1	1.96168	1	1	1	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	3.7237	2	3	3	1	2	3	1	2	1	1	1
+1	1	1	1	1	1	1	1.11832	1	1	1	2	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	4.56047	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	0.452531	1	1	1	1	1	3	1	1	1	1	1
+2	1	2	1	1	2	1	4.76471	2	3	3	2	2	1	1	1	1	1	1
+1	1	2	1	1	1	1	3.72712	1	1	1	1	1	3	1	1	1	1	1
+2	1	2	1	1	2	1	1.60393	2	3	3	1	2	3	1	1	1	1	1
+2	1	2	1	1	1	1	2.22538	1	1	1	1	1	3	1	1	2	2	1
+1	1	1	1	1	1	1	0.778349	1	1	1	1	1	1	1	2	1	1	1
+2	1	2	1	1	1	1	0.136355	2	3	3	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	0.559837	2	2	2	1	2	1	1	2	1	1	1
+2	1	2	1	1	2	2	1.5521	2	3	3	2	2	1	1	1	2	2	2
+1	1	1	1	1	1	1	1.1683	1	1	1	1	1	1	1	2	1	1	1
+2	1	2	1	1	2	1	3.20792	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	0.0294523	2	2	2	1	1	3	1	1	2	2	1
+2	1	1	1	1	1	1	1.51016	1	1	1	1	2	1	1	1	2	1	1
+2	1	2	1	1	1	1	1.46157	2	2	2	1	1	1	1	1	2	2	1
+2	1	2	1	1	1	1	7.31961	2	3	3	1	1	3	1	1	1	1	1
+2	1	2	1	1	1	1	2.25565	1	2	2	1	1	1	1	1	2	2	1
+2	1	2	1	1	1	1	0.332537	1	3	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	1.16328	2	3	3	1	2	1	2	2	2	2	1
+1	1	2	1	1	1	1	4.18322	1	1	1	1	1	3	1	1	1	1	1
+2	1	2	1	1	2	1	8.04276	2	3	3	1	2	1	1	1	1	1	1
+1	1	1	1	1	1	1	4.12436	1	1	1	1	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	1.66478	1	1	1	1	1	1	1	1	1	1	1
+1	1	2	1	1	1	1	6.44237	1	1	1	1	1	3	1	1	1	1	1
+2	1	2	1	1	2	1	3.30168	2	3	3	1	1	2	2	2	1	1	1
+1	1	1	1	1	1	1	2.57221	1	1	1	1	1	1	1	1	1	1	1
+2	1	1	1	1	1	1	1.5302	1	1	1	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	2.23714	2	3	3	1	1	1	1	2	2	2	1
+2	1	2	1	1	2	1	8.72277	2	3	3	1	2	1	1	1	1	1	1
+1	1	2	1	1	1	1	5.18702	1	1	1	1	1	2	1	1	1	1	1
+2	1	2	1	1	2	1	4.1361	1	3	3	1	2	3	1	1	1	1	1
+2	1	2	1	1	1	1	4.03663	2	2	2	1	1	3	1	1	1	1	1
+2	1	2	1	1	2	1	2.09322	2	3	3	1	2	3	1	1	1	1	1
+2	1	2	1	1	2	1	1.87756	2	3	3	2	2	1	1	1	2	1	1
+2	1	2	1	1	2	1	14.1937	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	3.41049	1	1	1	1	1	3	1	1	2	2	1
+1	1	1	1	1	1	1	2.93445	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	10.5414	1	2	2	1	1	1	1	2	1	1	1
+2	1	2	1	1	2	1	4.09177	2	3	3	1	2	1	1	1	1	1	1
+1	1	1	1	1	1	1	2.39508	1	1	1	1	1	1	1	2	1	1	1
+2	1	2	1	1	2	1	3.50173	2	3	3	1	2	3	1	1	1	1	1
+2	1	2	1	1	1	1	6.21675	1	3	2	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	0.703114	1	2	2	2	2	1	1	1	2	1	1
+2	1	2	1	1	1	1	0.894215	2	3	2	1	1	3	1	2	1	1	1
+2	1	2	1	1	1	1	1.0471	1	2	2	1	1	3	1	1	1	1	1
+1	1	1	1	1	1	1	1.31589	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	4.68824	1	2	1	1	2	1	1	1	2	2	2
+2	1	2	1	1	2	1	5.48787	2	3	3	1	2	1	1	1	1	1	1
+1	1	2	1	1	1	1	3.34192	1	1	1	2	1	3	1	1	1	1	1
+2	1	2	1	1	2	1	9.5016	2	3	3	1	2	1	1	1	2	1	2
+2	1	2	1	1	2	1	6.07059	2	3	3	1	2	1	1	1	1	1	1
+1	1	1	1	1	1	1	19.5523	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	4.31889	2	3	3	2	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	1.87967	1	1	1	1	2	3	1	1	1	1	1
+2	1	2	1	1	2	1	2.77823	2	3	3	1	2	1	1	1	1	1	1
+1	1	2	1	1	1	1	3.5956	1	1	1	1	1	3	1	1	1	1	1
+2	1	1	1	1	1	1	1.31325	1	1	1	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	1.75989	2	2	2	1	2	1	1	1	1	1	1
+1	1	1	1	1	1	1	0.621366	1	1	1	1	1	1	1	2	1	1	1
+2	1	2	1	1	1	1	3.14788	2	2	2	1	1	1	1	1	2	1	1
+2	1	2	1	1	2	1	2.41881	2	3	3	1	2	3	1	1	1	1	1
+2	1	2	1	1	2	1	4.3647	2	3	3	1	2	3	1	1	2	1	1
+2	1	2	1	1	1	1	0.227306	2	2	2	1	1	3	1	1	1	1	1
+2	1	2	1	1	2	1	0.0613263	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	13.2932	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	1.64929	1	1	1	1	2	3	1	1	1	1	1
+2	1	2	1	1	2	1	7.26046	2	3	3	1	2	1	1	1	2	1	1
+1	1	2	1	1	1	1	0.198224	1	1	1	1	1	3	1	1	1	1	1
+2	1	2	1	1	2	1	6.24718	2	3	3	1	2	2	1	1	2	1	1
+1	1	1	1	1	1	1	0.818786	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	0.367484	2	3	3	2	2	1	2	2	1	1	1
+2	1	2	1	1	1	1	3.24863	1	3	1	1	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	3.67769	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	0.659442	1	3	1	1	1	3	1	1	1	1	1
+2	1	2	1	1	2	1	3.40058	2	3	3	1	2	1	1	1	1	1	1
+2	1	1	1	1	1	1	2.95923	1	1	1	2	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	4.80303	1	1	1	1	2	2	1	1	2	1	1
+1	1	1	1	1	1	1	4.64104	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	6.81146	1	3	3	1	2	2	1	1	1	1	1
+1	1	1	1	1	1	1	1.74035	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	3.33846	2	2	2	1	2	1	1	2	1	1	1
+2	1	2	1	1	1	1	10.5625	1	2	2	1	1	3	1	2	1	1	1
+2	1	2	1	1	1	1	1.75197	2	2	2	2	2	3	1	1	1	1	1
+2	1	2	1	1	1	1	2.57664	1	2	2	1	1	2	2	2	2	1	1
+1	1	2	1	1	1	1	1.31431	1	1	1	1	1	3	1	1	1	1	1
+2	1	2	1	1	1	1	0.703583	1	2	1	1	1	1	1	1	2	2	1
+2	1	2	1	1	2	1	4.1339	2	3	3	1	2	3	1	1	2	2	1
+2	1	2	1	1	2	1	0.689182	2	3	3	1	2	1	2	2	1	1	1
+2	1	1	1	1	1	1	1.70247	1	1	1	1	1	1	1	1	2	2	1
+2	1	2	1	1	2	1	3.16831	2	3	3	1	2	1	1	1	1	1	1
+2	1	1	1	1	1	1	2.60872	1	1	1	2	2	1	1	1	1	1	1
+1	1	1	1	1	1	1	5.17883	1	1	1	1	1	1	1	1	1	1	1
+1	1	2	1	1	1	1	1.24226	2	2	2	1	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	16.3393	1	1	1	1	1	1	1	2	1	1	1
+2	1	1	1	1	1	1	0.355235	1	1	1	1	2	1	1	1	2	2	1
+2	1	2	1	1	2	1	10.1607	2	3	3	1	2	2	1	1	2	1	1
+1	1	1	1	1	1	1	0.0379707	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	4.73676	2	3	3	1	2	1	1	2	1	1	1
+2	1	2	1	1	2	1	0.411721	2	3	3	1	2	1	1	1	2	1	1
+2	1	2	1	1	2	1	5.80853	2	3	3	1	2	1	1	2	1	1	1
+1	1	1	1	1	1	1	2.29781	1	1	1	1	1	1	1	2	1	1	1
+2	1	2	1	1	2	1	2.5112	2	3	3	1	2	3	1	2	1	1	1
+1	1	2	1	1	1	1	2.02508	1	1	1	1	1	3	1	1	1	1	1
+2	1	1	1	1	1	1	6.71109	1	1	1	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	9.53679	2	3	3	1	2	1	1	2	1	1	1
+2	1	2	1	1	2	1	0.325964	2	3	3	1	2	2	2	1	1	1	1
+1	1	2	1	1	1	1	11.5387	1	2	2	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	0.990259	2	2	2	1	1	3	1	1	1	1	1
+2	1	2	1	1	2	1	2.35299	2	3	3	1	1	3	1	1	1	1	1
+2	1	2	1	1	1	1	4.05911	2	2	2	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	3.42727	2	3	3	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	8.70147	1	1	1	1	2	3	1	1	1	1	1
+2	1	2	1	1	2	1	2.42454	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	2.27037	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	1.80295	1	3	1	1	1	1	1	1	1	1	1
+2	1	1	1	1	1	1	0.28139	1	1	1	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	4.06082	2	3	3	1	2	1	1	2	1	1	1
+1	1	1	1	1	1	1	0.567112	1	1	1	1	1	1	1	1	1	1	1
+2	1	1	1	1	1	1	1.97993	1	1	1	2	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	2.91836	2	3	3	1	2	3	1	1	1	1	1
+2	1	2	1	1	2	1	4.08475	2	3	3	1	2	1	1	1	2	2	1
+2	1	2	1	1	2	1	4.70922	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	1.2148	2	3	3	1	2	1	2	2	2	1	1
+2	1	2	1	1	2	1	8.82052	2	3	3	1	1	2	1	1	1	1	1
+1	1	1	1	1	1	1	1.70604	1	1	1	2	1	1	1	1	1	1	1
+2	1	1	1	1	1	1	2.80681	1	1	1	1	2	1	1	2	1	1	1
+2	1	2	1	1	2	1	3.42965	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	7.47897	2	3	3	1	2	3	1	1	1	1	1
+2	1	2	1	1	2	1	0.974442	2	3	3	1	2	1	1	1	2	1	1
+2	1	2	1	1	2	1	1.42741	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	2.38853	1	3	3	1	2	1	1	1	2	2	1
+1	1	2	1	1	1	1	3.65307	2	2	2	1	1	1	1	1	1	1	1
+2	1	1	1	1	1	1	1.49918	1	1	1	2	2	1	1	1	2	1	1
+1	1	2	1	1	1	1	1.84278	1	2	1	1	1	1	1	1	1	1	1
+2	1	1	1	1	1	1	0.115726	1	1	1	1	1	1	1	1	2	1	1
+2	1	2	1	1	2	1	4.33852	2	3	3	1	2	1	1	1	1	1	1
+2	1	1	1	1	1	1	2.32321	1	1	1	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	6.83117	2	3	3	1	2	1	1	1	2	1	1
+2	1	2	1	1	2	1	4.44755	2	3	3	1	2	2	1	1	1	1	1
+2	1	2	1	1	1	1	1.21308	1	2	1	2	1	3	1	1	2	2	1
+2	1	2	1	1	1	1	4.62471	1	1	1	1	2	3	1	1	1	1	1
+2	1	2	1	1	2	1	1.04437	2	3	3	2	2	2	1	1	1	1	1
+1	1	1	1	1	1	1	0.324121	1	1	1	1	1	1	1	2	1	1	1
+2	1	1	1	1	1	1	1.21791	1	1	1	1	1	1	1	1	2	1	1
+2	1	2	1	1	2	1	2.5757	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	0.336122	2	2	2	1	1	1	1	1	2	1	1
+2	1	2	1	1	2	1	4.26305	2	3	3	2	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	0.15171	1	2	1	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	3.70251	2	2	2	1	1	3	1	1	1	1	1
+2	1	2	1	1	2	1	4.92733	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	1.32744	2	3	3	1	2	2	2	2	1	1	1
+2	1	2	1	1	2	1	6.29586	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	4.84603	2	3	3	1	2	1	1	2	1	1	1
+1	1	1	1	1	1	1	0.307382	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	1.48683	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	2.24111	2	3	3	1	2	1	1	2	1	1	1
+1	1	1	1	1	1	1	1.57836	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	7.5335	1	3	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	1.99299	1	3	1	2	1	1	2	2	1	1	1
+2	1	2	1	1	1	1	1.57593	1	1	1	1	1	3	1	1	2	2	1
+2	1	2	1	1	1	1	0.753161	2	3	3	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	2.56304	1	1	1	1	2	3	1	2	1	1	1
+1	1	2	1	1	1	1	1.91375	1	1	1	1	1	3	1	1	1	1	1
+1	1	2	1	1	1	1	2.09052	1	1	1	1	1	3	1	1	1	1	1
+2	1	1	1	1	1	1	0.404107	1	1	1	1	2	1	1	1	1	1	1
+2	1	1	1	1	1	1	3.4751	1	1	1	1	1	1	1	1	2	1	1
+2	1	2	1	1	1	1	3.34059	2	2	2	1	2	1	1	1	2	2	1
+2	1	2	1	1	1	1	2.59287	1	3	1	1	1	1	1	2	1	1	1
+1	1	2	1	1	1	1	1.84964	2	2	2	2	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	2.12746	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	1.54119	1	3	1	1	1	1	1	1	2	2	1
+1	1	2	1	1	1	1	3.09225	1	2	2	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	0.984227	2	3	3	1	2	2	1	2	1	1	1
+2	1	2	1	1	2	1	1.21511	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	1.18723	1	2	2	1	2	1	2	1	1	1	1
+1	1	1	1	1	1	1	1.37242	1	1	1	1	1	1	1	1	1	1	1
+2	1	1	1	1	1	1	0.365557	1	1	1	1	1	1	1	1	2	2	1
+1	1	1	1	1	1	1	0.732062	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	0.431721	1	1	1	1	1	3	1	1	1	1	1
+2	1	2	1	1	2	1	5.02484	2	3	3	1	1	1	1	2	1	1	1
+2	1	1	1	1	1	1	2.47498	1	1	1	1	2	1	1	2	2	2	1
+1	1	1	1	1	1	1	2.92504	1	1	1	1	1	1	2	2	1	1	1
+2	1	2	1	1	2	1	0.682922	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	9.11967	2	3	3	1	2	1	1	1	1	1	1
+1	1	2	1	1	1	1	3.93455	1	1	1	1	1	2	2	1	1	1	1
+2	1	2	1	1	1	1	3.16104	1	2	2	1	2	3	1	1	1	1	1
+1	1	2	1	1	1	1	4.60598	1	2	2	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	1.70782	2	3	3	1	2	1	1	1	1	1	1
+2	2	2	1	1	1	1	1.66717	1	1	1	1	2	3	1	1	1	1	1
+1	1	1	1	1	1	1	9.57855	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	0.977536	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	4.70948	2	3	3	1	2	2	1	1	1	1	1
+1	1	1	1	1	1	1	0.455219	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	6.12015	2	3	3	1	2	1	1	1	1	1	1
+1	1	1	1	1	1	1	3.96338	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	1.34524	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	0.867365	2	3	3	1	2	1	1	1	1	1	1
+1	1	1	1	1	1	1	0.426986	1	1	1	1	1	1	1	1	1	1	1
+1	1	2	1	1	1	1	2.24558	2	2	2	1	1	1	1	1	1	1	1
+1	1	2	1	1	1	1	8.68619	1	2	2	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	0.0396086	1	1	1	1	1	3	1	2	2	1	1
+2	1	2	1	1	2	1	3.46897	2	3	3	1	2	1	1	1	2	1	1
+2	1	2	1	1	1	1	3.47859	1	2	2	2	1	2	1	1	1	1	1
+2	1	2	1	1	2	1	1.60722	2	3	3	1	2	1	1	2	1	1	1
+2	1	2	1	1	1	1	3.07112	2	3	3	1	1	1	1	2	2	1	1
+2	1	2	1	1	1	1	3.66511	1	1	1	1	2	3	1	1	2	2	2
+1	1	2	1	1	1	1	3.89798	2	1	1	1	1	3	1	1	2	1	2
+2	1	2	1	1	1	1	2.51723	2	3	3	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	1.13568	2	3	3	1	2	3	1	1	2	1	1
+2	1	2	1	1	2	1	4.28818	2	3	3	1	2	1	1	2	2	1	2
+1	1	2	1	1	1	1	1.349	1	1	1	2	1	3	1	1	1	1	1
+2	1	2	1	1	1	1	5.80801	1	1	1	1	1	3	1	1	2	1	1
+2	1	2	1	1	1	1	1.71918	1	1	1	1	1	3	1	1	1	1	1
+1	1	2	1	1	1	1	3.71715	1	1	1	1	1	3	1	1	1	1	1
+2	1	2	1	1	2	1	1.5999	2	3	3	1	2	2	1	1	1	1	1
+2	1	2	1	1	2	1	4.55826	2	2	2	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	2.60412	2	3	3	1	2	3	1	2	1	1	1
+1	1	1	1	1	1	1	1.52876	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	0.596352	2	3	3	1	2	3	1	1	1	1	1
+1	1	2	1	1	1	1	2.00945	2	2	2	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	1.86021	2	3	3	1	2	1	1	2	2	1	1
+2	1	2	1	1	2	1	4.19014	2	3	3	2	2	1	2	2	2	2	1
+2	1	2	1	1	1	1	0.904116	2	2	2	1	1	2	1	1	2	2	1
+1	1	2	1	1	1	1	5.61684	1	2	1	1	1	1	1	1	1	1	1
+2	1	1	1	1	1	1	1.65619	1	1	1	2	1	1	1	1	2	2	1
+2	1	2	1	1	2	1	4.15422	2	3	3	1	2	1	1	2	1	1	1
+1	1	2	1	1	1	1	4.88026	1	1	1	1	1	2	1	1	1	1	1
+2	1	1	1	1	1	1	3.45452	1	1	1	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	1.03947	1	3	3	1	2	3	2	2	1	1	1
+2	1	1	1	1	1	1	0.0883353	1	1	1	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	4.39567	2	3	3	1	2	1	1	1	2	1	1
+1	1	1	1	1	1	1	6.04255	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	1.87942	2	3	3	1	2	1	1	2	2	1	1
+2	1	2	1	1	1	1	6.44694	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	0.404753	2	3	3	1	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	2.9712	1	1	1	1	1	1	1	1	1	1	1
+2	2	2	1	1	1	1	3.45153	1	3	1	2	1	2	1	1	2	1	1
+2	1	2	1	1	2	1	5.83086	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	7.2099	2	3	3	2	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	4.67762	1	1	1	1	1	1	1	1	2	1	1
+2	1	2	1	1	2	1	0.729882	2	3	3	1	2	1	1	1	1	1	1
+1	1	1	1	1	1	1	1.01368	1	1	1	1	1	1	1	1	1	1	1
+2	2	2	1	1	2	1	1.09835	2	3	2	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	0.519269	1	1	1	1	2	3	1	1	1	1	1
+2	1	2	1	1	1	1	3.50706	1	1	1	1	2	2	1	2	2	1	1
+1	1	1	1	1	1	1	4.79285	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	3.12622	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	0.608191	2	3	3	1	2	3	1	1	2	2	1
+2	1	2	1	1	2	1	6.54656	2	3	3	1	2	2	1	1	2	1	1
+1	1	2	1	1	1	1	1.84695	1	2	2	1	1	1	1	1	1	1	1
+2	1	1	1	1	1	1	1.44766	1	1	1	1	1	1	1	1	2	1	2
+2	1	2	1	1	1	1	2.76405	2	3	3	2	1	1	1	1	2	2	1
+2	1	2	1	1	2	1	1.87897	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	4.21577	2	3	3	1	2	1	1	1	1	1	1
+2	1	1	1	1	1	1	4.10049	1	1	1	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	0.700877	2	3	3	1	2	3	1	1	1	1	1
+2	1	2	1	1	2	1	2.09615	2	3	3	1	2	2	2	2	2	2	1
+2	1	2	1	1	2	1	0.0413103	2	3	3	1	2	2	1	1	1	1	1
+2	1	2	1	1	2	1	2.48333	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	2.97985	2	2	2	1	2	1	1	1	1	1	1
+1	1	2	1	1	1	1	1.37459	1	1	1	1	1	2	1	1	1	1	1
+2	1	2	1	1	2	1	4.1201	2	3	3	1	1	1	2	2	1	1	1
+2	1	2	1	1	2	1	2.90982	2	3	3	1	2	1	1	2	2	1	1
+1	1	1	1	1	1	1	6.59517	1	1	1	1	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	2.08584	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	0.0538178	2	2	2	1	2	1	1	1	1	1	1
+1	1	2	1	1	1	1	5.96335	1	1	1	1	1	2	1	1	1	1	1
+2	1	2	1	1	1	1	0.182284	2	3	2	1	1	3	1	1	1	1	1
+2	1	2	1	1	1	1	3.44919	2	3	3	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	0.779395	1	1	1	1	1	2	1	2	1	1	1
+1	1	2	1	1	1	1	0.795055	1	1	1	1	1	3	1	2	1	1	1
+2	1	2	1	1	1	1	0.157868	1	1	1	1	2	3	1	2	2	1	1
+2	1	2	1	1	1	1	16.084	1	3	2	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	2	0.627103	1	2	1	1	2	1	1	1	2	2	1
+2	1	2	1	1	2	1	0.0275255	2	3	3	1	2	2	2	2	1	1	1
+2	1	2	1	1	2	1	6.47001	2	3	3	1	2	1	1	1	1	1	1
+1	1	2	1	1	1	1	4.03001	1	2	2	1	1	1	1	1	1	1	1
+2	1	1	1	1	1	1	0.965693	1	1	1	1	2	1	1	1	1	1	1
+2	1	1	1	1	1	1	0.54945	1	1	1	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	1.48256	2	3	3	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	2.85677	1	3	1	1	1	1	2	1	1	1	1
+2	1	2	1	1	2	1	3.93863	2	3	3	1	2	3	1	1	2	1	1
+2	1	1	1	1	1	1	0.00541087	1	1	1	1	1	1	1	1	2	1	1
+2	1	2	1	1	1	1	0.362488	2	3	3	1	2	1	1	1	1	1	1
+1	1	2	1	1	1	1	6.42171	1	1	1	1	1	3	1	1	1	1	1
+1	1	1	1	1	1	1	3.82142	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	3.25268	2	2	2	2	1	3	2	2	2	2	1
+2	1	1	1	1	1	1	0.456467	1	1	1	1	1	1	1	1	2	1	2
+2	1	2	1	1	2	1	7.28457	2	3	3	1	2	2	1	1	1	1	1
+1	1	1	1	1	1	1	2.36924	1	1	1	1	1	1	2	2	1	1	1
+2	1	2	1	1	2	1	2.56769	2	3	3	1	2	1	2	2	1	1	1
+2	1	1	1	1	1	1	6.12715	1	1	1	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	0.334852	1	1	1	1	1	2	1	1	2	1	1
+2	1	2	1	1	2	1	0.417725	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	4.08556	2	3	3	1	2	3	2	2	1	1	1
+1	1	2	1	1	1	1	6.17039	1	1	1	1	1	2	1	1	1	1	1
+2	1	2	1	1	1	1	2.18545	1	2	2	1	1	3	2	2	2	2	1
+2	1	2	1	1	2	1	0.847626	2	3	3	1	2	1	2	1	1	1	1
+2	1	2	1	1	1	1	3.16606	1	3	2	1	1	3	1	1	2	2	1
+1	1	1	1	1	1	1	6.11365	1	1	1	1	1	1	2	2	1	1	1
+2	1	2	1	1	2	1	1.11975	2	3	3	1	2	3	1	1	1	1	1
+2	1	2	1	1	2	1	1.89276	1	2	2	1	2	3	1	1	2	1	1
+2	1	2	1	1	1	1	9.5922	1	2	2	1	1	2	1	1	1	1	1
+2	1	2	1	1	2	1	3.60891	2	3	3	1	2	1	1	1	1	1	1
+1	1	2	1	1	1	1	2.90668	1	1	1	1	1	3	1	1	1	1	1
+1	1	2	1	1	1	1	2.49303	1	1	1	1	1	3	1	1	1	1	1
+2	1	2	1	1	2	1	3.38525	2	3	3	2	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	4.42015	2	3	3	2	2	2	1	1	1	1	1
+2	1	2	1	1	1	1	3.64483	2	3	3	1	1	3	1	1	2	2	1
+2	1	1	1	1	1	1	15.1085	1	1	1	1	1	1	1	1	2	1	1
+2	1	2	1	1	1	1	1.48203	2	2	2	2	1	1	2	2	1	1	1
+2	1	2	1	1	2	1	2.30603	2	3	3	1	2	1	1	1	2	1	2
+2	1	2	1	1	2	1	2.41018	1	3	3	2	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	12.1968	1	1	1	1	2	3	1	1	1	1	1
+2	1	2	1	1	2	1	4.26132	1	3	3	1	2	1	2	1	1	1	1
+2	1	2	1	1	2	1	2.84851	2	3	3	1	2	3	1	1	2	1	1
+2	2	2	1	1	1	1	7.38158	2	3	2	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	2.22157	2	3	3	1	2	3	2	1	1	1	1
+2	1	2	1	1	1	1	11.2393	1	3	2	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	12.0586	2	3	3	1	2	1	1	2	1	1	1
+2	1	2	1	1	1	1	1.70122	1	1	1	1	1	2	1	1	1	1	1
+1	1	2	1	1	1	1	0.421549	1	1	1	1	1	3	1	1	1	1	1
+2	1	2	1	1	2	1	10.6549	2	3	3	1	2	1	2	2	1	1	1
+2	1	2	1	1	2	1	4.54634	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	5.84972	2	3	3	2	2	3	1	1	1	1	1
+2	1	2	1	1	1	1	4.5827	1	1	1	1	2	3	1	1	1	1	1
+1	1	2	1	1	1	1	2.15622	1	1	1	1	1	2	2	1	1	1	1
+2	1	2	1	1	1	1	5.30419	1	2	2	1	1	1	2	2	1	1	1
+2	1	2	1	1	2	1	2.96E-04	2	3	3	2	2	1	1	1	2	1	2
+1	1	1	1	1	1	1	3.1953	1	1	1	1	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	3.58269	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	3.79966	1	1	1	1	1	3	1	1	2	2	1
+2	1	2	1	1	2	1	3.41372	2	3	3	1	2	2	1	1	1	1	1
+2	1	2	1	1	2	1	1.17749	2	3	3	1	2	3	1	1	2	2	1
+2	1	2	1	1	2	1	3.27787	2	3	3	1	2	1	1	1	2	1	2
+2	1	2	1	1	2	1	0.973378	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	5.71889	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	7.85101	2	3	3	1	2	1	1	2	1	1	1
+2	1	2	1	1	1	1	0.894716	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	6.98461	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	0.493006	2	2	2	1	1	1	2	2	1	1	1
+2	1	2	1	1	1	1	2.90456	2	2	2	1	2	3	1	1	1	1	1
+1	1	2	1	1	1	1	1.27467	1	1	1	1	1	3	1	1	1	1	1
+2	1	2	1	1	1	1	0.465813	1	1	1	1	1	3	1	1	1	1	1
+2	1	1	1	1	1	1	4.5194	1	1	1	1	1	1	1	1	2	1	1
+1	1	1	1	1	1	1	3.22301	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	3.80782	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	3.6576	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	3.19978	2	3	3	1	1	1	1	2	1	1	1
+2	1	2	1	1	2	1	5.80517	2	3	3	1	2	1	1	2	1	1	1
+2	1	1	1	1	1	1	10.7093	1	1	1	1	1	1	1	1	2	1	1
+2	1	2	1	1	2	1	10.3549	2	3	3	2	2	1	1	1	2	2	1
+1	1	1	1	1	1	1	0.604478	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	7.20582	2	3	3	1	2	1	1	1	2	2	1
+2	1	2	1	1	2	1	2.06571	1	3	3	1	2	1	1	1	2	1	2
+1	1	1	1	1	1	1	2.31193	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	0.497595	2	3	3	2	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	1.35387	2	3	3	1	2	1	2	1	1	1	1
+2	1	2	1	1	2	1	0.772214	2	3	3	1	2	3	1	1	1	1	1
+2	1	2	1	1	2	1	0.558477	2	3	3	2	2	3	1	1	1	1	1
+2	1	2	1	1	1	1	1.9158	2	3	3	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	5.01825	2	3	3	1	1	3	1	1	2	1	1
+2	1	2	1	1	2	1	5.67882	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	1.46262	1	3	1	1	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	0.0745373	1	1	1	1	1	1	1	1	1	1	1
+1	1	2	1	1	1	1	0.97897	2	2	2	1	1	1	1	1	1	1	1
+1	1	2	1	1	1	1	4.58861	1	1	1	1	1	3	1	1	1	1	1
+2	1	1	1	1	1	1	0.125777	1	1	1	1	1	1	2	2	1	1	1
+2	1	1	1	1	1	1	7.76345	1	1	1	1	2	1	1	1	1	1	1
+2	1	1	1	1	1	1	2.36532	1	1	1	1	2	1	1	1	1	1	1
+1	1	1	1	1	1	1	1.31529	1	1	1	1	1	1	2	1	1	1	1
+2	1	2	1	1	1	1	4.53837	2	3	3	1	1	3	1	1	1	1	1
+2	2	2	1	1	2	1	5.99218	1	3	3	1	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	4.59701	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	2.78721	1	3	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	0.767383	2	3	3	1	2	1	2	2	1	1	1
+2	1	2	1	1	2	1	1.60453	1	3	3	2	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	2.04018	2	3	3	1	1	1	1	1	2	2	1
+2	1	2	1	1	1	1	0.384608	1	1	1	1	1	3	1	1	2	2	1
+1	1	1	1	1	1	1	1.96169	1	1	1	1	1	1	1	1	1	1	1
+2	1	1	1	1	1	1	0.122461	1	1	1	1	1	1	1	1	2	2	1
+1	1	1	1	1	1	1	0.876525	1	1	1	1	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	10.0388	1	1	1	1	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	3.88288	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	2.22832	2	3	3	1	1	1	1	1	1	1	1
+2	1	1	1	1	1	1	2.14611	1	1	1	1	1	1	1	2	2	2	1
+2	1	2	1	1	1	1	6.15115	2	2	2	1	2	2	1	1	1	1	1
+2	1	2	1	1	2	1	1.11516	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	3.32971	1	1	1	1	1	3	1	2	1	1	1
+2	1	2	1	1	2	1	1.13327	2	3	3	1	2	1	1	2	1	1	1
+2	1	2	1	1	1	1	0.97488	1	1	1	1	1	2	1	1	2	2	1
+1	1	1	1	1	1	1	6.13708	1	1	1	1	1	1	2	1	1	1	1
+2	1	1	1	1	1	1	0.644221	1	1	1	1	2	1	2	1	1	1	1
+2	1	2	1	1	2	1	3.24321	2	3	3	1	2	1	1	2	1	1	1
+2	1	2	1	1	2	1	4.90151	1	3	3	1	2	1	1	1	1	1	1
+2	1	1	1	1	1	1	1.17076	1	1	1	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	2.41424	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	0.463388	1	1	1	1	1	3	1	1	2	2	1
+1	1	2	1	1	1	1	0.738175	2	2	2	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	14.1497	1	1	1	2	2	2	1	1	2	1	2
+2	1	1	1	1	1	1	4.29215	1	1	1	1	2	1	1	1	2	2	1
+1	1	2	1	1	1	1	0.743482	2	2	2	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	3.6543	2	3	2	1	1	2	1	1	1	1	1
+1	1	1	1	1	1	1	0.0958608	1	1	1	1	1	1	1	2	1	1	1
+2	1	1	1	1	1	1	2.2899	1	1	1	1	2	1	2	2	1	1	1
+2	1	1	1	1	1	1	0.550205	1	1	1	1	1	1	1	1	2	1	1
+2	1	2	1	1	2	1	0.403593	1	3	3	2	2	3	1	2	1	1	1
+2	1	2	1	1	1	1	5.5744	1	2	2	1	1	1	1	1	2	2	1
+2	1	2	1	1	2	1	3.62555	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	4.89359	2	2	2	1	1	2	1	1	1	1	1
+2	1	2	1	1	1	1	3.89413	1	1	1	1	1	2	1	1	1	1	1
+1	1	1	1	1	1	1	1.16389	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	5.16743	2	2	2	2	1	2	1	1	1	1	1
+2	1	2	1	1	2	1	4.77073	2	3	3	1	2	1	1	1	1	1	1
+1	1	2	1	1	1	1	1.35868	2	2	2	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	0.7067	2	3	3	1	2	1	1	1	1	1	1
+1	1	1	1	1	1	1	1.4588	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	3.77657	1	1	1	1	1	2	1	2	1	1	1
+2	1	2	1	1	2	1	18.7932	2	3	3	2	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	2.78983	1	3	3	1	2	1	1	2	2	1	1
+1	1	1	1	1	1	1	1.82441	1	1	1	2	1	1	1	1	1	1	1
+1	1	2	1	1	1	1	2.84274	1	2	2	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	0.441923	1	2	1	1	1	2	1	1	1	1	1
+2	1	2	1	1	2	1	1.7655	2	3	3	1	2	3	1	2	1	1	1
+1	1	1	1	1	1	1	0.958711	1	1	1	1	1	1	1	2	1	1	1
+2	1	2	1	1	2	1	6.41105	2	3	3	1	2	3	1	1	1	1	1
+2	1	2	1	1	1	1	3.38831	1	1	1	1	2	3	1	1	1	1	1
+1	1	2	1	1	1	1	0.558543	1	1	1	1	1	3	1	1	1	1	1
+1	1	1	1	1	1	1	0.8927	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	3.85972	1	2	1	1	1	1	1	1	2	1	2
+2	1	2	1	1	2	1	1.44503	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	1.74094	2	3	3	1	2	3	2	2	1	1	1
+2	1	2	1	1	1	1	2.0474	1	1	1	1	1	3	2	2	1	1	1
+2	1	2	1	1	2	1	3.30109	2	3	3	1	2	2	1	1	2	1	1
+1	1	1	1	1	1	1	0.175867	1	1	1	2	1	1	1	1	1	1	1
+2	1	1	1	1	1	1	3.17026	1	1	1	1	1	1	1	1	2	1	1
+2	1	1	1	1	1	1	2.87535	1	1	1	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	5.92314	2	3	3	1	2	3	2	1	2	1	1
+2	1	2	1	1	1	1	4.95244	1	1	1	1	1	3	1	1	1	1	1
+2	1	2	1	1	2	1	9.64896	2	2	2	1	2	1	1	1	2	2	1
+2	1	2	1	1	1	1	1.87266	2	2	2	1	1	3	1	1	1	1	1
+2	1	2	1	1	2	1	3.7852	2	3	3	1	2	1	2	2	1	1	1
+1	1	1	1	1	1	1	0.506625	1	1	1	1	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	5.03595	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	5.11649	1	3	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	1.09823	2	2	2	2	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	6.65728	2	3	3	1	2	1	1	1	1	1	1
+1	1	2	1	1	1	1	1.56095	2	2	2	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	6.77321	2	3	3	2	2	3	1	2	1	1	1
+2	1	2	1	1	1	1	5.95268	2	3	3	1	1	1	1	2	1	1	1
+2	1	2	1	1	2	1	0.165313	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	1.26361	2	3	3	1	2	1	1	2	1	1	1
+1	1	1	1	1	1	1	2.53638	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	4.72625	2	3	3	1	2	3	1	1	2	1	1
+1	1	1	1	1	1	1	1.08404	1	1	1	1	1	1	2	1	1	1	1
+2	1	2	1	1	1	1	7.6098	1	3	2	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	4.54316	2	3	3	1	2	1	1	1	2	1	2
+2	1	2	1	1	2	1	2.83239	2	3	3	1	2	1	2	2	1	1	1
+1	1	2	1	1	1	1	2.36326	1	2	2	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	3.38934	1	1	1	1	1	3	1	1	1	1	1
+2	1	2	1	1	2	1	4.07199	2	3	3	1	2	3	1	1	2	2	1
+2	1	2	1	1	1	1	1.12239	1	2	1	1	1	3	1	1	1	1	1
+1	1	2	1	1	1	1	7.1163	1	2	2	1	1	1	1	2	1	1	1
+2	1	2	1	1	1	1	4.52991	1	2	2	1	1	1	2	2	1	1	1
+2	1	2	1	1	2	1	4.81663	1	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	2.64504	1	2	1	1	1	1	1	1	2	1	2
+2	1	2	1	1	1	1	13.4002	1	2	2	1	1	3	2	2	1	1	1
+2	1	2	1	1	2	1	3.95547	1	3	3	1	2	1	1	1	1	1	1
+2	1	1	1	1	1	1	0.0647507	1	1	1	1	1	1	1	2	1	1	1
+2	1	2	1	1	1	1	0.942362	2	3	3	1	1	3	1	1	1	1	1
+2	1	2	1	1	2	1	13.2598	2	3	3	1	2	2	2	1	1	1	1
+2	1	2	1	1	1	1	0.712019	1	1	1	1	2	3	1	1	1	1	1
+2	1	2	1	1	2	1	1.62311	2	3	3	1	2	1	1	1	1	1	1
+1	1	1	1	1	1	1	1.18222	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	4.73918	2	2	2	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	10.2898	1	3	1	2	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	0.48853	1	2	2	2	2	1	1	2	1	1	1
+2	1	2	1	1	1	1	3.12597	1	3	1	1	2	1	1	1	2	2	1
+1	1	1	1	1	1	1	3.24062	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	2.72961	2	3	3	1	2	1	2	2	1	1	1
+2	1	2	1	1	2	1	8.67239	2	3	3	1	2	1	1	1	1	1	1
+2	1	1	1	1	1	1	4.87987	1	1	1	1	1	1	2	2	1	1	1
+1	1	2	1	1	1	1	1.71976	1	1	1	1	1	3	1	1	1	1	1
+2	1	2	1	1	2	1	0.572811	2	3	3	1	2	1	1	1	2	1	1
+2	1	2	1	1	2	1	3.3236	2	3	3	1	1	3	1	1	1	1	1
+2	1	2	1	1	2	1	4.59497	2	3	3	1	2	1	1	1	2	1	1
+2	1	2	1	1	2	1	0.632286	2	3	3	1	2	3	1	1	1	1	1
+1	1	1	1	1	1	1	7.83376	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	9.83427	2	3	3	1	2	3	1	1	2	2	1
+2	1	2	1	1	1	1	4.23907	1	2	1	1	1	3	1	1	1	1	1
+2	1	2	1	1	2	1	5.744	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	1.11516	2	3	3	1	2	1	1	1	2	2	1
+2	1	2	1	2	2	1	8.3194	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	5.0832	1	3	2	1	2	1	1	1	1	1	1
+2	1	1	1	1	1	1	1.14137	1	1	1	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	3.91134	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	7.92332	1	3	3	1	2	1	1	1	1	1	1
+1	1	2	1	1	1	1	2.15771	2	2	2	1	1	1	2	2	1	1	1
+2	1	2	1	1	2	1	8.97816	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	7.5717	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	4.81798	2	3	3	1	1	1	1	1	1	1	1
+1	1	2	1	1	1	1	0.398659	1	1	1	1	1	3	1	1	1	1	1
+1	1	2	1	1	1	1	1.72172	1	1	1	1	1	2	1	1	1	1	1
+2	1	1	1	1	1	1	2.88676	1	1	1	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	1.49484	2	3	3	1	1	1	1	1	1	1	1
+2	1	1	1	1	1	1	3.50997	1	1	1	1	2	1	1	1	1	1	1
+1	1	2	1	1	1	1	2.84745	2	2	2	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	0.415631	2	3	3	1	2	3	1	1	1	1	1
+1	1	1	1	1	1	1	8.65392	1	1	1	1	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	1.16434	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	1.50616	2	3	3	1	2	3	1	1	1	1	1
+2	1	2	1	1	2	1	4.38303	2	3	3	1	2	3	2	2	2	2	1
+2	1	2	1	1	2	1	1.68564	2	3	3	1	2	3	1	1	2	2	1
+2	1	2	1	1	1	1	3.63619	1	1	1	1	1	3	1	1	2	1	1
+1	1	2	1	1	1	1	0.137721	2	2	2	2	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	5.09617	2	3	3	1	2	1	1	1	1	1	1
+1	1	1	1	1	1	1	0.583499	1	1	1	1	1	1	1	1	1	1	1
+1	1	2	1	1	1	1	1.06402	1	1	1	1	1	2	1	1	1	1	1
+2	1	2	1	1	2	1	3.93912	2	3	3	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	2.41567	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	8.07558	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	3.15407	2	2	2	1	1	3	1	1	2	2	1
+2	1	2	1	1	1	1	4.36519	2	2	2	1	1	3	1	1	1	1	1
+2	1	2	1	1	2	1	6.53596	2	3	3	1	2	1	1	1	1	1	1
+1	1	1	1	1	1	1	1.44498	1	1	1	1	1	1	1	1	1	1	1
+1	1	2	1	1	1	1	4.08306	1	1	1	1	1	2	1	1	1	1	1
+2	1	2	1	1	2	1	4.50829	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	1.11699	1	1	1	1	1	3	1	1	1	1	1
+1	1	2	1	1	1	1	0.0517742	2	2	2	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	0.38734	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	4.56545	1	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	5.1679	2	3	3	1	2	1	1	1	1	1	1
+1	1	1	1	1	1	1	0.307854	1	1	1	1	1	1	2	2	1	1	1
+2	1	2	1	1	2	1	2.32885	2	3	3	2	2	3	1	1	2	1	1
+1	1	1	1	1	1	1	0.289901	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	0.319237	1	3	1	1	1	1	1	2	2	2	1
+2	1	2	1	1	2	1	0.827021	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	3.37409	2	2	2	2	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	1.6608	2	3	3	1	2	1	1	1	1	1	1
+1	1	1	1	1	1	1	3.24663	1	1	1	1	1	1	1	2	1	1	1
+2	1	2	1	1	2	1	0.310255	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	0.0629292	1	3	1	1	2	1	1	1	2	2	2
+1	1	2	1	1	1	1	4.55089	1	1	1	1	1	3	2	1	1	1	1
+2	1	2	1	1	1	1	0.978341	2	2	2	1	1	2	2	2	1	1	1
+2	1	2	1	1	1	1	0.0404361	2	2	2	1	1	1	1	1	2	2	1
+2	1	2	1	1	2	1	2.45037	2	3	3	1	2	1	1	1	2	1	1
+2	1	2	1	1	2	1	13.4934	2	3	3	1	2	1	1	1	1	1	1
+1	1	2	1	1	1	1	1.78284	2	2	2	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	2.77131	2	3	3	1	2	1	1	1	2	1	1
+2	1	2	1	1	2	1	0.485846	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	0.557565	1	1	1	1	1	3	1	1	2	1	1
+2	1	2	1	1	2	1	4.54794	1	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	7.94793	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	1.95272	1	1	1	1	2	3	1	1	2	2	1
+2	1	1	1	1	1	1	6.14495	1	1	1	2	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	3.17644	2	2	2	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	1.49873	1	3	3	1	1	3	1	1	2	1	1
+2	1	2	1	1	2	1	7.27586	2	3	3	1	2	1	1	2	1	1	1
+2	1	2	1	1	2	1	0.0191831	2	3	3	1	2	1	1	2	1	1	1
+2	1	2	1	1	2	1	1.57877	2	3	3	1	2	1	1	1	1	1	1
+1	1	1	1	1	1	1	4.98835	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	6.8749	2	3	3	1	2	1	2	2	1	1	1
+2	1	2	1	1	2	1	8.94435	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	1.60548	2	2	2	1	2	1	1	1	2	1	1
+2	1	2	1	1	2	1	4.81511	2	3	3	2	2	3	1	1	1	1	1
+2	1	2	1	1	2	1	1.25986	2	3	3	1	2	3	1	1	1	1	1
+2	1	2	1	1	2	1	3.24832	1	3	3	1	2	1	1	1	1	1	1
+1	1	1	1	1	1	1	0.373889	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	4.56923	1	3	3	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	1.15876	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	10.7347	1	1	1	1	1	3	1	1	1	1	1
+2	1	1	1	1	1	1	1.21132	1	1	1	1	1	1	2	2	2	2	1
+1	1	1	1	1	1	1	4.26163	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	2.62008	2	3	3	1	2	2	1	2	2	1	1
+2	2	2	1	1	2	1	0.728309	2	3	3	2	2	1	1	1	1	1	1
+1	1	2	1	1	1	1	2.1095	1	1	1	2	1	3	1	1	2	1	1
+1	1	1	1	1	1	1	3.22218	1	1	1	2	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	6.82864	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	0.617669	2	3	3	1	2	1	1	1	1	1	1
+1	1	2	1	1	1	1	4.4714	1	1	1	1	1	2	1	1	1	1	1
+2	1	2	1	1	1	1	5.03374	1	3	3	1	1	3	1	1	1	1	1
+2	1	1	1	1	1	1	7.76097	1	1	1	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	5.23639	1	2	2	1	2	1	1	1	1	1	1
+1	1	2	1	1	1	1	2.00206	1	2	2	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	11.9459	2	2	2	1	1	2	1	1	2	2	1
+2	1	2	1	1	1	1	3.01872	2	2	2	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	5.76099	2	3	3	1	2	3	1	1	1	1	1
+2	1	2	1	1	2	1	9.94833	2	3	3	1	2	1	1	1	2	1	2
+2	1	1	1	1	1	1	0.213727	1	1	1	1	1	1	1	1	2	2	1
+2	1	2	1	1	1	1	1.3124	1	1	1	1	2	3	1	1	1	1	1
+1	1	2	1	1	1	1	1.20814	2	2	2	2	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	2.80371	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	5.33366	1	1	1	1	2	3	1	1	1	1	1
+2	1	1	1	1	1	1	1.02967	1	1	1	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	3.29782	1	2	2	1	1	3	1	2	2	2	1
+2	1	2	1	1	1	1	0.959845	1	1	1	2	1	3	1	1	1	1	1
+2	1	1	1	1	1	1	3.77166	1	1	1	1	2	1	1	2	1	1	1
+2	1	2	1	1	1	1	0.854945	2	3	3	1	2	1	1	1	1	1	1
+1	1	1	1	1	1	1	5.1725	1	1	1	1	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	0.915254	1	1	1	2	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	3.5404	2	3	3	1	2	1	2	2	1	1	1
+2	1	2	1	1	1	1	4.75054	1	2	1	1	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	0.551718	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	2.75893	2	3	3	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	0.765714	2	3	3	1	2	2	2	2	2	1	1
+2	1	1	1	1	1	1	3.27354	1	1	1	1	1	1	1	1	2	2	1
+2	1	2	1	1	1	1	0.363779	1	2	1	1	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	1.34822	1	1	1	1	1	1	2	1	1	1	1
+2	1	2	1	1	2	1	2.70457	2	3	3	1	2	1	1	1	2	1	2
+2	1	2	1	1	2	1	0.260962	2	3	3	1	2	3	1	1	2	2	1
+1	1	1	1	1	1	1	1.71149	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	4.76273	2	2	2	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	3.06292	2	3	3	1	2	1	1	2	1	1	1
+2	1	2	1	1	1	1	0.115639	2	3	3	1	1	3	1	1	1	1	1
+2	1	2	1	1	1	1	0.862441	1	2	1	1	1	2	1	1	2	2	1
+2	1	2	1	1	1	1	8.06165	1	2	2	2	1	2	2	2	1	1	1
+2	1	2	1	1	2	1	3.23072	2	3	3	1	2	1	1	1	2	1	2
+2	1	2	1	1	1	1	4.41546	1	1	1	1	1	3	2	2	2	1	1
+2	1	2	1	1	1	1	0.807974	1	1	1	2	2	3	1	2	1	1	1
+2	1	2	1	1	2	1	8.26548	2	3	3	1	2	2	1	1	1	1	1
+1	1	2	1	1	1	1	1.69403	2	2	2	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	2.48769	1	3	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	2.29564	1	2	2	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	8.31266	2	3	3	1	2	1	1	2	1	1	1
+2	1	2	1	1	2	1	7.12005	2	3	3	1	2	1	1	1	1	1	1
+2	1	1	1	1	1	1	4.98447	1	1	1	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	2.78413	2	3	3	1	2	1	1	1	1	1	1
+1	1	1	1	1	1	1	0.335135	1	1	1	1	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	0.364792	1	1	1	1	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	4.8933	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	3.95329	2	2	2	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	5.76189	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	2.28195	2	3	3	1	2	1	1	1	1	1	1
+1	1	2	1	1	1	1	2.51306	2	2	2	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	0.287996	2	3	3	2	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	4.41019	2	3	3	1	2	1	1	2	1	1	1
+2	1	1	1	1	1	1	4.85756	1	1	1	2	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	0.913549	2	3	3	1	2	1	1	1	2	1	1
+2	1	2	1	1	1	1	3.19129	1	1	1	1	1	3	1	1	1	1	1
+1	1	2	1	1	1	1	0.910357	2	2	2	1	1	1	1	1	1	1	1
+2	1	1	1	1	1	1	1.43587	1	1	1	1	2	1	1	2	1	1	1
+2	1	2	1	1	2	1	7.62571	2	3	3	2	2	1	1	1	2	1	1
+2	1	2	1	1	2	1	2.0177	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	3.03181	2	3	3	1	2	3	2	2	1	1	1
+2	1	2	1	1	1	1	4.41653	1	2	2	1	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	1.98272	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	6.1215	2	3	3	2	1	1	1	1	2	1	1
+2	1	2	1	1	2	1	0.504951	2	3	3	1	2	2	1	1	2	2	1
+2	1	2	1	1	2	1	3.43942	2	3	3	1	2	1	1	2	1	1	1
+2	1	2	1	1	2	1	0.168117	2	3	3	1	2	1	1	1	1	1	1
+1	1	1	1	1	1	1	2.7116	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	1.73236	2	3	3	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	1.40971	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	10.4031	1	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	1.09535	2	2	2	1	1	1	2	2	2	1	1
+2	1	2	1	1	1	1	0.710853	1	1	1	1	1	3	1	2	1	1	1
+2	1	2	1	1	1	1	2.21968	1	3	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	2.05657	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	0.0965595	2	3	3	1	2	1	2	1	1	1	1
+1	1	2	1	1	1	1	2.20098	1	1	1	1	1	3	1	1	1	1	1
+2	1	2	1	1	2	1	1.65946	2	3	3	1	2	3	1	1	2	1	1
+2	1	2	1	1	2	1	1.35011	2	3	3	1	2	1	1	1	2	1	1
+1	1	1	1	1	1	1	0.864032	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	1.6766	2	2	2	1	2	2	1	1	2	2	1
+2	1	1	1	1	1	1	1.12958	1	1	1	1	1	1	1	1	2	2	1
+2	1	2	1	1	2	1	1.17241	2	3	3	1	2	1	2	1	2	1	1
+1	1	2	1	1	1	1	18.4318	1	2	2	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	4.82519	2	2	2	1	1	3	1	1	1	1	1
+2	1	2	1	1	1	1	1.5247	2	2	2	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	3.75458	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	10.7041	2	3	3	1	2	2	1	1	1	1	1
+2	1	2	1	1	2	1	9.98006	2	3	3	1	2	2	1	1	1	1	1
+2	1	2	1	1	2	1	1.76827	2	3	3	2	2	1	2	1	2	1	1
+2	1	1	1	1	1	1	4.03522	1	1	1	1	1	1	2	2	1	1	1
+2	1	1	1	1	1	1	2.74773	1	1	1	1	1	1	1	1	2	1	1
+2	1	2	1	1	2	1	4.37994	1	3	3	2	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	0.89003	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	0.380096	1	3	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	1.86974	2	3	3	1	2	2	1	1	1	1	1
+2	1	2	1	1	1	1	2.84481	2	3	3	2	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	0.337754	2	2	2	1	2	1	1	1	1	1	1
+2	1	1	1	1	1	1	10.0524	1	1	1	1	1	1	1	1	2	1	1
+2	1	2	1	1	1	1	2.83316	2	2	2	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	0.287686	2	3	2	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	4.57857	2	3	3	1	2	1	1	2	2	2	1
+2	1	2	1	1	1	1	10.9705	1	2	2	1	2	3	1	1	2	1	1
+2	1	2	1	1	2	1	5.6787	2	3	3	1	2	3	2	2	2	2	1
+2	1	1	1	1	1	1	4.84172	1	1	1	1	2	1	1	1	1	1	1
+1	1	2	1	1	1	1	0.447668	2	2	2	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	8.37605	2	3	3	1	2	1	1	2	1	1	1
+2	1	2	1	1	2	1	4.4099	2	3	3	1	2	1	1	1	2	1	1
+2	1	2	1	1	1	1	5.29519	2	2	2	1	1	3	1	1	1	1	1
+1	1	2	1	1	1	1	3.60551	1	1	1	1	1	3	1	2	1	1	1
+2	1	1	1	1	2	2	1.10078	1	1	1	2	2	1	1	1	1	1	1
+1	1	1	1	1	1	1	0.142979	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	0.238895	2	2	2	1	2	1	2	1	2	1	2
+2	1	2	1	1	2	1	1.98115	2	3	3	1	2	3	1	1	1	1	1
+1	1	1	1	1	1	1	1.10228	1	1	1	1	1	1	1	2	1	1	1
+2	1	2	1	1	2	1	3.88951	2	3	3	2	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	7.72912	2	3	3	1	2	3	1	1	1	1	1
+2	1	2	1	1	2	1	1.98225	2	3	3	1	2	2	1	1	2	1	1
+1	1	1	1	1	1	1	4.67034	1	1	1	2	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	2.37675	1	1	1	1	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	5.00484	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	0.96131	1	1	1	1	1	3	1	1	2	1	2
+2	1	2	1	1	1	1	2.94174	1	1	1	1	2	2	1	1	2	2	1
+2	1	2	1	1	2	1	3.40327	2	3	2	1	2	1	2	2	1	1	1
+1	1	2	1	1	1	1	2.81788	1	1	1	1	1	2	1	1	2	1	1
+1	1	1	1	1	1	1	3.95297	1	1	1	1	1	1	1	2	1	1	1
+2	1	2	1	1	2	1	13.659	2	3	3	1	2	3	1	1	1	1	1
+1	1	1	1	1	1	1	1.40142	1	1	1	1	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	4.21091	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	2.75431	2	3	3	2	2	1	1	1	2	1	1
+2	1	2	1	1	2	1	5.70335	2	3	3	1	2	2	1	1	1	1	1
+2	1	1	1	1	1	1	2.54218	1	1	1	1	2	1	1	1	2	1	1
+1	1	1	1	1	1	1	0.807303	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	3.04839	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	0.140617	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	0.581715	2	2	2	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	4.22689	1	1	1	1	2	3	1	1	1	1	1
+2	1	2	1	1	2	1	0.892442	2	3	3	1	2	2	1	1	1	1	1
+2	1	2	1	1	2	1	4.29428	2	3	3	1	2	1	2	2	1	1	1
+1	1	1	1	1	1	1	4.83098	1	1	1	1	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	4.74817	1	1	1	1	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	2.49175	1	1	1	1	1	1	1	2	1	1	1
+2	1	2	1	1	2	1	0.710378	2	3	3	1	2	2	2	2	1	1	1
+2	1	2	1	1	1	1	5.10286	2	2	2	1	1	1	1	1	2	2	1
+1	1	1	1	1	1	1	0.918882	1	1	1	1	1	1	1	1	1	1	1
+2	1	1	1	1	1	1	0.0441354	1	1	1	1	1	1	1	1	2	1	1
+1	1	2	1	1	1	1	0.956322	1	1	1	1	1	3	1	1	1	1	1
+2	1	2	1	1	1	1	0.501229	1	2	2	1	2	3	1	1	2	2	1
+2	1	2	1	1	2	1	2.03462	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	4.49454	1	2	2	1	1	3	1	1	1	1	1
+1	1	2	1	1	1	1	3.47399	1	1	1	1	1	3	1	1	1	1	1
+2	1	2	1	1	1	1	3.42912	1	1	1	1	1	2	2	1	2	2	1
+1	1	2	1	1	1	1	3.92437	1	1	1	1	1	3	1	1	1	1	1
+2	1	1	1	1	1	1	0.51396	1	1	1	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	4.12695	2	3	3	1	2	1	1	1	2	1	1
+2	1	2	1	1	2	1	2.44146	2	3	3	1	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	9.60595	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	2.0039	2	2	2	1	2	1	1	1	2	2	1
+2	1	2	1	1	2	1	4.10378	2	3	3	1	2	1	1	1	1	1	1
+2	1	1	1	1	1	1	0.386532	1	1	1	1	1	1	2	2	1	1	1
+2	1	2	1	1	1	1	0.75722	1	1	1	1	1	3	1	1	1	1	1
+1	1	1	1	1	1	1	0.506289	1	1	1	1	1	1	1	2	1	1	1
+1	1	1	1	1	1	1	1.84871	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	6.89466	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	1.30596	2	2	2	1	1	3	1	1	2	2	1
+2	1	2	1	1	1	1	6.80188	1	2	2	1	1	3	1	1	1	1	1
+2	1	2	1	1	1	1	4.86438	1	3	1	1	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	2.90783	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	0.971687	2	3	2	1	1	1	2	2	1	1	1
+2	1	2	1	1	2	1	1.88183	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	4.17229	1	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	0.927847	2	3	3	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	4.36548	2	2	2	1	1	3	1	1	1	1	1
+2	1	2	1	1	2	1	2.00101	2	3	3	1	2	1	1	1	1	1	1
+2	1	1	1	1	1	1	2.28421	1	1	1	1	2	1	2	2	1	1	1
+1	1	1	1	1	1	1	1.86953	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	9.0133	1	2	2	1	2	3	1	1	1	1	1
+2	1	2	1	1	1	1	0.439457	2	2	2	1	2	3	1	1	1	1	1
+1	1	1	1	1	1	1	4.34038	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	4.32347	2	2	2	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	6.60777	2	3	3	1	2	1	1	1	1	1	1
+1	1	1	1	1	1	1	0.806183	1	1	1	1	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	7.83139	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	2.49472	1	1	1	1	2	2	1	1	1	1	1
+2	1	2	1	1	1	1	0.942534	1	2	1	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	1.70449	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	3.0436	2	3	3	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	3.93414	1	3	3	1	2	1	1	1	2	2	1
+2	1	2	1	1	2	1	2.13185	2	3	3	2	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	0.262005	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	12.7252	1	2	2	1	2	3	1	1	1	1	1
+1	1	1	1	1	1	1	0.465012	1	1	1	1	1	1	2	2	1	1	1
+1	1	2	1	1	1	1	0.455832	1	1	1	1	1	3	1	1	1	1	1
+2	1	1	1	1	1	1	5.52702	1	1	1	1	2	1	1	1	1	1	1
+1	1	2	1	1	1	1	4.37922	1	1	1	1	1	2	1	1	1	1	1
+2	1	2	1	1	1	1	8.52767	1	2	2	1	1	1	1	1	1	1	1
+1	1	2	1	1	1	1	2.53081	1	2	1	1	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	1.34317	1	1	1	1	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	2.24552	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	3.39164	2	3	3	1	2	1	1	2	1	1	1
+2	1	1	1	1	1	1	0.635824	1	1	1	1	1	1	1	1	2	2	1
+2	1	2	1	1	2	1	0.810242	2	3	3	2	2	3	1	1	1	1	1
+2	1	2	1	1	1	1	20.3734	1	2	2	1	1	1	1	1	1	1	1
+2	1	1	1	1	1	1	0.314643	1	1	1	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	1.93743	2	2	2	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	2.55162	2	3	3	1	2	3	1	2	1	1	1
+1	1	2	1	1	1	1	0.729802	2	2	2	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	0.0873788	2	3	3	1	2	2	1	1	1	1	1
+1	1	1	1	1	1	1	2.09206	1	1	1	1	1	1	1	2	1	1	1
+2	1	2	1	1	2	1	0.834649	2	3	3	1	2	3	1	1	1	1	1
+1	1	2	1	1	1	1	9.7003	1	1	1	1	1	2	1	1	1	1	1
+2	1	2	1	1	1	1	4.45689	1	1	1	1	1	2	1	1	2	1	1
+2	1	1	1	1	1	1	0.802165	1	1	1	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	5.66099	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	1.61237	1	1	1	1	1	3	1	1	2	2	1
+1	1	1	1	1	1	1	2.97608	1	1	1	2	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	1.48756	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	3.87253	2	2	2	2	1	1	1	2	1	1	1
+2	1	2	1	1	2	1	7.42702	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	0.209732	2	3	3	2	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	2.55715	2	2	2	1	1	2	2	2	1	1	1
+2	1	2	1	1	1	1	0.207224	2	2	2	1	2	1	1	1	1	1	1
+2	1	1	1	1	2	1	7.37554	1	1	1	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	4.11792	2	3	3	2	2	1	2	2	1	1	1
+2	1	1	1	1	1	1	1.53867	1	1	1	1	1	1	2	2	2	1	2
+2	1	2	1	1	2	1	0.0302816	2	3	3	1	2	3	1	1	1	1	1
+2	1	2	1	1	1	1	2.28003	1	1	1	1	2	2	1	1	1	1	1
+2	1	2	1	1	2	1	2.9777	2	3	3	1	2	1	2	1	2	2	1
+1	1	1	1	1	1	1	0.0199808	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	3.29523	1	3	1	1	1	2	1	1	1	1	1
+2	1	2	1	1	2	1	1.64431	2	3	3	1	2	1	1	2	1	1	1
+1	1	1	1	1	1	1	1.65059	1	1	1	1	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	1.37525	1	1	1	1	1	1	1	2	1	1	1
+2	1	2	1	1	2	1	1.73187	2	3	3	1	2	1	1	1	2	1	1
+2	1	2	1	1	2	1	1.01163	2	3	3	1	2	1	1	1	2	1	1
+2	1	2	1	1	2	1	1.87413	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	4.35695	2	2	2	1	1	2	1	1	1	1	1
+2	1	2	1	1	1	1	0.273621	2	3	3	1	1	3	1	1	1	1	1
+2	1	1	1	1	2	1	3.43754	1	1	1	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	0.69945	2	2	2	1	1	3	1	1	1	1	1
+1	1	1	1	1	1	1	6.24086	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	0.112064	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	3.88415	1	2	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	1.06286	2	2	2	1	1	1	1	1	2	1	1
+2	1	2	1	1	2	1	2.17353	2	3	3	1	2	1	1	2	1	1	1
+1	1	1	1	1	1	1	1.49488	1	1	1	2	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	8.26156	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	2.29956	2	3	3	1	2	1	1	1	2	1	2
+2	1	2	1	1	2	1	5.02241	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	1.79705	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	2.41045	1	2	2	1	2	2	1	2	1	1	1
+2	1	2	1	1	1	1	3.62587	1	2	2	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	3.03338	2	3	3	1	2	3	1	1	2	2	1
+2	1	1	1	1	1	1	1.32098	1	1	1	1	2	1	1	1	1	1	1
+1	1	2	1	1	1	1	2.90188	1	1	1	1	1	3	1	1	1	1	1
+1	1	2	1	1	1	1	2.5172	2	2	2	1	1	1	1	1	1	1	1
+1	1	2	1	1	1	1	1.59161	1	1	1	1	1	2	1	1	1	1	1
+2	1	2	1	1	1	1	1.51327	1	2	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	3.61682	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	0.582747	2	3	3	1	2	1	1	1	1	1	1
+2	1	1	1	1	1	1	1.78714	1	1	1	1	1	1	1	1	2	1	1
+2	1	2	1	1	2	1	3.90871	2	3	3	1	2	1	1	1	2	2	1
+2	1	2	1	1	2	1	2.12194	2	3	3	1	2	3	1	1	1	1	1
+2	1	2	1	1	2	1	2.85085	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	2.63259	1	1	1	1	1	3	1	1	1	1	1
+2	1	2	1	1	1	1	1.90261	1	1	1	1	2	3	1	1	1	1	1
+2	1	2	1	1	2	1	1.12473	2	3	3	2	2	2	1	1	1	1	1
+1	1	2	1	1	1	1	0.744409	2	2	2	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	0.553062	2	3	3	1	2	3	2	2	1	1	1
+2	1	2	1	1	2	1	4.13517	2	3	3	2	2	1	1	1	1	1	1
+2	1	2	1	1	1	1	5.34859	1	3	1	1	1	3	1	1	1	1	1
+1	1	2	1	1	1	1	4.14217	2	2	2	1	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	4.68854	1	1	1	1	1	1	1	1	1	1	1
+2	1	1	1	1	1	1	2.47433	1	1	1	1	2	1	1	1	2	1	1
+2	1	2	1	1	1	1	4.04289	2	3	3	1	2	1	1	1	1	1	1
+1	1	2	1	1	1	1	4.64514	2	2	2	1	1	1	1	2	1	1	1
+2	1	1	1	1	1	1	3.52575	1	1	1	2	1	1	1	1	2	2	1
+2	1	2	1	1	2	1	0.0085396	2	3	3	1	2	1	1	1	2	2	1
+2	1	2	1	1	2	1	3.75628	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	4.46408	2	3	3	1	2	1	2	2	1	1	1
+1	1	2	1	1	1	1	4.407	1	2	2	1	1	1	2	1	1	1	1
+2	1	2	1	1	2	1	12.9879	2	3	3	1	2	1	1	1	2	1	1
+2	1	2	1	1	2	1	5.42745	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	2.27077	2	3	3	1	2	1	1	1	2	1	1
+1	1	1	1	1	1	1	4.19191	1	1	1	1	1	1	1	1	1	1	1
+1	1	1	1	1	1	1	1.43925	1	1	1	1	1	1	1	2	1	1	1
+1	1	1	1	1	1	1	4.98537	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	1.71189	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	4.91003	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	2	2	1	0.809663	2	3	3	1	2	1	1	1	1	1	1
+2	1	2	1	1	2	1	3.78373	2	3	3	1	2	1	1	1	1	1	1
+2	1	1	1	1	1	1	1.64728	1	1	1	1	2	1	1	2	2	1	1
+2	1	2	1	1	2	1	0.977114	2	3	3	1	2	2	1	1	1	1	1
+2	1	2	1	1	2	1	4.78619	2	3	3	1	2	1	1	1	1	1	1
+2	1	1	1	1	2	1	4.88483	1	1	1	2	2	1	1	1	2	1	1
+1	1	1	1	1	1	1	0.0447191	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	2	1	6.22958	2	3	3	1	2	1	1	1	1	1	1
+1	1	1	1	1	1	1	4.02524	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	5.10729	1	3	2	1	1	1	1	1	2	2	1
+2	1	2	1	1	2	1	8.97099	2	3	3	1	2	3	1	1	1	1	1
+2	1	2	1	1	2	1	5.59486	2	3	3	1	2	1	1	1	1	1	1
+1	1	1	1	1	1	1	1.13786	1	1	1	1	1	1	1	1	1	1	1
+2	1	2	1	1	1	1	11.3795	1	2	2	1	1	1	1	1	1	1	1
+
diff --git a/sourcecodes/data/examplecar/OVIgraphviz.txt b/sourcecodes/data/examplecar/OVIgraphviz.txt
new file mode 100644
index 00000000..2aaaecb2
--- /dev/null
+++ b/sourcecodes/data/examplecar/OVIgraphviz.txt
@@ -0,0 +1,70 @@
+digraph G {
+size="10,10";  ratio = fill;
+node [shape=square,width=1.5];
+Dist -> BatAge;
+Dist -> Timing;
+Dist -> Plugs;
+Dist -> AirFilter;
+Dist -> GasTank;
+Dist -> GasFilter;
+SpkQual -> Starts;
+MFuse -> Starts;
+MFuse -> Dist;
+MFuse -> SpkQual;
+MFuse -> Starter;
+MFuse -> BatAge;
+MFuse -> Charging;
+MFuse -> Timing;
+MFuse -> Cranks;
+MFuse -> Plugs;
+MFuse -> AirFilter;
+MFuse -> Air;
+MFuse -> Fuel;
+MFuse -> GasTank;
+MFuse -> GasFilter;
+Alter -> Dist;
+Alter -> MFuse;
+Alter -> BatAge;
+Alter -> Charging;
+Alter -> Timing;
+Alter -> Plugs;
+Alter -> AirFilter;
+Alter -> Air;
+Alter -> GasTank;
+Alter -> GasFilter;
+Starter -> Cranks;
+StMotor -> MFuse;
+StMotor -> Alter;
+StMotor -> Starter;
+StMotor -> BatAge;
+StMotor -> Timing;
+StMotor -> Plugs;
+StMotor -> AirFilter;
+StMotor -> Air;
+StMotor -> Fuel;
+StMotor -> GasTank;
+StMotor -> GasFilter;
+PlugVolt -> Starts;
+PlugVolt -> Dist;
+PlugVolt -> SpkQual;
+PlugVolt -> MFuse;
+PlugVolt -> Alter;
+PlugVolt -> Starter;
+PlugVolt -> StMotor;
+PlugVolt -> Charging;
+PlugVolt -> Cranks;
+BatVolt -> Starts;
+BatVolt -> Dist;
+BatVolt -> SpkQual;
+BatVolt -> MFuse;
+BatVolt -> Alter;
+BatVolt -> Starter;
+BatVolt -> StMotor;
+BatVolt -> Charging;
+BatVolt -> PlugVolt;
+BatVolt -> Cranks;
+Plugs -> SpkQual;
+AirFilter -> Air;
+GasTank -> Fuel;
+GasFilter -> Fuel;
+}
\ No newline at end of file
diff --git a/sourcecodes/data/examplecar/OVIk.txt b/sourcecodes/data/examplecar/OVIk.txt
new file mode 100644
index 00000000..d00491fd
--- /dev/null
+++ b/sourcecodes/data/examplecar/OVIk.txt
@@ -0,0 +1 @@
+1
diff --git a/sourcecodes/data/examplecar/OVImap.txt b/sourcecodes/data/examplecar/OVImap.txt
new file mode 100644
index 00000000..eda717d2
--- /dev/null
+++ b/sourcecodes/data/examplecar/OVImap.txt
@@ -0,0 +1,19 @@
+Starts	3	0.432505	1.751249
+Dist	3	0.094441	1.008991
+SpkQual	2	0.434234	1.748252
+MFuse	2	0.031607	1.000999
+Alter	2	0.054690	1.002997
+Starter	2	0.490666	1.402597
+StMotor	2	0.070534	1.004995
+BatAge	2	2.948418	3.295892
+Charging	2	0.500244	1.497502
+PlugVolt	2	0.908145	2.090909
+BatVolt	2	0.914876	1.999001
+Timing	2	0.293230	1.094905
+Cranks	2	0.500010	1.515485
+Plugs	2	0.819700	1.518482
+AirFilter	3	0.294607	1.095904
+Air	2	0.375671	1.169830
+Fuel	2	0.416982	1.223776
+GasTank	2	0.295974	1.096903
+GasFilter	1	0.164975	1.027972
diff --git a/sourcecodes/data/examplecar/OVImapdata.txt b/sourcecodes/data/examplecar/OVImapdata.txt
new file mode 100644
index 00000000..d1eac895
--- /dev/null
+++ b/sourcecodes/data/examplecar/OVImapdata.txt
@@ -0,0 +1 @@
+BatVolt	PlugVolt	StMotor	Alter	MFuse	Charging	Starter	Cranks	Dist	GasFilter	GasTank	Fuel	AirFilter	Air	Plugs	SpkQual	Starts	Timing	BatAge
diff --git a/sourcecodes/data/examplecar/OVIname.txt b/sourcecodes/data/examplecar/OVIname.txt
new file mode 100644
index 00000000..e7901e87
--- /dev/null
+++ b/sourcecodes/data/examplecar/OVIname.txt
@@ -0,0 +1 @@
+Starts	Dist	SpkQual	MFuse	Alter	Starter	StMotor	BatAge	Charging	PlugVolt	BatVolt	Timing	Cranks	Plugs	AirFilter	Air	Fuel	GasTank	GasFilter
diff --git a/sourcecodes/data/examplecar/OVInet_figure.txt b/sourcecodes/data/examplecar/OVInet_figure.txt
new file mode 100644
index 00000000..ceed746e
--- /dev/null
+++ b/sourcecodes/data/examplecar/OVInet_figure.txt
@@ -0,0 +1,237 @@
+19
+2100	1800	
+BatVolt	788	0
+PlugVolt	998	180
+StMotor	788	360
+Alter	998	540
+MFuse	788	720
+Charging	472	900
+Starter	998	900
+Cranks	0	1080
+Dist	1523	900
+GasFilter	263	1080
+GasTank	525	1080
+Fuel	472	1260
+AirFilter	788	1080
+Air	998	1260
+Plugs	1050	1080
+SpkQual	1523	1260
+Starts	788	1440
+Timing	1313	1080
+BatAge	1575	1080
+BatVolt	3
+250	150
+0
+10	2	3	4	5	6	7	8	9	16	17
+1	0.4184
+2	0.1639
+3	0.4177
+PlugVolt	3
+250	150
+1	1
+9	3	4	5	6	7	8	9	16	17
+1	0.3706
+2	0.1678
+3	0.4616
+StMotor	2
+250	150
+2	1	2
+11	4	5	7	10	11	12	13	14	15	18	19
+1	0.9955
+2	0.0045
+Alter	2
+250	150
+3	1	2	3
+10	5	6	9	10	11	13	14	15	18	19
+1	0.9970
+2	0.0030
+MFuse	2
+250	150
+4	1	2	3	4
+14	6	7	8	9	10	11	12	13	14	15	16	17	18	19
+1	0.9990
+2	0.0010
+Charging	2
+250	150
+4	1	2	4	5
+0
+1	0.5024
+2	0.4976
+Starter	2
+250	150
+4	1	2	3	5
+1	8
+1	0.5977
+2	0.4023
+Cranks	2
+250	150
+4	1	2	5	7
+0
+1	0.4848
+2	0.5152
+Dist	2
+250	150
+4	1	2	4	5
+6	10	11	13	15	18	19
+1	0.9910
+2	0.0090
+GasFilter	2
+250	150
+4	3	4	5	9
+1	12
+1	0.9725
+2	0.0275
+GasTank	2
+250	150
+4	3	4	5	9
+1	12
+1	0.9031
+2	0.0969
+Fuel	2
+250	150
+4	3	5	10	11
+0
+1	0.7756
+2	0.2244
+AirFilter	2
+250	150
+4	3	4	5	9
+1	14
+1	0.9040
+2	0.0960
+Air	2
+250	150
+4	3	4	5	13
+0
+1	0.8301
+2	0.1699
+Plugs	3
+250	150
+4	3	4	5	9
+1	16
+1	0.6922
+2	0.0970
+3	0.2109
+SpkQual	2
+250	150
+4	1	2	5	15
+1	17
+1	0.2568
+2	0.7432
+Starts	2
+250	150
+4	1	2	5	16
+0
+1	0.2497
+2	0.7503
+Timing	2
+250	150
+4	3	4	5	9
+0
+1	0.9053
+2	0.0947
+BatAge	1
+250	150
+4	3	4	5	9
+0
+-2.1178	0.0437
+-2.0287	0.0524
+-1.9396	0.0623
+-1.8505	0.0736
+-1.7614	0.0862
+-1.6723	0.1001
+-1.5832	0.1155
+-1.4941	0.1321
+-1.4050	0.1499
+-1.3159	0.1689
+-1.2268	0.1888
+-1.1377	0.2093
+-1.0486	0.2303
+-0.9595	0.2515
+-0.8704	0.2725
+-0.7813	0.2929
+-0.6922	0.3124
+-0.6031	0.3306
+-0.5140	0.3471
+-0.4249	0.3617
+-0.3358	0.3740
+-0.2467	0.3836
+-0.1576	0.3905
+-0.0685	0.3944
+0.0206	0.3952
+0.1097	0.3930
+0.1988	0.3877
+0.2879	0.3795
+0.3770	0.3687
+0.4661	0.3553
+0.5552	0.3398
+0.6443	0.3225
+0.7334	0.3036
+0.8225	0.2837
+0.9116	0.2629
+1.0007	0.2419
+1.0898	0.2207
+1.1789	0.1999
+1.2680	0.1796
+1.3571	0.1601
+1.4462	0.1417
+1.5353	0.1243
+1.6244	0.1083
+1.7135	0.0936
+1.8026	0.0803
+1.8917	0.0683
+1.9808	0.0576
+2.0699	0.0483
+2.1590	0.0401
+2.2481	0.0331
+2.3372	0.0271
+2.4263	0.0220
+2.5154	0.0177
+2.6045	0.0142
+2.6936	0.0112
+2.7827	0.0088
+2.8718	0.0069
+2.9609	0.0054
+3.0500	0.0041
+3.1391	0.0031
+3.2282	0.0024
+3.3173	0.0018
+3.4064	0.0013
+3.4954	0.0010
+3.5845	0.0007
+3.6736	0.0005
+3.7627	0.0004
+3.8518	0.0003
+3.9409	0.0002
+4.0300	0.0001
+4.1191	0.0001
+4.2082	0.0001
+4.2973	0.0000
+4.3864	0.0000
+4.4755	0.0000
+4.5646	0.0000
+4.6537	0.0000
+4.7428	0.0000
+4.8319	0.0000
+4.9210	0.0000
+5.0101	0.0000
+5.0992	0.0000
+5.1883	0.0000
+5.2774	0.0000
+5.3665	0.0000
+5.4556	0.0000
+5.5447	0.0000
+5.6338	0.0000
+5.7229	0.0000
+5.8120	0.0000
+5.9011	0.0000
+5.9902	0.0000
+6.0793	0.0000
+6.1684	0.0000
+6.2575	0.0000
+6.3466	0.0000
+6.4357	0.0000
+6.5248	0.0000
+6.6139	0.0000
+6.7030	0.0000
+6.7921	0.0000
diff --git a/sourcecodes/data/examplecar/OVInet_figure_new.txt b/sourcecodes/data/examplecar/OVInet_figure_new.txt
new file mode 100644
index 00000000..bd2ec975
--- /dev/null
+++ b/sourcecodes/data/examplecar/OVInet_figure_new.txt
@@ -0,0 +1,138 @@
+19	
+19
+2100	1800	
+BatVolt	788	0
+PlugVolt	998	180
+StMotor	788	360
+Alter	998	540
+MFuse	788	720
+Charging	472	900
+Starter	998	900
+Cranks	0	1080
+Dist	1523	900
+GasFilter	263	1080
+GasTank	525	1080
+Fuel	472	1260
+AirFilter	788	1080
+Air	998	1260
+Plugs	1050	1080
+SpkQual	1523	1260
+Starts	788	1440
+Timing	1313	1080
+BatAge	1575	1080
+BatVolt	3
+250	150
+0
+10	2	3	4	5	6	7	8	9	16	17
+1	0.4186
+2	0.1642
+3	0.4172
+PlugVolt	3
+250	150
+1	1
+9	3	4	5	6	7	8	9	16	17
+1	0.3716
+2	0.1684
+3	0.4600
+StMotor	2
+250	150
+2	1	2
+11	4	5	7	10	11	12	13	14	15	18	19
+1	0.9982
+2	0.0018
+Alter	2
+250	150
+3	1	2	3
+10	5	6	9	10	11	13	14	15	18	19
+1	0.9985
+2	0.0015
+MFuse	2
+250	150
+4	1	2	3	4
+14	6	7	8	9	10	11	12	13	14	15	16	17	18	19
+1	1.0000
+2	0.0000
+Charging	2
+250	150
+4	1	2	4	5
+0
+1	0.5027
+2	0.4973
+Starter	2
+250	150
+4	1	2	3	5
+1	8
+1	0.5996
+2	0.4004
+Cranks	2
+250	150
+4	1	2	5	7
+0
+1	0.4861
+2	0.5139
+Dist	2
+250	150
+4	1	2	4	5
+6	10	11	13	15	18	19
+1	0.9948
+2	0.0052
+GasFilter	2
+250	150
+4	3	4	5	9
+1	12
+1	0.9736
+2	0.0264
+GasTank	2
+250	150
+4	3	4	5	9
+1	12
+1	0.9048
+2	0.0952
+Fuel	2
+250	150
+4	3	5	10	11
+0
+1	0.7770
+2	0.2230
+AirFilter	2
+250	150
+4	3	4	5	9
+1	14
+1	0.9045
+2	0.0955
+Air	2
+250	150
+4	3	4	5	13
+0
+1	0.8304
+2	0.1696
+Plugs	3
+250	150
+4	3	4	5	9
+1	16
+1	0.6923
+2	0.0968
+3	0.2108
+SpkQual	2
+250	150
+4	1	2	5	15
+1	17
+1	0.2573
+2	0.7427
+Starts	2
+250	150
+4	1	2	5	16
+0
+1	0.2504
+2	0.7496
+Timing	2
+250	150
+4	3	4	5	9
+0
+1	0.9080
+2	0.0920
+BatAge	1
+250	150
+4	3	4	5	9
+0
+-1.3159	1.0000
diff --git a/sourcecodes/data/examplecar/OVInnode.txt b/sourcecodes/data/examplecar/OVInnode.txt
new file mode 100644
index 00000000..d6b24041
--- /dev/null
+++ b/sourcecodes/data/examplecar/OVInnode.txt
@@ -0,0 +1 @@
+19
diff --git a/sourcecodes/data/examplecar/OVInrows.txt b/sourcecodes/data/examplecar/OVInrows.txt
new file mode 100644
index 00000000..7d802a3e
--- /dev/null
+++ b/sourcecodes/data/examplecar/OVInrows.txt
@@ -0,0 +1 @@
+1002
diff --git a/sourcecodes/data/examplecar/OVIparent.txt b/sourcecodes/data/examplecar/OVIparent.txt
new file mode 100644
index 00000000..b8626c4c
--- /dev/null
+++ b/sourcecodes/data/examplecar/OVIparent.txt
@@ -0,0 +1 @@
+4
diff --git a/sourcecodes/data/examplecar/OVIrun_evidencemodified.sh b/sourcecodes/data/examplecar/OVIrun_evidencemodified.sh
new file mode 100644
index 00000000..dab5c39a
--- /dev/null
+++ b/sourcecodes/data/examplecar/OVIrun_evidencemodified.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+# script for execution of deployed applications
+#
+# Sets up the MCR environment for the current $ARCH and executes 
+# the specified command.
+#
+exe_name=$0
+exe_dir=`dirname "$0"`
+echo "------------------------------------------"
+if [ "x$1" = "x" ]; then
+  echo Usage:
+  echo    $0 \<deployedMCRroot\> args
+else
+  echo Setting up environment variables
+  MCRROOT="$1"
+  echo ---
+  LD_LIBRARY_PATH=.:${MCRROOT}/runtime/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/bin/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/sys/os/glnxa64;
+	MCRJRE=${MCRROOT}/sys/java/jre/glnxa64/jre/lib/amd64 ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/native_threads ; 
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/server ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/client ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE} ;  
+  XAPPLRESDIR=${MCRROOT}/X11/app-defaults ;
+  export LD_LIBRARY_PATH;
+  export XAPPLRESDIR;
+  echo LD_LIBRARY_PATH is ${LD_LIBRARY_PATH};
+  shift 1
+  args=
+  while [ $# -gt 0 ]; do
+      token=`echo "$1" | sed 's/ /\\\\ /g'`   # Add blackslash before each blank
+      args="${args} ${token}" 
+      shift
+  done
+  "${exe_dir}"/evidencemodified OVI
+fi
+exit
diff --git a/sourcecodes/data/examplecar/OVIrun_initialstructure.sh b/sourcecodes/data/examplecar/OVIrun_initialstructure.sh
new file mode 100644
index 00000000..d47ae324
--- /dev/null
+++ b/sourcecodes/data/examplecar/OVIrun_initialstructure.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+# script for execution of deployed applications
+#
+# Sets up the MCR environment for the current $ARCH and executes 
+# the specified command.
+#
+exe_name=$0
+exe_dir=`dirname "$0"`
+echo "------------------------------------------"
+if [ "x$1" = "x" ]; then
+  echo Usage:
+  echo    $0 \<deployedMCRroot\> args
+else
+  echo Setting up environment variables
+  MCRROOT="$1"
+  echo ---
+  LD_LIBRARY_PATH=.:${MCRROOT}/runtime/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/bin/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/sys/os/glnxa64;
+	MCRJRE=${MCRROOT}/sys/java/jre/glnxa64/jre/lib/amd64 ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/native_threads ; 
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/server ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/client ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE} ;  
+  XAPPLRESDIR=${MCRROOT}/X11/app-defaults ;
+  export LD_LIBRARY_PATH;
+  export XAPPLRESDIR;
+  echo LD_LIBRARY_PATH is ${LD_LIBRARY_PATH};
+  shift 1
+  args=
+  while [ $# -gt 0 ]; do
+      token=`echo "$1" | sed 's/ /\\\\ /g'`   # Add blackslash before each blank
+      args="${args} ${token}" 
+      shift
+  done
+  "${exe_dir}"/initialstructure OVI
+fi
+exit
diff --git a/sourcecodes/data/examplecar/OVIstructure_input.txt b/sourcecodes/data/examplecar/OVIstructure_input.txt
new file mode 100644
index 00000000..cad732f3
--- /dev/null
+++ b/sourcecodes/data/examplecar/OVIstructure_input.txt
@@ -0,0 +1,20 @@
+Starts	Dist	SpkQual	MFuse	Alter	Starter	StMotor	BatAge	Charging	PlugVolt	BatVolt	Timing	Cranks	Plugs	AirFilter	Air	Fuel	GasTank	GasFilter	
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	
+0	0	0	0	0	0	0	1	0	0	0	1	0	1	1	0	0	1	1	
+1	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	
+1	1	1	0	0	1	0	1	1	0	0	1	1	1	1	1	1	1	1	
+0	1	0	1	0	0	0	1	1	0	0	1	0	1	1	1	0	1	1	
+0	0	0	0	0	0	0	0	0	0	0	0	1	0	0	0	0	0	0	
+0	0	0	1	1	1	0	1	0	0	0	1	0	1	1	1	1	1	1	
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	
+1	1	1	1	1	1	1	0	1	0	0	0	1	0	0	0	0	0	0	
+1	1	1	1	1	1	1	0	1	1	0	0	1	0	0	0	0	0	0	
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	
+0	0	1	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	1	0	0	0	
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	1	0	0	
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	1	0	0	
diff --git a/sourcecodes/data/examplecar/OVIstructure_input_temp.txt b/sourcecodes/data/examplecar/OVIstructure_input_temp.txt
new file mode 100644
index 00000000..09d40aa3
--- /dev/null
+++ b/sourcecodes/data/examplecar/OVIstructure_input_temp.txt
@@ -0,0 +1,20 @@
+Starts	Dist	SpkQual	MFuse	Alter	Starter	StMotor	BatAge	Charging	PlugVolt	BatVolt	Timing	Cranks	Plugs	AirFilter	Air	Fuel	GasTank	GasFilter	
+0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	
+0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	1.000000	0.000000	0.000000	0.000000	1.000000	0.000000	1.000000	1.000000	0.000000	0.000000	1.000000	1.000000	
+1.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	
+1.000000	1.000000	1.000000	0.000000	0.000000	1.000000	0.000000	1.000000	1.000000	0.000000	0.000000	1.000000	1.000000	1.000000	1.000000	1.000000	1.000000	1.000000	1.000000	
+0.000000	1.000000	0.000000	1.000000	0.000000	0.000000	0.000000	1.000000	1.000000	0.000000	0.000000	1.000000	0.000000	1.000000	1.000000	1.000000	0.000000	1.000000	1.000000	
+0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	1.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	
+0.000000	0.000000	0.000000	1.000000	1.000000	1.000000	0.000000	1.000000	0.000000	0.000000	0.000000	1.000000	0.000000	1.000000	1.000000	1.000000	1.000000	1.000000	1.000000	
+0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	
+0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	
+1.000000	1.000000	1.000000	1.000000	1.000000	1.000000	1.000000	0.000000	1.000000	0.000000	0.000000	0.000000	1.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	
+1.000000	1.000000	1.000000	1.000000	1.000000	1.000000	1.000000	0.000000	1.000000	1.000000	0.000000	0.000000	1.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	
+0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	
+0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	
+0.000000	0.000000	1.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	
+0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	1.000000	0.000000	0.000000	0.000000	
+0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	
+0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	
+0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	1.000000	0.000000	0.000000	
+0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	1.000000	0.000000	0.000000	
diff --git a/sourcecodes/data/examplecar/OVIstructure_old.txt b/sourcecodes/data/examplecar/OVIstructure_old.txt
new file mode 100644
index 00000000..22f14ba3
--- /dev/null
+++ b/sourcecodes/data/examplecar/OVIstructure_old.txt
@@ -0,0 +1,19 @@
+Dist	0.9910	0.0090
+BatAge	0.0437	0.0524	0.0623	0.0736	0.0862	0.1001	0.1155	0.1321	0.1499	0.1689	0.1888	0.2093	0.2303	0.2515	0.2725	0.2929	0.3124	0.3306	0.3471	0.3617	0.3740	0.3836	0.3905	0.3944	0.3952	0.3930	0.3877	0.3795	0.3687	0.3553	0.3398	0.3225	0.3036	0.2837	0.2629	0.2419	0.2207	0.1999	0.1796	0.1601	0.1417	0.1243	0.1083	0.0936	0.0803	0.0683	0.0576	0.0483	0.0401	0.0331	0.0271	0.0220	0.0177	0.0142	0.0112	0.0088	0.0069	0.0054	0.0041	0.0031	0.0024	0.0018	0.0013	0.0010	0.0007	0.0005	0.0004	0.0003	0.0002	0.0001	0.0001	0.0001	0.0000	0.0000	0.0000	0.0000	0.0000	0.0000	0.0000	0.0000	0.0000	0.0000	0.0000	0.0000	0.0000	0.0000	0.0000	0.0000	0.0000	0.0000	0.0000	0.0000	0.0000	0.0000	0.0000	0.0000	0.0000	0.0000	0.0000	0.0000	0.0000
+Timing	0.9053	0.0947
+Plugs	0.6922	0.0970	0.2109
+AirFilter	0.9040	0.0960
+GasTank	0.9031	0.0969
+GasFilter	0.9725	0.0275
+SpkQual	0.2568	0.7432
+Starts	0.2497	0.7503
+MFuse	0.9990	0.0010
+Starter	0.5977	0.4023
+Charging	0.5024	0.4976
+Cranks	0.4848	0.5152
+Air	0.8301	0.1699
+Fuel	0.7756	0.2244
+Alter	0.9970	0.0030
+StMotor	0.9955	0.0045
+PlugVolt	0.3706	0.1678	0.4616
+BatVolt	0.4184	0.1639	0.4177
diff --git a/sourcecodes/data/examplecar/OVIthr.txt b/sourcecodes/data/examplecar/OVIthr.txt
new file mode 100644
index 00000000..2eb3c4fe
--- /dev/null
+++ b/sourcecodes/data/examplecar/OVIthr.txt
@@ -0,0 +1 @@
+0.5
diff --git a/sourcecodes/data/examplecar/OVItype.txt b/sourcecodes/data/examplecar/OVItype.txt
new file mode 100644
index 00000000..0b76081c
--- /dev/null
+++ b/sourcecodes/data/examplecar/OVItype.txt
@@ -0,0 +1,2 @@
+Starts	Dist	SpkQual	MFuse	Alter	Starter	StMotor	BatAge	Charging	PlugVolt	BatVolt	Timing	Cranks	Plugs	AirFilter	Air	Fuel	GasTank	GasFilter
+2	2	2	2	2	2	2	1	2	3	3	2	2	3	2	2	2	2	2	
diff --git a/sourcecodes/data/examplecar/OVIvar.txt b/sourcecodes/data/examplecar/OVIvar.txt
new file mode 100644
index 00000000..dec2bf5d
--- /dev/null
+++ b/sourcecodes/data/examplecar/OVIvar.txt
@@ -0,0 +1 @@
+19
\ No newline at end of file
diff --git a/sourcecodes/data/examplecar/OVIvardata.txt b/sourcecodes/data/examplecar/OVIvardata.txt
new file mode 100644
index 00000000..e595bf94
--- /dev/null
+++ b/sourcecodes/data/examplecar/OVIvardata.txt
@@ -0,0 +1 @@
+-1.3159
\ No newline at end of file
diff --git a/sourcecodes/data/examplecar/OVIvarname.txt b/sourcecodes/data/examplecar/OVIvarname.txt
new file mode 100644
index 00000000..2453221d
--- /dev/null
+++ b/sourcecodes/data/examplecar/OVIvarname.txt
@@ -0,0 +1 @@
+BatAge
\ No newline at end of file
diff --git a/sourcecodes/data/examplecar/OVIwhite.txt b/sourcecodes/data/examplecar/OVIwhite.txt
new file mode 100644
index 00000000..83e81b8b
--- /dev/null
+++ b/sourcecodes/data/examplecar/OVIwhite.txt
@@ -0,0 +1 @@
+From	To
diff --git a/sourcecodes/data/examplecar15node/MtXcontinuous_input.txt b/sourcecodes/data/examplecar15node/MtXcontinuous_input.txt
new file mode 100644
index 00000000..0d55f02c
--- /dev/null
+++ b/sourcecodes/data/examplecar15node/MtXcontinuous_input.txt
@@ -0,0 +1,1005 @@
+Voltage_at_plug	Car_cranks	Spark_plugs	Spark_quality	Distributer	Spark_timing	Car_starts	Headlights	Alternator	Charging_system	Battery_voltage	Battery_age	Main_fuse	Starter_system	Starter_motor
+3	2	3	3	2	3	2	3	2	2	3	3	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	1	2
+3	2	2	2	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	1	3	2	2	3	1	3	2	2	3	1	2	2	2
+3	2	2	2	2	3	2	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	3	2	2	3	1	2	2	2
+2	1	3	2	2	3	1	2	2	1	2	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	3	1	2	2	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	2	1	3	2	2	3	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	2	1	2	3	1	1	2	1	1	2	2	1	2
+2	2	1	1	2	3	1	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	1	1	2	3	1	2	2	2	2	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	3	2	1	2
+3	2	2	2	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	2	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+1	1	3	1	2	2	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	2	2
+1	2	3	1	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+2	2	3	2	2	3	2	2	2	2	2	2	2	2	2
+2	1	1	1	2	3	1	2	2	1	2	1	2	1	2
+3	2	2	2	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	2	1	1	2	3	1	1	2	1	1	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	1	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	1	1	2	2	1	1	2	1	1	2	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	2	1	2	3	1	3	2	2	3	1	1	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	1	3	2	2	3	1	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+1	2	3	1	2	3	1	3	2	2	3	1	2	2	2
+2	2	3	2	2	2	1	2	2	2	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+3	2	3	3	2	2	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	2	2	1	2	3	1	1	2	1	1	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	2	1	1	2	1	1	2	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	1	3	2	2	3	1	2	2	2	2	1	2	1	1
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+2	1	2	1	2	3	1	2	2	2	2	2	2	2	2
+3	2	1	2	2	3	2	3	2	2	3	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+2	2	2	1	2	3	1	2	2	2	2	2	2	2	2
+1	2	2	1	2	3	1	3	2	2	3	2	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	2	1	2	3	1	1	2	1	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	3	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	2	3	1	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+2	2	1	1	2	3	1	3	2	2	3	2	2	2	2
+3	2	1	2	2	3	1	3	2	2	3	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	1	1	1	2	3	1	2	2	1	2	1	2	2	2
+2	2	2	1	2	3	1	3	2	2	3	2	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	1	3	1	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	2	2	1	2	1	1	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	2	2	2	3	1	3	2	2	3	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	1	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+2	2	1	1	2	3	1	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	2	1	1	2	1	2
+3	1	2	2	2	2	1	3	2	2	3	3	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	1	3	2	2	3	1	2	2	2	2	1	2	2	2
+1	2	1	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	2	1	1	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	2	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	2	1	2	3	1	2	2	1	2	1	2	2	2
+1	1	3	1	2	3	1	2	2	2	2	1	1	1	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	2	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	3	2	2	2
+3	2	2	2	2	3	2	3	2	2	3	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	1	1	2	3	1	2	2	2	2	1	2	2	2
+3	2	1	2	2	3	1	3	2	2	3	1	2	2	2
+3	2	2	2	2	3	2	3	2	2	3	1	2	2	2
+3	1	1	2	2	3	1	3	2	2	3	1	2	2	2
+1	2	1	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	2	2	2	3	1	3	2	2	3	1	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	3	2	2	3	2	1	1	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	2	2	3	2	2	3	1	2	2	2
+2	1	1	1	2	3	1	1	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	2	1	1	2	1	2
+2	2	3	2	2	3	1	2	2	1	2	1	2	2	2
+3	1	1	2	2	2	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	2	1	1	2	1	1	1	2	1	2
+3	2	1	2	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+2	1	3	2	2	3	1	2	2	1	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	2	1	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+3	2	2	2	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	2	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	3	2	1	2
+1	1	3	1	2	3	1	1	2	2	1	3	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	2	2	2	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	2	1	2	2	1	2
+3	2	3	3	2	3	2	1	2	2	3	1	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	1	1
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	3	2	2	3	1	1	1	2
+2	2	3	2	2	3	2	2	2	2	2	2	2	2	2
+3	2	3	3	2	2	2	3	2	2	3	3	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	1	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	1
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	2	3	1	2	3	1	1	2	1	1	2	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	1	2
+2	2	3	2	2	2	2	3	2	2	3	1	2	2	2
+3	2	1	2	2	3	2	2	2	2	3	1	2	2	2
+1	2	2	1	2	3	1	1	2	1	2	1	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	2	2	2	2
+3	2	2	2	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	2	2	3	2	2	3	1	2	2	2
+1	2	3	1	2	3	1	2	2	2	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	1	2	2	2	1	3	2	2	3	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	2	1	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+1	1	1	1	2	2	1	1	2	1	1	1	2	1	2
+1	2	3	1	2	3	1	3	2	2	3	1	2	2	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	1	1	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	3	2	1	3	1	2	2	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+3	1	3	3	2	2	1	3	2	2	3	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	2	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	2	2	1	2
+2	1	3	2	2	3	1	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	1	1	2	2	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+1	2	1	1	2	3	1	1	2	1	1	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	2	3	1	2	3	1	2	2	1	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	1	3	2	2	3	1	2	2	1	2	2	2	1	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	3	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	1	3	3	2	3	1	1	2	2	3	1	2	1	2
+1	1	3	1	1	2	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+3	2	2	2	2	3	2	1	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+1	1	1	1	1	1	1	2	2	2	2	3	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	2	2	3	2	2	3	1	2	2	2
+2	1	3	2	2	3	1	2	2	2	2	2	2	1	2
+2	2	3	2	2	3	2	2	2	2	2	2	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	1	2	2	3	2	3	2	2	3	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	3	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+3	1	1	2	2	2	1	3	2	2	3	1	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+3	1	2	2	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	3	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+3	2	1	2	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+1	1	2	1	2	3	1	1	1	1	1	2	2	1	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+2	2	3	2	2	3	2	2	2	2	2	2	2	2	2
+3	2	3	3	2	2	2	3	2	2	3	1	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	1	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	2	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	2	1	1	1	1	1	2	1	1	1	1	1	2
+1	2	3	1	2	3	1	2	2	1	2	1	2	2	2
+1	2	1	1	2	3	1	1	2	1	1	1	2	2	2
+2	1	3	2	2	3	1	2	2	2	2	1	2	2	2
+3	2	1	2	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	1	2	2	2	1	2	2	2
+3	2	3	3	2	3	2	1	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	1	2	2	3	2	2	2	2
+1	2	3	1	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	2	2	3	2	2	3	1	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	1	1	1	2	1	1	1	2	1	2
+1	1	2	1	2	2	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	3	2	1	2
+2	2	3	2	2	3	2	3	2	2	3	1	2	2	2
+1	2	3	1	2	3	1	2	2	2	2	2	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+2	2	3	2	2	3	2	1	2	2	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	3	2	1	2
+2	2	3	2	2	3	2	2	2	2	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	1	1	2	2	1	1	2	1	1	2	2	1	2
+2	2	1	1	2	3	1	2	2	1	2	1	2	2	2
+1	1	2	1	2	3	1	1	2	2	1	1	2	2	2
+1	1	3	1	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	2	1	2	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+1	2	3	1	2	2	1	1	2	2	1	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	1	2	2	1	2	1	2	2	2
+1	2	3	1	2	3	1	1	2	2	1	2	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	2	1	1	2	1	1	1	2	1	2
+2	2	1	1	2	3	1	2	2	2	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	2	2	2	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	1	3	2	2	3	1	2	2	2	2	2	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	1	1	1	2	1	1	2	2	1	2
+2	2	1	1	2	3	1	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	1	2	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	1	2	2	3	2	2	3	1	2	2	2
+1	2	2	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	1	1	2	3	1	3	2	2	3	1	1	1	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	2	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	2	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	3	2	1	2
+2	1	3	2	2	3	1	2	2	2	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	2	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	3	2	1	2
+2	1	3	2	2	3	1	2	2	1	2	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	3	1	2	2	2	3	1	2	2	2
+1	1	3	1	2	1	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	2	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	2	1	2	3	1	1	2	1	1	2	2	1	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	2	3	1	2	3	1	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	2	2	2	2	2	3	2	2	3	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+3	2	1	2	2	3	2	1	2	2	3	1	2	2	2
+1	1	3	1	2	2	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	1	2	2	3	2	2	2	2
+2	1	3	2	2	3	1	2	2	1	2	1	2	2	2
+2	2	3	2	2	3	1	2	2	1	2	1	2	2	2
+3	2	1	2	2	3	1	3	2	2	3	1	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	2	2	1	2
+3	2	3	3	2	3	2	3	2	1	3	1	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	1	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	1	3	3	2	2	1	3	2	2	3	1	2	1	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	1	3	3	2	2	1	1	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+3	1	1	2	2	3	1	1	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+1	2	3	1	2	3	1	3	2	2	3	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	2	1	3	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	3	1	2	3	1	2	2	1	2	1	1	1	2
+1	2	1	1	2	3	1	1	2	1	1	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	2	1	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	2	2	2	3	3	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	2	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	2	1	1	1	3	1	1	2	1	1	3	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	3	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	1	2	2	3	1	2	2	2
+1	1	3	1	2	2	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	2	3	1	2	3	1	2	2	2	2	2	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	1	2	2	2	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	2	2	3	2	2	3	1	2	2	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+1	2	3	1	1	3	1	3	2	2	3	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	2	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	2	2	2	2	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	1	2	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	2	2
+3	2	1	2	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	2	2	3	2	2	3	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	2	1	2	3	1	2	2	1	2	1	1	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	2	2	2	2	1	2	2	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+2	2	1	1	2	3	1	2	2	2	2	2	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	1	3	3	2	2	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+1	2	3	1	2	3	1	2	2	1	2	1	2	2	2
+1	2	3	1	2	3	1	3	2	2	3	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	1	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	2	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	2	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	2	1	3	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	1	2	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	2	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	2	2
+3	1	1	2	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	2	1	2	3	1	2	2	2	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+2	1	1	1	2	3	1	2	2	2	2	2	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	1	2	2	3	1	3	2	2	3	2	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+2	2	3	2	2	3	1	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	2	1	1	2	2	1	3	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+3	2	1	2	2	3	1	3	2	2	3	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	1	2	2	2	2	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	2	2	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	1	1	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	2	1	1	2	1	1	1	2	1	2
+2	2	1	1	2	3	1	2	2	1	2	1	2	2	2
+2	2	2	1	2	1	1	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	2	2	2	1	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+2	2	1	1	2	2	1	2	2	1	2	1	2	2	2
+2	2	3	2	2	3	2	2	2	2	2	1	2	2	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	3	2	2	3	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+2	2	1	1	2	2	1	2	2	1	2	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	1	1
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	1	3	2	2	3	1	2	2	1	2	1	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	3	2	1	2
+2	2	3	2	2	3	1	2	2	1	2	1	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	1	1	2	2	1	2	2	2	2	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	2	2	2	3	2	3	2	2	3	2	2	2	2
+2	1	3	2	2	2	1	2	2	2	2	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	2	3	1	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+3	1	3	3	2	2	1	3	2	2	3	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	2	1	1	2	1	1	1	2	1	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+2	1	3	2	2	3	1	1	2	2	2	2	2	2	2
+2	2	1	1	2	2	1	2	2	1	2	1	2	2	2
+1	2	3	1	2	3	1	3	2	2	3	1	2	2	2
+2	2	1	1	2	3	1	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	2	1	1	2	3	1	2	2	2	2	3	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+2	2	3	2	2	3	2	2	2	2	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+2	1	3	2	2	3	1	2	2	2	2	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+3	2	2	2	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	2	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	1	2	2	3	2	3	2	2	3	2	2	2	2
+2	1	3	2	2	3	1	2	2	2	2	1	2	1	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+2	1	2	1	2	3	1	2	2	1	2	1	2	2	2
+3	2	2	2	2	2	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	1	2	2	3	1	3	2	2	3	1	2	2	2
+2	1	3	2	2	3	1	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	1	3	2	2	3	1	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+2	1	3	2	2	3	1	2	2	1	2	1	2	1	2
+2	1	1	1	2	3	1	2	2	1	2	1	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	2	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	2	1	1	2	1	1	2	2	1	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	2	2	2	2	1	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+2	1	3	2	2	3	1	2	2	1	2	1	2	1	2
+3	2	3	3	2	2	2	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	1	2	2	3	1	3	2	2	3	1	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	1	1	2	3	1	1	2	1	2	1	2	2	2
+3	1	1	2	2	3	1	3	2	2	3	1	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+2	2	1	1	2	3	1	3	2	2	3	2	2	2	2
+3	2	2	2	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	1	2	2	3	2	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	1	3	2	2	3	1	2	2	2	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	3	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	3	1	2	2	1	1	2	1	1	1	2	1	2
+1	2	3	1	2	3	1	1	2	1	1	2	2	2	2
+3	2	3	3	2	2	2	3	2	2	3	2	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	1	1	2	3	1	2	2	1	2	1	2	2	2
+1	1	3	1	2	2	1	1	2	1	1	1	2	1	2
+2	1	1	1	2	3	1	2	2	1	2	1	2	1	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	2	2	2	2
+3	1	3	3	2	2	1	3	2	2	3	1	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+3	2	2	2	2	3	2	3	2	2	3	1	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	3	2	2	2
+1	1	3	1	2	2	1	2	2	1	2	1	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	2	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	1	2	2	2	1	1	2	2	3	1	2	2	2
+3	2	1	2	2	3	1	3	2	2	3	3	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	2	1	2	2	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	2	2	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	2	2	2	2
+2	2	1	1	2	3	1	2	2	2	2	1	2	2	2
+3	2	2	2	2	3	1	3	2	2	3	1	2	2	2
+1	2	3	1	2	2	1	2	2	2	2	2	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	1	2	2	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	2	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	2	1	2	3	1	2	2	2	2	2	2	2	2
+2	2	3	2	2	2	2	2	2	2	2	2	2	2	2
+2	1	2	1	2	3	1	2	2	1	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	1	2	1	2	3	1	2	2	2	2	3	2	2	2
+2	2	3	2	2	2	1	2	2	2	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	3	1	2	3	1	3	2	2	3	2	2	2	2
+1	1	3	1	2	3	1	1	2	2	1	2	2	1	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	1	2
+3	2	2	2	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	1	2	1	1	2	1	1	1	2	1	2
+1	1	1	1	2	2	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	2	1	1	2	1	1	3	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	1	2
+2	2	3	2	2	3	2	3	2	2	3	1	2	2	2
+3	2	2	2	2	3	2	1	2	2	3	2	2	2	2
+2	1	1	1	2	3	1	2	2	1	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	2	1	1	2	1	1	2	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+2	1	3	2	2	2	1	2	2	1	2	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	3	2	2	3	1	2	2	2
+2	2	2	1	2	3	1	2	2	1	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	2	1	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	2	1	1	2	1	1	2	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	2	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+1	2	3	1	2	2	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	1	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	2	1	2	2	1	3	2	2	3	1	1	1	2
+1	1	1	1	2	3	1	1	2	1	1	2	2	1	2
+2	2	1	1	2	3	1	2	2	1	2	1	2	2	2
+2	1	3	2	2	3	1	2	2	1	2	1	2	1	2
+1	1	3	1	2	3	1	3	2	2	3	1	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	2	1	2	2	1	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+2	2	1	1	2	3	1	2	2	1	2	1	2	2	2
+2	2	3	2	2	3	1	2	2	1	2	2	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	1	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	2	2	1	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	1	2	2	3	2	3	2	2	3	2	2	2	2
+3	2	1	2	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	1	2	2	2	3	1	3	2	2	3	1	2	2	2
+3	2	2	2	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	2	2
+3	2	1	2	2	3	2	3	2	1	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	1	2	2	3	1	3	2	2	3	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+1	2	3	1	2	3	1	3	2	1	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	2	1	1	2	3	1	1	2	1	1	1	1	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	2	2	2	3	2	3	2	2	3	1	2	2	2
+2	1	3	2	2	3	1	2	2	2	2	2	2	1	2
+2	1	3	2	2	3	1	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	2	2	2	2	1	2	2	2
+1	1	3	1	2	1	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	2	1	2	2	1	1	2	1	1	2	2	1	2
+3	2	3	3	2	2	2	3	2	2	3	2	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	3	2	2	2
+3	2	1	2	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	2	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+2	2	3	2	2	3	1	2	2	2	2	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	2	2	3	2	2	3	1	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	2	2
+2	2	1	1	2	3	1	2	2	2	2	1	2	2	2
+3	1	2	2	2	3	1	3	2	2	3	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+1	2	3	1	1	2	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	1	1	1	2	3	1	3	2	2	3	1	2	2	2
+1	2	3	1	2	2	1	1	2	1	1	1	2	1	2
+1	2	1	1	2	3	1	1	2	1	1	2	2	2	2
+3	1	1	2	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	1	1	2
+2	2	1	1	2	3	1	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	2	2	2	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	2	1	1	2	1	1	2	2	1	2
+2	2	3	2	2	3	1	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	1	3	2	2	3	1	1	2	1	2	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+3	2	2	2	2	3	2	1	2	2	3	1	2	2	2
+3	1	1	2	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	2	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	2	1	2	3	1	1	2	1	1	2	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+2	1	1	1	2	3	1	2	2	2	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	1	2
+1	1	3	1	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	1	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	1	1	2	2	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	2	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	2	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+2	1	3	2	2	3	1	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	1	2	2	1	2	1	2	2	2
+2	2	3	2	2	3	1	2	2	2	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	1	1	2	2	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	2	2	2	2	2	2	2	2
+2	2	3	2	2	3	2	1	2	2	2	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	1	3	2	2	3	1	2	2	1	2	1	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	2	2	1	2
+1	2	1	1	2	3	1	3	2	2	3	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	1	2	2	2	2	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	3	2	1	2
+1	2	3	1	2	3	1	1	2	1	1	2	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	2	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	2	2	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	2	1	1	2	1	1	2	2	1	2
+3	1	1	2	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	2	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	3	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	1	2	2	3	1	3	2	2	3	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	2	2	3	2	2	3	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	3	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	2	2	2	3	1	3	2	2	3	1	2	2	2
+2	2	1	1	2	3	1	2	2	1	2	1	2	2	2
+1	1	3	1	2	2	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	2	1	3	2	2	3	1	1	1	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	1	2	2	2	2	3	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	2	2	2	3	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	1	2	2	3	1	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	1	2	2	2	2	2	2	2	2
+1	2	3	1	2	3	1	2	2	2	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	2	2	2	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	1	2	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	3	1	2	3	1	1	2	2	1	2	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	2	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	2	2	3	2	2	3	1	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	2	1	1	2	3	1	1	2	1	1	1	2	2	2
+3	2	1	2	2	3	1	3	2	2	3	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	1	2	2	2	2	3	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	2	2	2	3	1	3	2	2	3	1	2	2	2
+3	1	2	2	2	2	1	3	2	2	3	1	2	2	2
+2	2	1	1	2	3	1	2	2	2	2	1	2	2	2
+2	2	3	2	2	3	2	3	2	2	3	2	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	2	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	2	1	1	2	1	1	1	2	1	2
+3	1	1	2	2	3	1	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	2	2	2	2	2	2	2	2
+1	1	3	1	2	3	1	1	2	2	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+2	2	2	1	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	2	1	1	2	1	1	3	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	2	2	2	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	2	3	1	2	3	1	3	2	2	3	1	2	2	2
+
+
+
diff --git a/sourcecodes/data/examplecar15node/MtXgraphviz.txt b/sourcecodes/data/examplecar15node/MtXgraphviz.txt
new file mode 100644
index 00000000..56dcd027
--- /dev/null
+++ b/sourcecodes/data/examplecar15node/MtXgraphviz.txt
@@ -0,0 +1,20 @@
+digraph G {
+size="10,10";  ratio = fill;
+node [shape=square,width=1.5];
+Voltage_at_plug -> Spark_quality;
+Car_cranks -> Car_starts;
+Spark_plugs -> Spark_quality;
+Spark_quality -> Car_starts;
+Distributer -> Voltage_at_plug;
+Distributer -> Spark_timing;
+Spark_timing -> Car_starts;
+Alternator -> Charging_system;
+Charging_system -> Battery_voltage;
+Battery_voltage -> Voltage_at_plug;
+Battery_voltage -> Headlights;
+Battery_age -> Battery_voltage;
+Main_fuse -> Voltage_at_plug;
+Main_fuse -> Starter_system;
+Starter_system -> Car_cranks;
+Starter_motor -> Starter_system;
+}
\ No newline at end of file
diff --git a/sourcecodes/data/examplecar15node/MtXmap.txt b/sourcecodes/data/examplecar15node/MtXmap.txt
new file mode 100644
index 00000000..af7330d6
--- /dev/null
+++ b/sourcecodes/data/examplecar15node/MtXmap.txt
@@ -0,0 +1,15 @@
+Voltage_at_plug	2	0.827795	2.021000
+Car_cranks	2	0.500234	1.504000
+Spark_plugs	2	0.820310	2.042000
+Spark_quality	2	0.816376	2.014000
+Distributer	3	0.500241	1.497000
+Spark_timing	2	0.810222	2.014000
+Car_starts	2	0.500054	1.486000
+Headlights	3	0.810946	2.032000
+Alternator	3	0.500214	1.494000
+Charging_system	2	0.500234	1.496000
+Battery_voltage	3	0.806400	2.037000
+Battery_age	3	0.561294	1.708000
+Main_fuse	3	0.500150	1.490000
+Starter_system	3	0.499674	1.476000
+Starter_motor	2	0.500201	1.493000
diff --git a/sourcecodes/data/examplecar15node/MtXmapdata.txt b/sourcecodes/data/examplecar15node/MtXmapdata.txt
new file mode 100644
index 00000000..67939bd1
--- /dev/null
+++ b/sourcecodes/data/examplecar15node/MtXmapdata.txt
@@ -0,0 +1 @@
+Starter_motor	Main_fuse	Starter_system	Car_cranks	Battery_age	Alternator	Charging_system	Battery_voltage	Headlights	Distributer	Spark_timing	Voltage_at_plug	Spark_plugs	Spark_quality	Car_starts
diff --git a/sourcecodes/data/examplecar15node/MtXname.txt b/sourcecodes/data/examplecar15node/MtXname.txt
new file mode 100644
index 00000000..2957eff7
--- /dev/null
+++ b/sourcecodes/data/examplecar15node/MtXname.txt
@@ -0,0 +1 @@
+Voltage_at_plug	Car_cranks	Spark_plugs	Spark_quality	Distributer	Spark_timing	Car_starts	Headlights	Alternator	Charging_system	Battery_voltage	Battery_age	Main_fuse	Starter_system	Starter_motor
diff --git a/sourcecodes/data/examplecar15node/MtXnet_figure.txt b/sourcecodes/data/examplecar15node/MtXnet_figure.txt
new file mode 100644
index 00000000..5a5a3bb9
--- /dev/null
+++ b/sourcecodes/data/examplecar15node/MtXnet_figure.txt
@@ -0,0 +1,114 @@
+15
+1800	1200	
+Starter_motor	0	0
+Main_fuse	257	0
+Starter_system	373	171
+Car_cranks	343	343
+Battery_age	514	0
+Alternator	771	0
+Charging_system	823	171
+Battery_voltage	943	343
+Headlights	523	514
+Distributer	1029	0
+Spark_timing	1273	171
+Voltage_at_plug	1123	514
+Spark_plugs	1286	0
+Spark_quality	643	686
+Car_starts	823	857
+Starter_motor	2
+250	150
+0
+1	3
+1	0.5070
+2	0.4930
+Main_fuse	2
+250	150
+0
+2	3	12
+1	0.5100
+2	0.4900
+Starter_system	2
+250	150
+2	1	2
+1	4
+1	0.5238
+2	0.4762
+Car_cranks	2
+250	150
+1	3
+1	15
+1	0.4960
+2	0.5040
+Battery_age	3
+250	150
+0
+1	8
+1	0.3460
+2	0.6000
+3	0.0540
+Alternator	2
+250	150
+0
+1	7
+1	0.5060
+2	0.4940
+Charging_system	2
+250	150
+1	6
+1	8
+1	0.5040
+2	0.4960
+Battery_voltage	3
+250	150
+2	5	7
+2	9	12
+1	0.3072
+2	0.3486
+3	0.3442
+Headlights	3
+250	150
+1	8
+0
+1	0.3130
+2	0.3420
+3	0.3450
+Distributer	2
+250	150
+0
+2	11	12
+1	0.5030
+2	0.4970
+Spark_timing	3
+250	150
+1	10
+1	15
+1	0.3210
+2	0.3440
+3	0.3350
+Voltage_at_plug	3
+250	150
+3	2	8	10
+1	14
+1	0.3315
+2	0.3153
+3	0.3532
+Spark_plugs	3
+250	150
+0
+1	14
+1	0.3160
+2	0.3260
+3	0.3580
+Spark_quality	3
+250	150
+2	12	13
+1	15
+1	0.3266
+2	0.3334
+3	0.3400
+Car_starts	2
+250	150
+3	4	11	14
+0
+1	0.5158
+2	0.4842
diff --git a/sourcecodes/data/examplecar15node/MtXnnode.txt b/sourcecodes/data/examplecar15node/MtXnnode.txt
new file mode 100644
index 00000000..60d3b2f4
--- /dev/null
+++ b/sourcecodes/data/examplecar15node/MtXnnode.txt
@@ -0,0 +1 @@
+15
diff --git a/sourcecodes/data/examplecar15node/MtXrun_initialstructure.sh b/sourcecodes/data/examplecar15node/MtXrun_initialstructure.sh
new file mode 100644
index 00000000..8012f054
--- /dev/null
+++ b/sourcecodes/data/examplecar15node/MtXrun_initialstructure.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+# script for execution of deployed applications
+#
+# Sets up the MCR environment for the current $ARCH and executes 
+# the specified command.
+#
+exe_name=$0
+exe_dir=`dirname "$0"`
+echo "------------------------------------------"
+if [ "x$1" = "x" ]; then
+  echo Usage:
+  echo    $0 \<deployedMCRroot\> args
+else
+  echo Setting up environment variables
+  MCRROOT="$1"
+  echo ---
+  LD_LIBRARY_PATH=.:${MCRROOT}/runtime/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/bin/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/sys/os/glnxa64;
+	MCRJRE=${MCRROOT}/sys/java/jre/glnxa64/jre/lib/amd64 ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/native_threads ; 
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/server ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/client ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE} ;  
+  XAPPLRESDIR=${MCRROOT}/X11/app-defaults ;
+  export LD_LIBRARY_PATH;
+  export XAPPLRESDIR;
+  echo LD_LIBRARY_PATH is ${LD_LIBRARY_PATH};
+  shift 1
+  args=
+  while [ $# -gt 0 ]; do
+      token=`echo "$1" | sed 's/ /\\\\ /g'`   # Add blackslash before each blank
+      args="${args} ${token}" 
+      shift
+  done
+  "${exe_dir}"/initialstructure MtX
+fi
+exit
diff --git a/sourcecodes/data/examplecar15node/MtXstructure_input.txt b/sourcecodes/data/examplecar15node/MtXstructure_input.txt
new file mode 100644
index 00000000..549070d3
--- /dev/null
+++ b/sourcecodes/data/examplecar15node/MtXstructure_input.txt
@@ -0,0 +1,17 @@
+Voltage_at_plug	Car_cranks	Spark_plugs	Spark_quality	Distributer	Spark_timing	Car_starts	Headlights	Alternator	Charging_system	Battery_voltage	Battery_age	Main_fuse	Starter_system	Starter_motor	
+0	0	0	1	0	0	0	0	0	0	0	0	0	0	0	
+0	0	0	0	0	0	1	0	0	0	0	0	0	0	0	
+0	0	0	1	0	0	0	0	0	0	0	0	0	0	0	
+0	0	0	0	0	0	1	0	0	0	0	0	0	0	0	
+1	0	0	0	0	1	0	0	0	0	0	0	0	0	0	
+0	0	0	0	0	0	1	0	0	0	0	0	0	0	0	
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	
+0	0	0	0	0	0	0	0	0	1	0	0	0	0	0	
+0	0	0	0	0	0	0	0	0	0	1	0	0	0	0	
+1	0	0	0	0	0	0	1	0	0	0	0	0	0	0	
+0	0	0	0	0	0	0	0	0	0	1	0	0	0	0	
+1	0	0	0	0	0	0	0	0	0	0	0	0	1	0	
+0	1	0	0	0	0	0	0	0	0	0	0	0	0	0	
+0	0	0	0	0	0	0	0	0	0	0	0	0	1	0	
+
diff --git a/sourcecodes/data/examplecar15node/MtXstructure_old.txt b/sourcecodes/data/examplecar15node/MtXstructure_old.txt
new file mode 100644
index 00000000..cad36b88
--- /dev/null
+++ b/sourcecodes/data/examplecar15node/MtXstructure_old.txt
@@ -0,0 +1,15 @@
+Voltage_at_plug	0.3315	0.3153	0.3532
+Spark_quality	0.3266	0.3334	0.3400
+Car_cranks	0.4960	0.5040
+Car_starts	0.5158	0.4842
+Spark_plugs	0.3160	0.3260	0.3580
+Distributer	0.5030	0.4970
+Spark_timing	0.3210	0.3440	0.3350
+Alternator	0.5060	0.4940
+Charging_system	0.5040	0.4960
+Battery_voltage	0.3072	0.3486	0.3442
+Headlights	0.3130	0.3420	0.3450
+Battery_age	0.3460	0.6000	0.0540
+Main_fuse	0.5100	0.4900
+Starter_system	0.5238	0.4762
+Starter_motor	0.5070	0.4930
diff --git a/sourcecodes/data/examplecar15node/MtXtype.txt b/sourcecodes/data/examplecar15node/MtXtype.txt
new file mode 100644
index 00000000..75ee3397
--- /dev/null
+++ b/sourcecodes/data/examplecar15node/MtXtype.txt
@@ -0,0 +1,2 @@
+Voltage_at_plug	Car_cranks	Spark_plugs	Spark_quality	Distributer	Spark_timing	Car_starts	Headlights	Alternator	Charging_system	Battery_voltage	Battery_age	Main_fuse	Starter_system	Starter_motor
+3	2	3	3	2	3	2	3	2	2	3	3	2	2	2	
diff --git a/sourcecodes/data/examplecar15node/eIAcontinuous_input.txt b/sourcecodes/data/examplecar15node/eIAcontinuous_input.txt
new file mode 100644
index 00000000..66dddb9f
--- /dev/null
+++ b/sourcecodes/data/examplecar15node/eIAcontinuous_input.txt
@@ -0,0 +1,1003 @@
+Voltage_at_plug	Car_cranks	Spark_plugs	Spark_quality	Distributer	Spark_timing	Car_starts	Headlights	Alternator	Charging_system	Battery_voltage	Battery_age	Main_fuse	Starter_system	Starter_motor
+3	2	3	3	2	3	2	3	2	2	3	3	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	1	2
+3	2	2	2	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	1	3	2	2	3	1	3	2	2	3	1	2	2	2
+3	2	2	2	2	3	2	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	3	2	2	3	1	2	2	2
+2	1	3	2	2	3	1	2	2	1	2	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	3	1	2	2	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	2	1	3	2	2	3	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	2	1	2	3	1	1	2	1	1	2	2	1	2
+2	2	1	1	2	3	1	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	1	1	2	3	1	2	2	2	2	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	3	2	1	2
+3	2	2	2	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	2	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+1	1	3	1	2	2	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	2	2
+1	2	3	1	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+2	2	3	2	2	3	2	2	2	2	2	2	2	2	2
+2	1	1	1	2	3	1	2	2	1	2	1	2	1	2
+3	2	2	2	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	2	1	1	2	3	1	1	2	1	1	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	1	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	1	1	2	2	1	1	2	1	1	2	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	2	1	2	3	1	3	2	2	3	1	1	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	1	3	2	2	3	1	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+1	2	3	1	2	3	1	3	2	2	3	1	2	2	2
+2	2	3	2	2	2	1	2	2	2	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+3	2	3	3	2	2	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	2	2	1	2	3	1	1	2	1	1	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	2	1	1	2	1	1	2	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	1	3	2	2	3	1	2	2	2	2	1	2	1	1
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+2	1	2	1	2	3	1	2	2	2	2	2	2	2	2
+3	2	1	2	2	3	2	3	2	2	3	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+2	2	2	1	2	3	1	2	2	2	2	2	2	2	2
+1	2	2	1	2	3	1	3	2	2	3	2	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	2	1	2	3	1	1	2	1	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	3	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	2	3	1	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+2	2	1	1	2	3	1	3	2	2	3	2	2	2	2
+3	2	1	2	2	3	1	3	2	2	3	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	1	1	1	2	3	1	2	2	1	2	1	2	2	2
+2	2	2	1	2	3	1	3	2	2	3	2	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	1	3	1	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	2	2	1	2	1	1	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	2	2	2	3	1	3	2	2	3	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	1	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+2	2	1	1	2	3	1	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	2	1	1	2	1	2
+3	1	2	2	2	2	1	3	2	2	3	3	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	1	3	2	2	3	1	2	2	2	2	1	2	2	2
+1	2	1	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	2	1	1	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	2	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	2	1	2	3	1	2	2	1	2	1	2	2	2
+1	1	3	1	2	3	1	2	2	2	2	1	1	1	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	2	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	3	2	2	2
+3	2	2	2	2	3	2	3	2	2	3	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	1	1	2	3	1	2	2	2	2	1	2	2	2
+3	2	1	2	2	3	1	3	2	2	3	1	2	2	2
+3	2	2	2	2	3	2	3	2	2	3	1	2	2	2
+3	1	1	2	2	3	1	3	2	2	3	1	2	2	2
+1	2	1	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	2	2	2	3	1	3	2	2	3	1	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	3	2	2	3	2	1	1	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	2	2	3	2	2	3	1	2	2	2
+2	1	1	1	2	3	1	1	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	2	1	1	2	1	2
+2	2	3	2	2	3	1	2	2	1	2	1	2	2	2
+3	1	1	2	2	2	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	2	1	1	2	1	1	1	2	1	2
+3	2	1	2	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+2	1	3	2	2	3	1	2	2	1	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	2	1	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+3	2	2	2	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	2	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	3	2	1	2
+1	1	3	1	2	3	1	1	2	2	1	3	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	2	2	2	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	2	1	2	2	1	2
+3	2	3	3	2	3	2	1	2	2	3	1	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	1	1
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	3	2	2	3	1	1	1	2
+2	2	3	2	2	3	2	2	2	2	2	2	2	2	2
+3	2	3	3	2	2	2	3	2	2	3	3	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	1	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	1
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	2	3	1	2	3	1	1	2	1	1	2	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	1	2
+2	2	3	2	2	2	2	3	2	2	3	1	2	2	2
+3	2	1	2	2	3	2	2	2	2	3	1	2	2	2
+1	2	2	1	2	3	1	1	2	1	2	1	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	2	2	2	2
+3	2	2	2	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	2	2	3	2	2	3	1	2	2	2
+1	2	3	1	2	3	1	2	2	2	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	1	2	2	2	1	3	2	2	3	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	2	1	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+1	1	1	1	2	2	1	1	2	1	1	1	2	1	2
+1	2	3	1	2	3	1	3	2	2	3	1	2	2	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	1	1	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	3	2	1	3	1	2	2	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+3	1	3	3	2	2	1	3	2	2	3	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	2	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	2	2	1	2
+2	1	3	2	2	3	1	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	1	1	2	2	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+1	2	1	1	2	3	1	1	2	1	1	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	2	3	1	2	3	1	2	2	1	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	1	3	2	2	3	1	2	2	1	2	2	2	1	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	3	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	1	3	3	2	3	1	1	2	2	3	1	2	1	2
+1	1	3	1	1	2	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+3	2	2	2	2	3	2	1	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+1	1	1	1	1	1	1	2	2	2	2	3	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	2	2	3	2	2	3	1	2	2	2
+2	1	3	2	2	3	1	2	2	2	2	2	2	1	2
+2	2	3	2	2	3	2	2	2	2	2	2	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	1	2	2	3	2	3	2	2	3	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	3	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+3	1	1	2	2	2	1	3	2	2	3	1	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+3	1	2	2	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	3	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+3	2	1	2	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+1	1	2	1	2	3	1	1	1	1	1	2	2	1	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+2	2	3	2	2	3	2	2	2	2	2	2	2	2	2
+3	2	3	3	2	2	2	3	2	2	3	1	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	1	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	2	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	2	1	1	1	1	1	2	1	1	1	1	1	2
+1	2	3	1	2	3	1	2	2	1	2	1	2	2	2
+1	2	1	1	2	3	1	1	2	1	1	1	2	2	2
+2	1	3	2	2	3	1	2	2	2	2	1	2	2	2
+3	2	1	2	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	1	2	2	2	1	2	2	2
+3	2	3	3	2	3	2	1	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	1	2	2	3	2	2	2	2
+1	2	3	1	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	2	2	3	2	2	3	1	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	1	1	1	2	1	1	1	2	1	2
+1	1	2	1	2	2	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	3	2	1	2
+2	2	3	2	2	3	2	3	2	2	3	1	2	2	2
+1	2	3	1	2	3	1	2	2	2	2	2	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+2	2	3	2	2	3	2	1	2	2	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	3	2	1	2
+2	2	3	2	2	3	2	2	2	2	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	1	1	2	2	1	1	2	1	1	2	2	1	2
+2	2	1	1	2	3	1	2	2	1	2	1	2	2	2
+1	1	2	1	2	3	1	1	2	2	1	1	2	2	2
+1	1	3	1	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	2	1	2	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+1	2	3	1	2	2	1	1	2	2	1	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	1	2	2	1	2	1	2	2	2
+1	2	3	1	2	3	1	1	2	2	1	2	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	2	1	1	2	1	1	1	2	1	2
+2	2	1	1	2	3	1	2	2	2	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	2	2	2	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	1	3	2	2	3	1	2	2	2	2	2	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	1	1	1	2	1	1	2	2	1	2
+2	2	1	1	2	3	1	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	1	2	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	1	2	2	3	2	2	3	1	2	2	2
+1	2	2	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	1	1	2	3	1	3	2	2	3	1	1	1	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	2	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	2	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	3	2	1	2
+2	1	3	2	2	3	1	2	2	2	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	2	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	3	2	1	2
+2	1	3	2	2	3	1	2	2	1	2	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	3	1	2	2	2	3	1	2	2	2
+1	1	3	1	2	1	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	2	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	2	1	2	3	1	1	2	1	1	2	2	1	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	2	3	1	2	3	1	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	2	2	2	2	2	3	2	2	3	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+3	2	1	2	2	3	2	1	2	2	3	1	2	2	2
+1	1	3	1	2	2	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	1	2	2	3	2	2	2	2
+2	1	3	2	2	3	1	2	2	1	2	1	2	2	2
+2	2	3	2	2	3	1	2	2	1	2	1	2	2	2
+3	2	1	2	2	3	1	3	2	2	3	1	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	2	2	1	2
+3	2	3	3	2	3	2	3	2	1	3	1	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	1	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	1	3	3	2	2	1	3	2	2	3	1	2	1	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	1	3	3	2	2	1	1	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+3	1	1	2	2	3	1	1	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+1	2	3	1	2	3	1	3	2	2	3	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	2	1	3	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	3	1	2	3	1	2	2	1	2	1	1	1	2
+1	2	1	1	2	3	1	1	2	1	1	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	2	1	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	2	2	2	3	3	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	2	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	2	1	1	1	3	1	1	2	1	1	3	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	3	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	1	2	2	3	1	2	2	2
+1	1	3	1	2	2	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	2	3	1	2	3	1	2	2	2	2	2	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	1	2	2	2	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	2	2	3	2	2	3	1	2	2	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+1	2	3	1	1	3	1	3	2	2	3	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	2	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	2	2	2	2	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	1	2	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	2	2
+3	2	1	2	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	2	2	3	2	2	3	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	2	1	2	3	1	2	2	1	2	1	1	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	2	2	2	2	1	2	2	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+2	2	1	1	2	3	1	2	2	2	2	2	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	1	3	3	2	2	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+1	2	3	1	2	3	1	2	2	1	2	1	2	2	2
+1	2	3	1	2	3	1	3	2	2	3	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	1	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	2	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	2	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	2	1	3	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	1	2	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	2	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	2	2
+3	1	1	2	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	2	1	2	3	1	2	2	2	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+2	1	1	1	2	3	1	2	2	2	2	2	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	1	2	2	3	1	3	2	2	3	2	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+2	2	3	2	2	3	1	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	2	1	1	2	2	1	3	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+3	2	1	2	2	3	1	3	2	2	3	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	1	2	2	2	2	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	2	2	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	1	1	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	2	1	1	2	1	1	1	2	1	2
+2	2	1	1	2	3	1	2	2	1	2	1	2	2	2
+2	2	2	1	2	1	1	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	2	2	2	1	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+2	2	1	1	2	2	1	2	2	1	2	1	2	2	2
+2	2	3	2	2	3	2	2	2	2	2	1	2	2	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	3	2	2	3	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+2	2	1	1	2	2	1	2	2	1	2	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	1	1
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	1	3	2	2	3	1	2	2	1	2	1	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	3	2	1	2
+2	2	3	2	2	3	1	2	2	1	2	1	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	1	1	2	2	1	2	2	2	2	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	2	2	2	3	2	3	2	2	3	2	2	2	2
+2	1	3	2	2	2	1	2	2	2	2	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	2	3	1	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+3	1	3	3	2	2	1	3	2	2	3	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	2	1	1	2	1	1	1	2	1	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+2	1	3	2	2	3	1	1	2	2	2	2	2	2	2
+2	2	1	1	2	2	1	2	2	1	2	1	2	2	2
+1	2	3	1	2	3	1	3	2	2	3	1	2	2	2
+2	2	1	1	2	3	1	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	2	1	1	2	3	1	2	2	2	2	3	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+2	2	3	2	2	3	2	2	2	2	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+2	1	3	2	2	3	1	2	2	2	2	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+3	2	2	2	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	2	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	1	2	2	3	2	3	2	2	3	2	2	2	2
+2	1	3	2	2	3	1	2	2	2	2	1	2	1	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+2	1	2	1	2	3	1	2	2	1	2	1	2	2	2
+3	2	2	2	2	2	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	1	2	2	3	1	3	2	2	3	1	2	2	2
+2	1	3	2	2	3	1	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	1	3	2	2	3	1	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+2	1	3	2	2	3	1	2	2	1	2	1	2	1	2
+2	1	1	1	2	3	1	2	2	1	2	1	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	2	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	2	1	1	2	1	1	2	2	1	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	2	2	2	2	1	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+2	1	3	2	2	3	1	2	2	1	2	1	2	1	2
+3	2	3	3	2	2	2	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	1	2	2	3	1	3	2	2	3	1	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	1	1	2	3	1	1	2	1	2	1	2	2	2
+3	1	1	2	2	3	1	3	2	2	3	1	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+2	2	1	1	2	3	1	3	2	2	3	2	2	2	2
+3	2	2	2	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	1	2	2	3	2	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	1	3	2	2	3	1	2	2	2	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	3	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	3	1	2	2	1	1	2	1	1	1	2	1	2
+1	2	3	1	2	3	1	1	2	1	1	2	2	2	2
+3	2	3	3	2	2	2	3	2	2	3	2	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	1	1	2	3	1	2	2	1	2	1	2	2	2
+1	1	3	1	2	2	1	1	2	1	1	1	2	1	2
+2	1	1	1	2	3	1	2	2	1	2	1	2	1	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	2	2	2	2
+3	1	3	3	2	2	1	3	2	2	3	1	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+3	2	2	2	2	3	2	3	2	2	3	1	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	3	2	2	2
+1	1	3	1	2	2	1	2	2	1	2	1	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	2	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	1	2	2	2	1	1	2	2	3	1	2	2	2
+3	2	1	2	2	3	1	3	2	2	3	3	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	2	1	2	2	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	2	2	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	2	2	2	2
+2	2	1	1	2	3	1	2	2	2	2	1	2	2	2
+3	2	2	2	2	3	1	3	2	2	3	1	2	2	2
+1	2	3	1	2	2	1	2	2	2	2	2	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	1	2	2	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	2	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	2	1	2	3	1	2	2	2	2	2	2	2	2
+2	2	3	2	2	2	2	2	2	2	2	2	2	2	2
+2	1	2	1	2	3	1	2	2	1	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	1	2	1	2	3	1	2	2	2	2	3	2	2	2
+2	2	3	2	2	2	1	2	2	2	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	3	1	2	3	1	3	2	2	3	2	2	2	2
+1	1	3	1	2	3	1	1	2	2	1	2	2	1	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	1	2
+3	2	2	2	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	1	2	1	1	2	1	1	1	2	1	2
+1	1	1	1	2	2	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	2	1	1	2	1	1	3	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	1	2
+2	2	3	2	2	3	2	3	2	2	3	1	2	2	2
+3	2	2	2	2	3	2	1	2	2	3	2	2	2	2
+2	1	1	1	2	3	1	2	2	1	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	2	1	1	2	1	1	2	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+2	1	3	2	2	2	1	2	2	1	2	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	3	2	2	3	1	2	2	2
+2	2	2	1	2	3	1	2	2	1	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	2	1	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	2	1	1	2	1	1	2	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	2	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+1	2	3	1	2	2	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	1	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	2	1	2	2	1	3	2	2	3	1	1	1	2
+1	1	1	1	2	3	1	1	2	1	1	2	2	1	2
+2	2	1	1	2	3	1	2	2	1	2	1	2	2	2
+2	1	3	2	2	3	1	2	2	1	2	1	2	1	2
+1	1	3	1	2	3	1	3	2	2	3	1	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	2	1	2	2	1	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+2	2	1	1	2	3	1	2	2	1	2	1	2	2	2
+2	2	3	2	2	3	1	2	2	1	2	2	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	1	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	2	2	1	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	1	2	2	3	2	3	2	2	3	2	2	2	2
+3	2	1	2	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	1	2	2	2	3	1	3	2	2	3	1	2	2	2
+3	2	2	2	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	2	2
+3	2	1	2	2	3	2	3	2	1	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	1	2	2	3	1	3	2	2	3	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+1	2	3	1	2	3	1	3	2	1	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	2	1	1	2	3	1	1	2	1	1	1	1	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	2	2	2	3	2	3	2	2	3	1	2	2	2
+2	1	3	2	2	3	1	2	2	2	2	2	2	1	2
+2	1	3	2	2	3	1	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	2	2	2	2	1	2	2	2
+1	1	3	1	2	1	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	2	1	2	2	1	1	2	1	1	2	2	1	2
+3	2	3	3	2	2	2	3	2	2	3	2	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	3	2	2	2
+3	2	1	2	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	2	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+2	2	3	2	2	3	1	2	2	2	2	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	2	2	3	2	2	3	1	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	2	2
+2	2	1	1	2	3	1	2	2	2	2	1	2	2	2
+3	1	2	2	2	3	1	3	2	2	3	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+1	2	3	1	1	2	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	1	1	1	2	3	1	3	2	2	3	1	2	2	2
+1	2	3	1	2	2	1	1	2	1	1	1	2	1	2
+1	2	1	1	2	3	1	1	2	1	1	2	2	2	2
+3	1	1	2	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	1	1	2
+2	2	1	1	2	3	1	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	2	2	2	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	2	1	1	2	1	1	2	2	1	2
+2	2	3	2	2	3	1	2	2	1	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+2	1	3	2	2	3	1	1	2	1	2	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+3	2	2	2	2	3	2	1	2	2	3	1	2	2	2
+3	1	1	2	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	2	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	2	1	2	3	1	1	2	1	1	2	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	2	2	1	2	1	2	2	2
+2	1	1	1	2	3	1	2	2	2	2	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	1	2
+1	1	3	1	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	1	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	1	1	2	2	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	2	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	2	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+2	1	3	2	2	3	1	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	1	2	2	1	2	1	2	2	2
+2	2	3	2	2	3	1	2	2	2	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	1	1	2	2	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	2	2	2	2	2	2	2	2
+2	2	3	2	2	3	2	1	2	2	2	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	1	3	2	2	3	1	2	2	1	2	1	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	2	2	1	2
+1	2	1	1	2	3	1	3	2	2	3	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	1	2	2	2	2	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	3	2	1	2
+1	2	3	1	2	3	1	1	2	1	1	2	2	2	2
+2	2	3	2	2	3	2	2	2	1	2	2	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	2	2	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	2	1	1	2	1	1	2	2	1	2
+3	1	1	2	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	2	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	3	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	1	2	2	3	1	3	2	2	3	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	2	2	3	2	2	3	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	3	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	2	2	2	3	1	3	2	2	3	1	2	2	2
+2	2	1	1	2	3	1	2	2	1	2	1	2	2	2
+1	1	3	1	2	2	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	2	1	3	2	2	3	1	1	1	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	2	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	1	2	2	2	2	3	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	3	3	2	3	2	2	2	2	3	1	2	1	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	1	1	2	2	3	1	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	1	2	2	2	2	2	2	2	2
+1	2	3	1	2	3	1	2	2	2	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	2	2	2	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+3	2	1	2	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	2	2	1	2
+1	1	3	1	2	3	1	1	2	2	1	2	2	1	2
+3	1	3	3	2	3	1	3	2	2	3	1	2	2	2
+3	2	1	2	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	2	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	2	2	3	2	2	3	1	2	2	2
+1	2	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	2	1	1	2	3	1	1	2	1	1	1	2	2	2
+3	2	1	2	2	3	1	3	2	2	3	1	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	1	2	2	2	2	3	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	2	2	2	3	1	3	2	2	3	1	2	2	2
+3	1	2	2	2	2	1	3	2	2	3	1	2	2	2
+2	2	1	1	2	3	1	2	2	2	2	1	2	2	2
+2	2	3	2	2	3	2	3	2	2	3	2	2	2	2
+1	1	2	1	2	3	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	2	1	1	2	1	1	1	2	1	2
+1	1	3	1	2	2	1	1	2	1	1	1	2	1	2
+3	1	1	2	2	3	1	3	2	2	3	1	2	2	2
+2	2	3	2	2	3	2	2	2	2	2	2	2	2	2
+1	1	3	1	2	3	1	1	2	2	1	1	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+3	2	3	3	2	3	2	3	2	2	3	2	2	2	2
+2	2	2	1	2	3	1	3	2	2	3	1	2	2	2
+1	1	3	1	2	2	1	1	2	1	1	3	2	1	2
+3	2	3	3	2	3	2	3	2	2	3	1	2	2	2
+1	1	1	1	2	3	1	1	2	1	1	1	2	1	2
+2	2	3	2	2	3	2	2	2	2	2	1	2	2	2
+1	1	3	1	2	3	1	1	2	1	1	1	2	1	2
+1	2	3	1	2	3	1	3	2	2	3	1	2	2	2
+
diff --git a/sourcecodes/data/examplecar15node/eIAgraphviz.txt b/sourcecodes/data/examplecar15node/eIAgraphviz.txt
new file mode 100644
index 00000000..56dcd027
--- /dev/null
+++ b/sourcecodes/data/examplecar15node/eIAgraphviz.txt
@@ -0,0 +1,20 @@
+digraph G {
+size="10,10";  ratio = fill;
+node [shape=square,width=1.5];
+Voltage_at_plug -> Spark_quality;
+Car_cranks -> Car_starts;
+Spark_plugs -> Spark_quality;
+Spark_quality -> Car_starts;
+Distributer -> Voltage_at_plug;
+Distributer -> Spark_timing;
+Spark_timing -> Car_starts;
+Alternator -> Charging_system;
+Charging_system -> Battery_voltage;
+Battery_voltage -> Voltage_at_plug;
+Battery_voltage -> Headlights;
+Battery_age -> Battery_voltage;
+Main_fuse -> Voltage_at_plug;
+Main_fuse -> Starter_system;
+Starter_system -> Car_cranks;
+Starter_motor -> Starter_system;
+}
\ No newline at end of file
diff --git a/sourcecodes/data/examplecar15node/eIAmap.txt b/sourcecodes/data/examplecar15node/eIAmap.txt
new file mode 100644
index 00000000..e96a904a
--- /dev/null
+++ b/sourcecodes/data/examplecar15node/eIAmap.txt
@@ -0,0 +1,15 @@
+Voltage_at_plug	2	0.908185	1.905000
+Car_cranks	2	0.500106	1.488000
+Spark_plugs	2	0.778947	2.543000
+Spark_quality	2	0.853627	1.757000
+Distributer	3	0.099549	1.990000
+Spark_timing	2	0.357390	2.880000
+Car_starts	2	0.469352	1.327000
+Headlights	3	0.917301	1.951000
+Alternator	3	0.044699	1.998000
+Charging_system	2	0.500246	1.502000
+Battery_voltage	3	0.915330	2.003000
+Battery_age	3	0.500554	1.236000
+Main_fuse	3	0.121613	1.985000
+Starter_system	3	0.494126	1.578000
+Starter_motor	2	0.063151	1.996000
diff --git a/sourcecodes/data/examplecar15node/eIAmapdata.txt b/sourcecodes/data/examplecar15node/eIAmapdata.txt
new file mode 100644
index 00000000..67939bd1
--- /dev/null
+++ b/sourcecodes/data/examplecar15node/eIAmapdata.txt
@@ -0,0 +1 @@
+Starter_motor	Main_fuse	Starter_system	Car_cranks	Battery_age	Alternator	Charging_system	Battery_voltage	Headlights	Distributer	Spark_timing	Voltage_at_plug	Spark_plugs	Spark_quality	Car_starts
diff --git a/sourcecodes/data/examplecar15node/eIAname.txt b/sourcecodes/data/examplecar15node/eIAname.txt
new file mode 100644
index 00000000..2957eff7
--- /dev/null
+++ b/sourcecodes/data/examplecar15node/eIAname.txt
@@ -0,0 +1 @@
+Voltage_at_plug	Car_cranks	Spark_plugs	Spark_quality	Distributer	Spark_timing	Car_starts	Headlights	Alternator	Charging_system	Battery_voltage	Battery_age	Main_fuse	Starter_system	Starter_motor
diff --git a/sourcecodes/data/examplecar15node/eIAnet_figure.txt b/sourcecodes/data/examplecar15node/eIAnet_figure.txt
new file mode 100644
index 00000000..29896806
--- /dev/null
+++ b/sourcecodes/data/examplecar15node/eIAnet_figure.txt
@@ -0,0 +1,114 @@
+15
+1800	1200	
+Starter_motor	0	0
+Main_fuse	257	0
+Starter_system	373	171
+Car_cranks	343	343
+Battery_age	514	0
+Alternator	771	0
+Charging_system	823	171
+Battery_voltage	943	343
+Headlights	523	514
+Distributer	1029	0
+Spark_timing	1273	171
+Voltage_at_plug	1123	514
+Spark_plugs	1286	0
+Spark_quality	643	686
+Car_starts	823	857
+Starter_motor	2
+250	150
+0
+1	3
+1	0.0039
+2	0.9961
+Main_fuse	2
+250	150
+0
+2	3	12
+1	0.0149
+2	0.9851
+Starter_system	2
+250	150
+2	1	2
+1	4
+1	0.4211
+2	0.5789
+Car_cranks	2
+250	150
+1	3
+1	15
+1	0.5109
+2	0.4891
+Battery_age	3
+250	150
+0
+1	8
+1	0.7989
+2	0.1661
+3	0.0350
+Alternator	2
+250	150
+0
+1	7
+1	0.0020
+2	0.9980
+Charging_system	2
+250	150
+1	6
+1	8
+1	0.4988
+2	0.5012
+Battery_voltage	3
+250	150
+2	5	7
+2	9	12
+1	0.4181
+2	0.1633
+3	0.4186
+Headlights	3
+250	150
+1	8
+0
+1	0.4470
+2	0.1573
+3	0.3957
+Distributer	2
+250	150
+0
+2	11	12
+1	0.0098
+2	0.9902
+Spark_timing	3
+250	150
+1	10
+1	15
+1	0.0088
+2	0.0982
+3	0.8930
+Voltage_at_plug	3
+250	150
+3	2	8	10
+1	14
+1	0.4646
+2	0.1681
+3	0.3674
+Spark_plugs	3
+250	150
+0
+1	14
+1	0.1791
+2	0.0990
+3	0.7219
+Spark_quality	3
+250	150
+2	12	13
+1	15
+1	0.5114
+2	0.2233
+3	0.2652
+Car_starts	2
+250	150
+3	4	11	14
+0
+1	0.7903
+2	0.2097
diff --git a/sourcecodes/data/examplecar15node/eIAnlevels.txt b/sourcecodes/data/examplecar15node/eIAnlevels.txt
new file mode 100644
index 00000000..7ccbca8e
--- /dev/null
+++ b/sourcecodes/data/examplecar15node/eIAnlevels.txt
@@ -0,0 +1,15 @@
+Voltage_at_plug	1	2	3
+Car_cranks	1	2
+Spark_plugs	1	2	3
+Spark_quality	1	2	3
+Distributer	1	2
+Spark_timing	1	2	3
+Car_starts	1	2
+Headlights	1	2	3
+Alternator	1	2
+Charging_system	1	2
+Battery_voltage	1	2	3
+Battery_age	1	2	3
+Main_fuse	1	2
+Starter_system	1	2
+Starter_motor	1	2
diff --git a/sourcecodes/data/examplecar15node/eIAnnode.txt b/sourcecodes/data/examplecar15node/eIAnnode.txt
new file mode 100644
index 00000000..60d3b2f4
--- /dev/null
+++ b/sourcecodes/data/examplecar15node/eIAnnode.txt
@@ -0,0 +1 @@
+15
diff --git a/sourcecodes/data/examplecar15node/eIAstructure_input.txt b/sourcecodes/data/examplecar15node/eIAstructure_input.txt
new file mode 100644
index 00000000..6e7eaef0
--- /dev/null
+++ b/sourcecodes/data/examplecar15node/eIAstructure_input.txt
@@ -0,0 +1,17 @@
+Voltage_at_plug	Car_cranks	Spark_plugs	Spark_quality	Distributer	Spark_timing	Car_starts	Headlights	Alternator	Charging_system	Battery_voltage	Battery_age	Main_fuse	Starter_system	Starter_motor
+0	0	0	1	0	0	0	0	0	0	0	0	0	0	0
+0	0	0	0	0	0	1	0	0	0	0	0	0	0	0
+0	0	0	1	0	0	0	0	0	0	0	0	0	0	0
+0	0	0	0	0	0	1	0	0	0	0	0	0	0	0
+1	0	0	0	0	1	0	0	0	0	0	0	0	0	0
+0	0	0	0	0	0	1	0	0	0	0	0	0	0	0
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
+0	0	0	0	0	0	0	0	0	1	0	0	0	0	0
+0	0	0	0	0	0	0	0	0	0	1	0	0	0	0
+1	0	0	0	0	0	0	1	0	0	0	0	0	0	0
+0	0	0	0	0	0	0	0	0	0	1	0	0	0	0
+1	0	0	0	0	0	0	0	0	0	0	0	0	1	0
+0	1	0	0	0	0	0	0	0	0	0	0	0	0	0
+0	0	0	0	0	0	0	0	0	0	0	0	0	1	0
+
diff --git a/sourcecodes/data/examplecar15node/eIAstructure_old.txt b/sourcecodes/data/examplecar15node/eIAstructure_old.txt
new file mode 100644
index 00000000..774a14fe
--- /dev/null
+++ b/sourcecodes/data/examplecar15node/eIAstructure_old.txt
@@ -0,0 +1,15 @@
+Voltage_at_plug	0.4646	0.1681	0.3674
+Spark_quality	0.5114	0.2233	0.2652
+Car_cranks	0.5109	0.4891
+Car_starts	0.7903	0.2097
+Spark_plugs	0.1791	0.0990	0.7219
+Distributer	0.0098	0.9902
+Spark_timing	0.0088	0.0982	0.8930
+Alternator	0.0020	0.9980
+Charging_system	0.4988	0.5012
+Battery_voltage	0.4181	0.1633	0.4186
+Headlights	0.4470	0.1573	0.3957
+Battery_age	0.7989	0.1661	0.0350
+Main_fuse	0.0149	0.9851
+Starter_system	0.4211	0.5789
+Starter_motor	0.0039	0.9961
diff --git a/sourcecodes/data/examplecar15node/eIAtype.txt b/sourcecodes/data/examplecar15node/eIAtype.txt
new file mode 100644
index 00000000..75ee3397
--- /dev/null
+++ b/sourcecodes/data/examplecar15node/eIAtype.txt
@@ -0,0 +1,2 @@
+Voltage_at_plug	Car_cranks	Spark_plugs	Spark_quality	Distributer	Spark_timing	Car_starts	Headlights	Alternator	Charging_system	Battery_voltage	Battery_age	Main_fuse	Starter_system	Starter_motor
+3	2	3	3	2	3	2	3	2	2	3	3	2	2	2	
diff --git a/sourcecodes/data/examplezoo/fSfban.txt b/sourcecodes/data/examplezoo/fSfban.txt
new file mode 100644
index 00000000..9197eeec
--- /dev/null
+++ b/sourcecodes/data/examplezoo/fSfban.txt
@@ -0,0 +1,261 @@
+From	To
+aquatic	airborne
+aquatic	venomous
+aquatic	predator
+aquatic	domestic
+airborne	aquatic
+airborne	venomous
+airborne	predator
+airborne	domestic
+venomous	aquatic
+venomous	airborne
+venomous	predator
+venomous	domestic
+predator	aquatic
+predator	airborne
+predator	venomous
+predator	domestic
+domestic	aquatic
+domestic	airborne
+domestic	venomous
+domestic	predator
+eggs	aquatic
+eggs	airborne
+eggs	venomous
+eggs	predator
+eggs	domestic
+milk	aquatic
+milk	airborne
+milk	venomous
+milk	predator
+milk	domestic
+backbone	aquatic
+backbone	airborne
+backbone	venomous
+backbone	predator
+backbone	domestic
+breathes	aquatic
+breathes	airborne
+breathes	venomous
+breathes	predator
+breathes	domestic
+catsize	aquatic
+catsize	airborne
+catsize	venomous
+catsize	predator
+catsize	domestic
+tail	aquatic
+tail	airborne
+tail	venomous
+tail	predator
+tail	domestic
+toothed	aquatic
+toothed	airborne
+toothed	venomous
+toothed	predator
+toothed	domestic
+hair	aquatic
+hair	airborne
+hair	venomous
+hair	predator
+hair	domestic
+feathers	aquatic
+feathers	airborne
+feathers	venomous
+feathers	predator
+feathers	domestic
+fins	aquatic
+fins	airborne
+fins	venomous
+fins	predator
+fins	domestic
+legs	aquatic
+legs	airborne
+legs	venomous
+legs	predator
+legs	domestic
+type	aquatic
+type	airborne
+type	venomous
+type	predator
+type	domestic
+eggs	aquatic
+eggs	airborne
+eggs	venomous
+eggs	predator
+eggs	domestic
+milk	aquatic
+milk	airborne
+milk	venomous
+milk	predator
+milk	domestic
+backbone	aquatic
+backbone	airborne
+backbone	venomous
+backbone	predator
+backbone	domestic
+breathes	aquatic
+breathes	airborne
+breathes	venomous
+breathes	predator
+breathes	domestic
+catsize	eggs
+catsize	milk
+catsize	backbone
+catsize	breathes
+tail	eggs
+tail	milk
+tail	backbone
+tail	breathes
+toothed	eggs
+toothed	milk
+toothed	backbone
+toothed	breathes
+hair	eggs
+hair	milk
+hair	backbone
+hair	breathes
+feathers	eggs
+feathers	milk
+feathers	backbone
+feathers	breathes
+fins	eggs
+fins	milk
+fins	backbone
+fins	breathes
+legs	eggs
+legs	milk
+legs	backbone
+legs	breathes
+type	eggs
+type	milk
+type	backbone
+type	breathes
+catsize	tail
+catsize	toothed
+catsize	hair
+catsize	feathers
+catsize	fins
+catsize	legs
+tail	catsize
+tail	toothed
+tail	hair
+tail	feathers
+tail	fins
+tail	legs
+toothed	catsize
+toothed	tail
+toothed	hair
+toothed	feathers
+toothed	fins
+toothed	legs
+hair	catsize
+hair	tail
+hair	toothed
+hair	feathers
+hair	fins
+hair	legs
+feathers	catsize
+feathers	tail
+feathers	toothed
+feathers	hair
+feathers	fins
+feathers	legs
+fins	catsize
+fins	tail
+fins	toothed
+fins	hair
+fins	feathers
+fins	legs
+legs	catsize
+legs	tail
+legs	toothed
+legs	hair
+legs	feathers
+legs	fins
+catsize	aquatic
+catsize	airborne
+catsize	venomous
+catsize	predator
+catsize	domestic
+tail	aquatic
+tail	airborne
+tail	venomous
+tail	predator
+tail	domestic
+toothed	aquatic
+toothed	airborne
+toothed	venomous
+toothed	predator
+toothed	domestic
+hair	aquatic
+hair	airborne
+hair	venomous
+hair	predator
+hair	domestic
+feathers	aquatic
+feathers	airborne
+feathers	venomous
+feathers	predator
+feathers	domestic
+fins	aquatic
+fins	airborne
+fins	venomous
+fins	predator
+fins	domestic
+legs	aquatic
+legs	airborne
+legs	venomous
+legs	predator
+legs	domestic
+catsize	eggs
+catsize	milk
+catsize	backbone
+catsize	breathes
+tail	eggs
+tail	milk
+tail	backbone
+tail	breathes
+toothed	eggs
+toothed	milk
+toothed	backbone
+toothed	breathes
+hair	eggs
+hair	milk
+hair	backbone
+hair	breathes
+feathers	eggs
+feathers	milk
+feathers	backbone
+feathers	breathes
+fins	eggs
+fins	milk
+fins	backbone
+fins	breathes
+legs	eggs
+legs	milk
+legs	backbone
+legs	breathes
+type	catsize
+type	tail
+type	toothed
+type	hair
+type	feathers
+type	fins
+type	legs
+type	aquatic
+type	airborne
+type	venomous
+type	predator
+type	domestic
+type	eggs
+type	milk
+type	backbone
+type	breathes
+type	catsize
+type	tail
+type	toothed
+type	hair
+type	feathers
+type	fins
+type	legs
diff --git a/sourcecodes/data/examplezoo/fSfcontinuous_input.txt b/sourcecodes/data/examplezoo/fSfcontinuous_input.txt
new file mode 100644
index 00000000..340ad4f6
--- /dev/null
+++ b/sourcecodes/data/examplezoo/fSfcontinuous_input.txt
@@ -0,0 +1,104 @@
+hair	feathers	eggs	milk	airborne	aquatic	predator	toothed	backbone	breathes	venomous	fins	legs	tail	domestic	catsize	type
+2	2	2	2	2	2	2	2	2	2	2	2	6	2	2	2	7
+1	1	2	1	1	2	2	2	2	1	1	2	1	2	1	1	4
+1	1	2	1	1	2	1	2	2	1	1	2	1	2	2	1	4
+1	1	2	1	1	2	2	2	2	1	1	2	1	2	1	1	4
+1	1	2	1	1	2	2	2	2	1	1	2	1	2	1	1	4
+1	1	2	1	1	1	2	1	1	1	1	1	1	1	1	1	7
+1	1	2	1	1	2	2	2	2	1	1	2	1	2	1	2	4
+1	1	1	2	1	2	2	2	2	2	1	2	1	2	1	2	1
+1	1	2	1	1	2	1	2	2	1	1	2	1	2	1	1	4
+1	1	2	1	1	2	2	2	2	1	1	2	1	2	1	1	4
+1	1	2	1	1	2	2	2	2	1	1	2	1	2	1	2	4
+1	1	2	1	1	2	2	2	2	1	1	2	1	2	1	1	4
+1	1	2	1	1	1	2	2	2	2	2	1	1	2	1	1	3
+1	1	1	2	1	2	2	2	2	2	1	2	1	2	1	2	1
+1	1	2	1	1	2	1	2	2	1	1	2	1	2	1	1	4
+2	1	1	2	1	2	2	2	2	2	1	2	1	1	1	2	1
+1	1	1	1	1	2	2	2	2	1	2	1	1	2	1	1	3
+1	1	2	1	1	2	2	1	1	1	2	1	1	1	1	1	7
+1	1	2	1	1	1	2	2	2	2	1	1	1	2	1	1	3
+1	1	2	1	1	1	1	1	1	2	1	1	1	1	1	1	7
+1	1	2	1	1	2	1	2	2	1	1	2	1	2	1	1	4
+1	1	2	1	1	2	2	2	2	1	2	2	1	2	1	2	4
+1	1	2	1	1	2	2	2	2	1	1	2	1	2	1	2	4
+1	1	2	1	1	1	1	1	1	2	1	1	1	1	1	1	7
+1	2	2	1	2	1	1	1	2	2	1	1	2	2	2	1	2
+1	2	2	1	2	1	2	1	2	2	1	1	2	2	1	1	2
+1	2	2	1	2	1	1	1	2	2	1	1	2	2	2	1	2
+1	2	2	1	2	2	1	1	2	2	1	1	2	2	1	1	2
+1	2	2	1	2	1	1	1	2	2	1	1	2	2	1	2	2
+2	1	1	2	2	1	1	2	2	2	1	1	2	2	1	1	1
+2	1	1	2	1	1	2	2	2	2	1	1	2	1	2	2	1
+2	1	1	2	1	1	1	2	2	2	1	1	2	1	1	2	1
+1	2	2	1	2	2	2	1	2	2	1	1	2	2	1	1	2
+1	2	2	1	2	1	2	1	2	2	1	1	2	2	1	1	2
+1	2	2	1	1	1	2	1	2	2	1	1	2	2	1	1	2
+1	2	2	1	2	1	1	1	2	2	1	1	2	2	1	1	2
+1	2	2	1	1	1	1	1	2	2	1	1	2	2	1	2	2
+1	2	2	1	2	1	1	1	2	2	1	1	2	2	2	1	2
+1	2	2	1	1	2	2	1	2	2	1	1	2	2	1	2	2
+1	2	2	1	2	1	1	1	2	2	1	1	2	2	1	1	2
+1	2	2	1	1	1	2	1	2	2	1	1	2	2	1	2	2
+2	1	1	2	1	2	2	2	2	2	1	2	2	2	1	2	1
+1	2	2	1	2	2	2	1	2	2	1	1	2	2	1	1	2
+1	2	2	1	2	2	2	1	2	2	1	1	2	2	1	1	2
+1	2	2	1	2	1	1	1	2	2	1	1	2	2	1	1	2
+2	1	1	2	1	1	1	2	2	2	1	1	2	2	1	1	1
+1	2	2	1	2	2	1	1	2	2	1	1	2	2	1	2	2
+2	1	1	2	2	1	1	2	2	2	1	1	2	2	1	1	1
+1	2	2	1	2	1	2	1	2	2	1	1	2	2	1	2	2
+2	1	1	2	1	1	1	2	2	2	1	1	2	2	1	2	1
+1	2	2	1	2	1	1	1	2	2	1	1	2	2	1	1	2
+2	1	1	2	1	1	2	2	2	2	1	1	3	1	1	2	1
+2	1	1	2	1	1	1	2	2	2	1	1	3	2	1	2	1
+2	1	1	2	1	1	2	2	2	2	1	1	3	1	1	2	1
+2	1	1	2	1	1	2	2	2	2	1	1	3	2	1	2	1
+2	1	1	2	1	1	1	2	2	2	1	1	3	2	1	2	1
+2	1	1	2	1	1	1	2	2	2	1	1	3	2	2	2	1
+2	1	1	2	1	1	1	2	2	2	1	1	3	1	2	1	1
+2	1	1	2	1	1	2	2	2	2	1	1	3	2	1	2	1
+1	1	2	1	1	2	2	1	1	1	1	1	3	1	1	1	7
+2	1	1	2	1	1	1	2	2	2	1	1	3	2	1	2	1
+2	1	1	2	1	1	1	2	2	2	1	1	3	2	1	2	1
+1	1	2	1	1	2	2	2	2	2	1	1	3	1	1	1	5
+1	1	2	1	1	2	2	2	2	2	2	1	3	1	1	1	5
+2	1	1	2	1	1	1	2	2	2	1	1	3	2	1	2	1
+2	1	1	2	1	1	1	2	2	2	1	1	3	2	2	2	1
+2	1	1	2	1	1	1	2	2	2	1	1	3	2	2	1	1
+2	1	1	2	1	1	1	2	2	2	1	1	3	2	1	1	1
+2	1	1	2	1	1	2	2	2	2	1	1	3	2	1	2	1
+2	1	1	2	1	1	2	2	2	2	1	1	3	2	1	2	1
+2	1	1	2	1	1	2	2	2	2	1	1	3	2	1	2	1
+2	1	1	2	1	2	2	2	2	2	1	1	3	2	1	2	1
+2	1	1	2	1	1	2	2	2	2	1	1	3	2	1	1	1
+2	1	1	2	1	1	2	2	2	2	1	1	3	2	1	2	1
+1	1	2	1	1	2	2	2	2	2	1	1	3	2	1	1	5
+2	1	1	2	1	1	2	2	2	2	1	1	3	2	1	1	1
+2	1	1	2	1	1	1	2	2	2	1	1	3	2	1	2	1
+2	1	2	2	1	2	2	1	2	2	1	1	3	2	1	2	1
+2	1	1	2	1	1	2	2	2	2	1	1	3	2	1	2	1
+2	1	1	2	1	1	1	2	2	2	1	1	3	2	2	2	1
+2	1	1	2	1	1	2	2	2	2	1	1	3	2	1	2	1
+2	1	1	2	1	1	2	2	2	2	1	1	3	2	2	2	1
+2	1	1	2	1	1	2	2	2	2	1	1	3	2	1	2	1
+2	1	1	2	1	1	1	2	2	2	1	1	3	2	2	2	1
+1	1	2	1	1	2	1	2	2	2	1	1	3	1	1	1	5
+1	1	2	1	1	1	1	1	2	2	1	1	3	2	1	2	3
+1	1	2	1	1	1	2	2	2	2	1	1	3	2	1	1	3
+2	1	1	2	1	1	1	2	2	2	1	1	3	2	1	1	1
+2	1	1	2	1	1	2	2	2	2	1	1	3	2	1	2	1
+1	1	2	1	1	2	2	1	1	1	1	1	4	1	1	1	7
+1	1	2	1	1	2	2	1	1	1	1	1	5	1	1	1	7
+1	1	2	1	1	1	1	1	1	2	1	1	5	1	1	1	6
+1	1	2	1	2	1	1	1	1	2	1	1	5	1	1	1	6
+2	1	2	1	2	1	1	1	1	2	2	1	5	1	2	1	6
+2	1	2	1	2	1	1	1	1	2	1	1	5	1	1	1	6
+1	1	2	1	2	1	2	1	1	2	1	1	5	1	1	1	6
+1	1	2	1	1	2	2	1	1	1	1	1	5	1	1	1	7
+2	1	2	1	2	1	1	1	1	2	1	1	5	1	1	1	6
+1	1	2	1	1	1	1	1	1	2	1	1	5	1	1	1	6
+2	1	2	1	2	1	1	1	1	2	2	1	5	1	1	1	6
+1	1	2	1	1	2	2	1	1	1	1	1	6	1	1	2	7
+1	1	1	1	1	1	2	1	1	2	2	1	6	2	1	1	7
+
diff --git a/sourcecodes/data/examplezoo/fSfgraphviz.txt b/sourcecodes/data/examplezoo/fSfgraphviz.txt
new file mode 100644
index 00000000..701801c6
--- /dev/null
+++ b/sourcecodes/data/examplezoo/fSfgraphviz.txt
@@ -0,0 +1,61 @@
+digraph G {
+size="10,10";  ratio = fill;
+node [shape=square,width=1.5];
+feathers -> type;
+eggs -> hair;
+eggs -> feathers;
+eggs -> toothed;
+eggs -> backbone;
+eggs -> breathes;
+eggs -> legs;
+eggs -> tail;
+eggs -> catsize;
+milk -> hair;
+milk -> feathers;
+milk -> toothed;
+milk -> backbone;
+milk -> breathes;
+milk -> legs;
+milk -> tail;
+milk -> catsize;
+milk -> type;
+airborne -> eggs;
+airborne -> milk;
+airborne -> backbone;
+airborne -> breathes;
+airborne -> catsize;
+aquatic -> eggs;
+aquatic -> milk;
+aquatic -> breathes;
+aquatic -> fins;
+backbone -> hair;
+backbone -> feathers;
+backbone -> toothed;
+backbone -> fins;
+backbone -> legs;
+backbone -> tail;
+backbone -> type;
+breathes -> hair;
+breathes -> toothed;
+breathes -> backbone;
+breathes -> fins;
+breathes -> legs;
+breathes -> catsize;
+breathes -> type;
+venomous -> hair;
+venomous -> feathers;
+venomous -> eggs;
+venomous -> milk;
+venomous -> toothed;
+venomous -> backbone;
+venomous -> breathes;
+venomous -> fins;
+venomous -> legs;
+venomous -> tail;
+venomous -> catsize;
+legs -> type;
+domestic -> eggs;
+domestic -> milk;
+domestic -> fins;
+domestic -> tail;
+}
\ No newline at end of file
diff --git a/sourcecodes/data/examplezoo/fSfk.txt b/sourcecodes/data/examplezoo/fSfk.txt
new file mode 100644
index 00000000..f599e28b
--- /dev/null
+++ b/sourcecodes/data/examplezoo/fSfk.txt
@@ -0,0 +1 @@
+10
diff --git a/sourcecodes/data/examplezoo/fSfmap.txt b/sourcecodes/data/examplezoo/fSfmap.txt
new file mode 100644
index 00000000..4a123441
--- /dev/null
+++ b/sourcecodes/data/examplezoo/fSfmap.txt
@@ -0,0 +1,17 @@
+hair	2	0.496921	1.425743
+feathers	2	0.400495	1.198020
+eggs	2	0.495325	1.584158
+milk	2	0.493522	1.405941
+airborne	2	0.427750	1.237624
+aquatic	2	0.481335	1.356436
+predator	2	0.499505	1.554455
+toothed	2	0.491512	1.603960
+backbone	2	0.384605	1.821782
+breathes	2	0.407844	1.792079
+venomous	2	0.271410	1.079208
+fins	6	0.376013	1.168317
+legs	2	1.253194	2.544554
+tail	2	0.439397	1.742574
+domestic	2	0.336552	1.128713
+catsize	7	0.498314	1.435644
+type	2	2.102709	2.831683
diff --git a/sourcecodes/data/examplezoo/fSfmapdata.txt b/sourcecodes/data/examplezoo/fSfmapdata.txt
new file mode 100644
index 00000000..19d91997
--- /dev/null
+++ b/sourcecodes/data/examplezoo/fSfmapdata.txt
@@ -0,0 +1 @@
+domestic	venomous	predator	aquatic	airborne	milk	eggs	breathes	catsize	backbone	tail	legs	fins	toothed	feathers	type	hair
diff --git a/sourcecodes/data/examplezoo/fSfname.txt b/sourcecodes/data/examplezoo/fSfname.txt
new file mode 100644
index 00000000..c68267c4
--- /dev/null
+++ b/sourcecodes/data/examplezoo/fSfname.txt
@@ -0,0 +1 @@
+hair	feathers	eggs	milk	airborne	aquatic	predator	toothed	backbone	breathes	venomous	fins	legs	tail	domestic	catsize	type
diff --git a/sourcecodes/data/examplezoo/fSfnet_figure.txt b/sourcecodes/data/examplezoo/fSfnet_figure.txt
new file mode 100644
index 00000000..0c8f9428
--- /dev/null
+++ b/sourcecodes/data/examplezoo/fSfnet_figure.txt
@@ -0,0 +1,130 @@
+17
+1800	1200	
+domestic	43	0
+venomous	343	0
+predator	643	0
+aquatic	943	0
+airborne	1243	0
+milk	523	171
+eggs	1123	171
+breathes	643	343
+catsize	523	514
+backbone	1123	514
+tail	0	686
+legs	257	686
+fins	514	686
+toothed	771	686
+feathers	1029	686
+type	823	857
+hair	1286	686
+domestic	2
+250	150
+0
+4	6	7	11	13
+1	0.8672
+2	0.1328
+venomous	2
+250	150
+0
+11	6	7	8	9	10	11	12	13	14	15	17
+1	0.8860
+2	0.1140
+predator	2
+250	150
+0
+0
+1	0.4455
+2	0.5545
+aquatic	2
+250	150
+0
+4	6	7	8	13
+1	0.6726
+2	0.3274
+airborne	2
+250	150
+0
+5	6	7	8	9	10
+1	0.8149
+2	0.1851
+milk	2
+250	150
+4	1	2	4	5
+9	8	9	10	11	12	14	15	16	17
+1	0.4703
+2	0.5297
+eggs	2
+250	150
+4	1	2	4	5
+8	8	9	10	11	12	14	15	17
+1	0.4962
+2	0.5038
+breathes	2
+250	150
+5	2	4	5	6	7
+7	9	10	12	13	14	16	17
+1	0.1666
+2	0.8334
+catsize	2
+250	150
+5	2	5	6	7	8
+0
+1	0.4789
+2	0.5211
+backbone	2
+250	150
+5	2	5	6	7	8
+7	11	12	13	14	15	16	17
+1	0.1743
+2	0.8257
+tail	2
+250	150
+5	1	2	6	7	10
+0
+1	0.2426
+2	0.7574
+legs	6
+250	150
+5	2	6	7	8	10
+1	16
+1	0.1827
+2	0.2108
+3	0.4747
+4	0.0111
+5	0.0799
+6	0.0409
+fins	2
+250	150
+5	1	2	4	8	10
+0
+1	0.8751
+2	0.1249
+toothed	2
+250	150
+5	2	6	7	8	10
+0
+1	0.3799
+2	0.6201
+feathers	2
+250	150
+4	2	6	7	10
+1	16
+1	0.8693
+2	0.1307
+type	7
+250	150
+5	6	8	10	12	15
+0
+1	0.5297
+2	0.1307
+3	0.0476
+4	0.0854
+5	0.0323
+6	0.0578
+7	0.1165
+hair	2
+250	150
+5	2	6	7	8	10
+0
+1	0.4597
+2	0.5403
diff --git a/sourcecodes/data/examplezoo/fSfnnode.txt b/sourcecodes/data/examplezoo/fSfnnode.txt
new file mode 100644
index 00000000..98d9bcb7
--- /dev/null
+++ b/sourcecodes/data/examplezoo/fSfnnode.txt
@@ -0,0 +1 @@
+17
diff --git a/sourcecodes/data/examplezoo/fSfnrows.txt b/sourcecodes/data/examplezoo/fSfnrows.txt
new file mode 100644
index 00000000..257e5632
--- /dev/null
+++ b/sourcecodes/data/examplezoo/fSfnrows.txt
@@ -0,0 +1 @@
+102
diff --git a/sourcecodes/data/examplezoo/fSfparent.txt b/sourcecodes/data/examplezoo/fSfparent.txt
new file mode 100644
index 00000000..7ed6ff82
--- /dev/null
+++ b/sourcecodes/data/examplezoo/fSfparent.txt
@@ -0,0 +1 @@
+5
diff --git a/sourcecodes/data/examplezoo/fSfrun_initialstructure.sh b/sourcecodes/data/examplezoo/fSfrun_initialstructure.sh
new file mode 100644
index 00000000..f20a9a29
--- /dev/null
+++ b/sourcecodes/data/examplezoo/fSfrun_initialstructure.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+# script for execution of deployed applications
+#
+# Sets up the MCR environment for the current $ARCH and executes 
+# the specified command.
+#
+exe_name=$0
+exe_dir=`dirname "$0"`
+echo "------------------------------------------"
+if [ "x$1" = "x" ]; then
+  echo Usage:
+  echo    $0 \<deployedMCRroot\> args
+else
+  echo Setting up environment variables
+  MCRROOT="$1"
+  echo ---
+  LD_LIBRARY_PATH=.:${MCRROOT}/runtime/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/bin/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/sys/os/glnxa64;
+	MCRJRE=${MCRROOT}/sys/java/jre/glnxa64/jre/lib/amd64 ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/native_threads ; 
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/server ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/client ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE} ;  
+  XAPPLRESDIR=${MCRROOT}/X11/app-defaults ;
+  export LD_LIBRARY_PATH;
+  export XAPPLRESDIR;
+  echo LD_LIBRARY_PATH is ${LD_LIBRARY_PATH};
+  shift 1
+  args=
+  while [ $# -gt 0 ]; do
+      token=`echo "$1" | sed 's/ /\\\\ /g'`   # Add blackslash before each blank
+      args="${args} ${token}" 
+      shift
+  done
+  "${exe_dir}"/initialstructure fSf
+fi
+exit
diff --git a/sourcecodes/data/examplezoo/fSfstructure_input.txt b/sourcecodes/data/examplezoo/fSfstructure_input.txt
new file mode 100644
index 00000000..c49d600b
--- /dev/null
+++ b/sourcecodes/data/examplezoo/fSfstructure_input.txt
@@ -0,0 +1,18 @@
+hair	feathers	eggs	milk	airborne	aquatic	predator	toothed	backbone	breathes	venomous	fins	legs	tail	domestic	catsize	type	
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	1	
+1	1	0	0	0	0	0	1	1	1	0	0	1	1	0	1	0	
+1	1	0	0	0	0	0	1	1	1	0	0	1	1	0	1	1	
+0	0	1	1	0	0	0	0	1	1	0	0	0	0	0	1	0	
+0	0	1	1	0	0	0	0	0	1	0	1	0	0	0	0	0	
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	
+1	1	0	0	0	0	0	1	0	0	0	1	1	1	0	0	1	
+1	0	0	0	0	0	0	1	1	0	0	1	1	0	0	1	1	
+1	1	1	1	0	0	0	1	1	1	0	1	1	1	0	1	0	
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	1	
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	
+0	0	1	1	0	0	0	0	0	0	0	1	0	1	0	0	0	
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	
+0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	
diff --git a/sourcecodes/data/examplezoo/fSfstructure_input_temp.txt b/sourcecodes/data/examplezoo/fSfstructure_input_temp.txt
new file mode 100644
index 00000000..8910aaee
--- /dev/null
+++ b/sourcecodes/data/examplezoo/fSfstructure_input_temp.txt
@@ -0,0 +1,18 @@
+hair	feathers	eggs	milk	airborne	aquatic	predator	toothed	backbone	breathes	venomous	fins	legs	tail	domestic	catsize	type	
+0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	
+0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	1.000000	
+1.000000	0.800011	0.000000	0.000000	0.000000	0.000000	0.000000	1.000000	1.000000	1.000000	0.000000	0.000000	1.000000	1.000000	0.000000	1.000000	0.000000	
+1.000000	1.000000	0.500003	0.000000	0.000000	0.000000	0.000000	1.000000	1.000000	1.000000	0.000000	0.000000	1.000000	1.000000	0.000000	1.000000	1.000000	
+0.000000	0.400004	1.000000	1.000000	0.000000	0.000000	0.000000	0.000000	1.000000	1.000000	0.000000	0.000000	0.000000	0.000000	0.000000	1.000000	0.000000	
+0.000000	0.000000	1.000000	1.000000	0.000000	0.000000	0.000000	0.000000	0.000000	1.000000	0.000000	1.000000	0.000000	0.000000	0.000000	0.000000	0.000000	
+0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	
+0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	
+1.000000	1.000000	0.000000	0.000000	0.000000	0.000000	0.000000	1.000000	0.000000	0.000000	0.000000	1.000000	1.000000	1.000000	0.000000	0.000000	1.000000	
+0.800018	0.799985	0.000000	0.000000	0.000000	0.000000	0.000000	1.000000	1.000000	0.000000	0.000000	1.000000	1.000000	0.000000	0.000000	1.000000	1.000000	
+1.000000	1.000000	1.000000	1.000000	0.000000	0.000000	0.000000	1.000000	1.000000	1.000000	0.000000	1.000000	1.000000	1.000000	0.000000	1.000000	0.000000	
+0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	
+0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	1.000000	
+0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	
+0.199982	0.000000	0.900015	0.900010	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	1.000000	0.000000	1.000000	0.000000	0.000000	0.000000	
+0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	
+0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	0.000000	
diff --git a/sourcecodes/data/examplezoo/fSfstructure_old.txt b/sourcecodes/data/examplezoo/fSfstructure_old.txt
new file mode 100644
index 00000000..bf00f5d5
--- /dev/null
+++ b/sourcecodes/data/examplezoo/fSfstructure_old.txt
@@ -0,0 +1,16 @@
+feathers	0.8693	0.1307
+type	0.5297	0.1307	0.0476	0.0854	0.0323	0.0578	0.1165
+eggs	0.4962	0.5038
+hair	0.4597	0.5403
+toothed	0.3799	0.6201
+backbone	0.1743	0.8257
+breathes	0.1666	0.8334
+legs	0.1827	0.2108	0.4747	0.0111	0.0799	0.0409
+tail	0.2426	0.7574
+catsize	0.4789	0.5211
+milk	0.4703	0.5297
+airborne	0.8149	0.1851
+aquatic	0.6726	0.3274
+fins	0.8751	0.1249
+venomous	0.8860	0.1140
+domestic	0.8672	0.1328
diff --git a/sourcecodes/data/examplezoo/fSfthr.txt b/sourcecodes/data/examplezoo/fSfthr.txt
new file mode 100644
index 00000000..aec258df
--- /dev/null
+++ b/sourcecodes/data/examplezoo/fSfthr.txt
@@ -0,0 +1 @@
+0.8
diff --git a/sourcecodes/data/examplezoo/fSftier.txt b/sourcecodes/data/examplezoo/fSftier.txt
new file mode 100644
index 00000000..ca417b31
--- /dev/null
+++ b/sourcecodes/data/examplezoo/fSftier.txt
@@ -0,0 +1 @@
+4,Tier1,5,aquatic,airborne,venomous,predator,domestic,Tier2,4,eggs,milk,backbone,breathes,Tier3,7,catsize,tail,toothed,hair,feathers,fins,legs,Tier4,1,type,
\ No newline at end of file
diff --git a/sourcecodes/data/examplezoo/fSftype.txt b/sourcecodes/data/examplezoo/fSftype.txt
new file mode 100644
index 00000000..41c0f73e
--- /dev/null
+++ b/sourcecodes/data/examplezoo/fSftype.txt
@@ -0,0 +1,2 @@
+hair	feathers	eggs	milk	airborne	aquatic	predator	toothed	backbone	breathes	venomous	fins	legs	tail	domestic	catsize	type
+2	2	2	2	2	2	2	2	2	2	2	2	6	2	2	2	7	
diff --git a/sourcecodes/data/examplezoo/fSfwhite.txt b/sourcecodes/data/examplezoo/fSfwhite.txt
new file mode 100644
index 00000000..83e81b8b
--- /dev/null
+++ b/sourcecodes/data/examplezoo/fSfwhite.txt
@@ -0,0 +1 @@
+From	To
diff --git a/sourcecodes/data/examplezoo/standardized_data.txt b/sourcecodes/data/examplezoo/standardized_data.txt
new file mode 100644
index 00000000..0975061e
--- /dev/null
+++ b/sourcecodes/data/examplezoo/standardized_data.txt
@@ -0,0 +1,102 @@
+domestic	venomous	predator	aquatic	airborne	milk	eggs	breathes	catsize	backbone	tail	legs	fins	toothed	feathers	type	hair	
+1	1	2	2	1	1	2	1	1	2	2	1	2	2	1	4	1
+2	1	1	2	1	1	2	1	1	2	2	1	2	2	1	4	1
+1	1	2	2	1	1	2	1	1	2	2	1	2	2	1	4	1
+1	1	2	2	1	1	2	1	1	2	2	1	2	2	1	4	1
+1	1	2	1	1	1	2	1	1	1	1	1	1	1	1	7	1
+1	1	2	2	1	1	2	1	2	2	2	1	2	2	1	4	1
+1	1	2	2	1	2	1	2	2	2	2	1	2	2	1	1	1
+1	1	1	2	1	1	2	1	1	2	2	1	2	2	1	4	1
+1	1	2	2	1	1	2	1	1	2	2	1	2	2	1	4	1
+1	1	2	2	1	1	2	1	2	2	2	1	2	2	1	4	1
+1	1	2	2	1	1	2	1	1	2	2	1	2	2	1	4	1
+1	2	2	1	1	1	2	2	1	2	2	1	1	2	1	3	1
+1	1	2	2	1	2	1	2	2	2	2	1	2	2	1	1	1
+1	1	1	2	1	1	2	1	1	2	2	1	2	2	1	4	1
+1	1	2	2	1	2	1	2	2	2	1	1	2	2	1	1	2
+1	2	2	2	1	1	1	1	1	2	2	1	1	2	1	3	1
+1	2	2	2	1	1	2	1	1	1	1	1	1	1	1	7	1
+1	1	2	1	1	1	2	2	1	2	2	1	1	2	1	3	1
+1	1	1	1	1	1	2	2	1	1	1	1	1	1	1	7	1
+1	1	1	2	1	1	2	1	1	2	2	1	2	2	1	4	1
+1	2	2	2	1	1	2	1	2	2	2	1	2	2	1	4	1
+1	1	2	2	1	1	2	1	2	2	2	1	2	2	1	4	1
+1	1	1	1	1	1	2	2	1	1	1	1	1	1	1	7	1
+2	1	1	1	2	1	2	2	1	2	2	2	1	1	2	2	1
+1	1	2	1	2	1	2	2	1	2	2	2	1	1	2	2	1
+2	1	1	1	2	1	2	2	1	2	2	2	1	1	2	2	1
+1	1	1	2	2	1	2	2	1	2	2	2	1	1	2	2	1
+1	1	1	1	2	1	2	2	2	2	2	2	1	1	2	2	1
+1	1	1	1	2	2	1	2	1	2	2	2	1	2	1	1	2
+2	1	2	1	1	2	1	2	2	2	1	2	1	2	1	1	2
+1	1	1	1	1	2	1	2	2	2	1	2	1	2	1	1	2
+1	1	2	2	2	1	2	2	1	2	2	2	1	1	2	2	1
+1	1	2	1	2	1	2	2	1	2	2	2	1	1	2	2	1
+1	1	2	1	1	1	2	2	1	2	2	2	1	1	2	2	1
+1	1	1	1	2	1	2	2	1	2	2	2	1	1	2	2	1
+1	1	1	1	1	1	2	2	2	2	2	2	1	1	2	2	1
+2	1	1	1	2	1	2	2	1	2	2	2	1	1	2	2	1
+1	1	2	2	1	1	2	2	2	2	2	2	1	1	2	2	1
+1	1	1	1	2	1	2	2	1	2	2	2	1	1	2	2	1
+1	1	2	1	1	1	2	2	2	2	2	2	1	1	2	2	1
+1	1	2	2	1	2	1	2	2	2	2	2	2	2	1	1	2
+1	1	2	2	2	1	2	2	1	2	2	2	1	1	2	2	1
+1	1	2	2	2	1	2	2	1	2	2	2	1	1	2	2	1
+1	1	1	1	2	1	2	2	1	2	2	2	1	1	2	2	1
+1	1	1	1	1	2	1	2	1	2	2	2	1	2	1	1	2
+1	1	1	2	2	1	2	2	2	2	2	2	1	1	2	2	1
+1	1	1	1	2	2	1	2	1	2	2	2	1	2	1	1	2
+1	1	2	1	2	1	2	2	2	2	2	2	1	1	2	2	1
+1	1	1	1	1	2	1	2	2	2	2	2	1	2	1	1	2
+1	1	1	1	2	1	2	2	1	2	2	2	1	1	2	2	1
+1	1	2	1	1	2	1	2	2	2	1	3	1	2	1	1	2
+1	1	1	1	1	2	1	2	2	2	2	3	1	2	1	1	2
+1	1	2	1	1	2	1	2	2	2	1	3	1	2	1	1	2
+1	1	2	1	1	2	1	2	2	2	2	3	1	2	1	1	2
+1	1	1	1	1	2	1	2	2	2	2	3	1	2	1	1	2
+2	1	1	1	1	2	1	2	2	2	2	3	1	2	1	1	2
+2	1	1	1	1	2	1	2	1	2	1	3	1	2	1	1	2
+1	1	2	1	1	2	1	2	2	2	2	3	1	2	1	1	2
+1	1	2	2	1	1	2	1	1	1	1	3	1	1	1	7	1
+1	1	1	1	1	2	1	2	2	2	2	3	1	2	1	1	2
+1	1	1	1	1	2	1	2	2	2	2	3	1	2	1	1	2
+1	1	2	2	1	1	2	2	1	2	1	3	1	2	1	5	1
+1	2	2	2	1	1	2	2	1	2	1	3	1	2	1	5	1
+1	1	1	1	1	2	1	2	2	2	2	3	1	2	1	1	2
+2	1	1	1	1	2	1	2	2	2	2	3	1	2	1	1	2
+2	1	1	1	1	2	1	2	1	2	2	3	1	2	1	1	2
+1	1	1	1	1	2	1	2	1	2	2	3	1	2	1	1	2
+1	1	2	1	1	2	1	2	2	2	2	3	1	2	1	1	2
+1	1	2	1	1	2	1	2	2	2	2	3	1	2	1	1	2
+1	1	2	1	1	2	1	2	2	2	2	3	1	2	1	1	2
+1	1	2	2	1	2	1	2	2	2	2	3	1	2	1	1	2
+1	1	2	1	1	2	1	2	1	2	2	3	1	2	1	1	2
+1	1	2	1	1	2	1	2	2	2	2	3	1	2	1	1	2
+1	1	2	2	1	1	2	2	1	2	2	3	1	2	1	5	1
+1	1	2	1	1	2	1	2	1	2	2	3	1	2	1	1	2
+1	1	1	1	1	2	1	2	2	2	2	3	1	2	1	1	2
+1	1	2	2	1	2	2	2	2	2	2	3	1	1	1	1	2
+1	1	2	1	1	2	1	2	2	2	2	3	1	2	1	1	2
+2	1	1	1	1	2	1	2	2	2	2	3	1	2	1	1	2
+1	1	2	1	1	2	1	2	2	2	2	3	1	2	1	1	2
+2	1	2	1	1	2	1	2	2	2	2	3	1	2	1	1	2
+1	1	2	1	1	2	1	2	2	2	2	3	1	2	1	1	2
+2	1	1	1	1	2	1	2	2	2	2	3	1	2	1	1	2
+1	1	1	2	1	1	2	2	1	2	1	3	1	2	1	5	1
+1	1	1	1	1	1	2	2	2	2	2	3	1	1	1	3	1
+1	1	2	1	1	1	2	2	1	2	2	3	1	2	1	3	1
+1	1	1	1	1	2	1	2	1	2	2	3	1	2	1	1	2
+1	1	2	1	1	2	1	2	2	2	2	3	1	2	1	1	2
+1	1	2	2	1	1	2	1	1	1	1	4	1	1	1	7	1
+1	1	2	2	1	1	2	1	1	1	1	5	1	1	1	7	1
+1	1	1	1	1	1	2	2	1	1	1	5	1	1	1	6	1
+1	1	1	1	2	1	2	2	1	1	1	5	1	1	1	6	1
+2	2	1	1	2	1	2	2	1	1	1	5	1	1	1	6	2
+1	1	1	1	2	1	2	2	1	1	1	5	1	1	1	6	2
+1	1	2	1	2	1	2	2	1	1	1	5	1	1	1	6	1
+1	1	2	2	1	1	2	1	1	1	1	5	1	1	1	7	1
+1	1	1	1	2	1	2	2	1	1	1	5	1	1	1	6	2
+1	1	1	1	1	1	2	2	1	1	1	5	1	1	1	6	1
+1	2	1	1	2	1	2	2	1	1	1	5	1	1	1	6	2
+1	1	2	2	1	1	2	1	2	1	1	6	1	1	1	7	1
+1	2	2	1	1	1	1	2	1	1	2	6	1	1	1	7	1
diff --git a/sourcecodes/data/initialstructure b/sourcecodes/data/initialstructure
new file mode 100644
index 00000000..9ecf1bc7
--- /dev/null
+++ b/sourcecodes/data/initialstructure
Binary files differdiff --git a/sourcecodes/data/newintervention b/sourcecodes/data/newintervention
new file mode 100644
index 00000000..d818a943
--- /dev/null
+++ b/sourcecodes/data/newintervention
Binary files differdiff --git a/sourcecodes/data/standardized_data.txt b/sourcecodes/data/standardized_data.txt
new file mode 100644
index 00000000..ac8c5aaf
--- /dev/null
+++ b/sourcecodes/data/standardized_data.txt
@@ -0,0 +1,201 @@
+Trait5	Geno2	Trait6	Trait3	Geno1	Trait2	Trait4	Trait1	
+1.8453	1	-0.70749	-1.3361	1	1.5443	-0.43784	0.72817
+0.9605	2	0.85158	1.5164	2	-1.1632	1.0263	-0.11444
+-0.63336	2	0.53936	1.1602	2	-0.74229	1.4011	-1.5418
+1.3355	1	-1.7216	-0.76715	2	0.12195	-0.66179	0.098918
+0.36111	1	-0.74876	-0.98283	2	-2.0753	-1.2335	-0.99306
+-1.177	2	0.51257	0.84261	2	0.065663	1.2658	-0.64706
+0.076305	2	1.5888	1.7606	2	-0.66331	1.4736	0.39036
+-0.53841	1	0.11031	-1.5038	2	0.23456	-0.060179	0.14069
+-0.59968	2	0.48834	1.0431	2	-0.59377	0.22579	-0.99995
+0.37839	2	1.293	0.49142	2	-1.2855	0.37537	0.50769
+-0.98262	2	1.6051	0.57702	1	0.44497	0.92494	1.9399
+-0.32154	2	1.0249	0.77512	2	-0.62075	0.32547	1.8131
+0.094471	2	1.0318	1.5671	1	-0.60413	0.75183	-1.4871
+-0.2677	1	-1.3762	-0.039045	1	0.61004	-0.20296	-0.34358
+1.45	1	0.22686	-0.18131	2	-0.5462	-0.61255	-0.83466
+-0.94296	1	-1.0223	-1.1896	2	-0.4021	-1.2644	-1.2829
+-0.65504	1	-2.6825	-1.035	2	0.25776	-1.4615	0.8459
+1.3635	2	1.5647	0.59499	1	1.372	1.0621	0.74488
+0.60321	2	0.68692	1.4714	1	0.81867	1.711	0.90076
+-0.5142	1	-1.0962	-1.5522	2	-0.04535	-1.2401	-0.62324
+-1.2303	2	0.82027	1.0532	1	-0.12811	1.344	0.60502
+0.84008	1	-0.7159	-0.44987	2	-0.56344	-1.5572	1.0854
+0.47761	2	1.5622	1.2168	2	-0.30596	1.1251	-1.373
+-1.3546	1	-0.7484	-0.096654	2	0.03293	0.23078	0.81596
+-0.32954	1	-1.6183	-0.57119	2	-0.9399	-1.5734	-0.76397
+0.57841	2	0.24378	0.681	2	-0.7778	1.305	0.77764
+0.11524	1	-0.85367	0.35424	1	2.3096	0.75697	1.7574
+1.1463	1	0.0096586	-0.25741	2	-0.52081	-1.5513	0.645
+-1.3926	1	-0.88863	-0.68795	1	0.0060478	-0.43763	0.97176
+-0.34841	2	1.0004	0.23941	2	-0.83161	0.87503	-0.88976
+0.79176	2	0.59541	1.0092	2	-1.9591	0.77295	0.31236
+-1.7691	1	0.055429	-1.1837	1	1.1172	-0.091192	1.3242
+0.23812	1	-0.13588	-0.98943	2	-0.041159	-0.43704	-0.39798
+1.4262	2	0.46298	1.327	2	0.15808	1.1741	-0.073986
+1.3584	2	1.5511	0.49802	2	-0.96618	-0.037384	0.26962
+-0.45407	1	-0.11918	-0.20984	2	-0.84764	0.68704	0.15697
+1.3502	2	1.1228	1.7003	2	-0.34181	1.3601	0.19833
+0.51265	1	0.059243	-0.61724	2	-1.2675	-1.2719	-1.5491
+1.6144	1	-1.6767	-0.4403	1	-0.7614	0.046076	-0.67463
+-0.99883	1	-0.76648	0.33667	1	0.97148	-1.1389	-0.1179
+0.24789	2	0.4729	1.0484	2	-0.62124	0.34555	-0.089509
+1.6957	1	0.014711	-1.3474	2	-0.026706	-1.4606	-1.4344
+-0.54533	2	0.88108	1.3793	2	-0.29202	1.3706	-1.1715
+-1.7381	2	0.16189	0.96739	2	-0.77438	0.96572	1.2346
+-0.844	1	-1.0713	-0.50552	1	1.1809	-0.13536	3.0986
+-1.8946	2	0.83747	0.55294	2	0.21042	0.78685	-0.41598
+-1.2313	2	0.77672	1.7131	2	-0.38666	1.694	-0.79748
+-0.7674	1	-1.151	-0.091205	2	0.9644	-0.57897	0.21363
+0.72057	1	-0.34897	-0.95934	2	-1.3832	-0.57841	-0.10753
+1.2095	1	0.5788	-0.77644	1	0.86817	-0.56945	0.13453
+0.09126	2	1.0274	0.59902	2	0.094442	0.30723	1.2562
+-1.7398	2	0.67041	0.82202	2	-0.30164	0.94827	-0.94319
+-0.66818	2	0.49087	1.2694	2	-0.18615	0.78217	-1.3246
+-0.2258	1	-1.4193	-1.44	2	-1.5421	-1.6216	-0.34894
+1.4939	1	0.12307	-0.97417	1	-1.9058	-1.6405	-2.6656
+0.59683	1	-0.27561	-1.5921	2	-0.012339	-1.033	0.22491
+0.32502	2	1.8115	0.59888	2	-0.78178	0.37072	-1.5605
+0.33627	1	-0.54037	-0.092937	2	-0.23801	-0.28432	0.25603
+-0.71947	1	-0.96292	-0.87226	1	1.0454	-1.1866	-1.1159
+0.7723	1	-0.74389	-0.31293	1	0.56738	-1.597	0.21894
+1.1117	2	0.22881	0.53378	2	0.28362	0.62928	-0.5678
+-0.37072	2	1.1896	1.2033	1	1.7889	1.9867	-1.137
+1.9537	1	-1.2797	-1.1399	2	-0.45995	-1.6282	-0.33916
+-1.1043	2	1.0871	2.3039	1	-0.27611	0.615	0.27212
+-1.3202	2	0.86019	1.2914	1	0.27461	0.94779	-0.83604
+-0.46478	2	1.29	0.43419	2	0.6874	1.6104	-0.36625
+-1.1858	1	-1.2069	-0.56475	2	0.18024	-0.54017	0.23692
+0.32802	2	0.87458	1.8613	1	0.40544	1.1088	1.7578
+1.1735	1	-0.66747	-1.6202	2	0.53589	-0.9149	0.45194
+-1.16	2	1.0838	0.61868	1	0.72867	1.3378	0.26446
+1.462	1	0.19509	-1.4192	2	0.56635	-0.85302	0.33349
+1.0695	2	0.21919	1.322	1	1.3441	1.1727	0.75993
+-0.22703	2	1.1363	0.54703	2	-0.48891	1.2236	-0.91703
+1.3458	1	-0.6068	-1.7825	2	-0.68775	-0.89217	0.99687
+-0.091249	2	0.68469	0.60839	2	-0.6527	0.58896	-0.24057
+0.67203	2	0.72395	1.1051	2	-1.4197	0.29802	0.18773
+0.34537	2	1.2845	1.4258	2	-0.6173	1.0233	-0.24272
+-1.0761	1	-1.2815	-0.94371	2	-1.4633	-0.69107	-0.87208
+-0.20711	2	1.0174	0.69566	2	-0.58432	0.15352	-0.49392
+0.59929	2	1.5069	1.8419	2	-1.4583	-0.031663	0.0051904
+-0.11492	2	1.2367	1.2191	2	-0.51421	1.1523	1.8842
+1.2751	1	-0.52411	-0.64346	1	2.0614	-0.0023541	-0.78047
+0.90981	2	1.1284	1.2152	1	2.6756	1.2409	-0.0088196
+-1.9542	1	-1.221	-1.4163	1	1.2826	-0.010965	1.0953
+1.7193	2	0.30492	1.2836	1	0.61499	0.56464	0.15416
+-0.53199	2	0.23732	0.77552	2	-1.2032	-0.66655	0.098147
+0.036699	1	-1.0483	-1.779	2	0.3525	-0.60395	0.29999
+-0.64389	2	-0.082056	0.48348	2	-0.86546	-0.4081	-0.099655
+0.7892	1	0.063117	-0.73251	2	-0.64062	-0.4066	0.12407
+-0.92679	1	-1.4966	0.012855	2	0.79099	-0.55856	0.1923
+0.75147	2	0.0035339	0.026413	2	-0.50794	0.29651	-0.27805
+0.21172	1	-1.3492	-0.47335	2	0.23233	-0.70213	-1.863
+-0.97409	1	-0.629	-0.4728	2	0.091744	-0.086481	-0.49562
+-1.0464	1	-1.6692	-0.8497	1	1.5077	0.095689	1.3064
+-0.078054	2	1.7703	0.87897	1	1.6091	1.3305	-0.65244
+1.6149	1	-0.75709	-0.63085	2	-0.77532	-2.2636	-0.59726
+-1.1678	2	0.0899	0.58095	1	-0.22151	0.26068	0.51603
+-0.098842	1	-0.30237	-0.04093	2	-1.2385	-0.37569	-1.8225
+-0.55001	1	-1.0301	-1.7087	1	2.6454	-1.328	0.34932
+1.0482	1	-0.26461	-1.3201	1	1.68	-0.0041651	-0.12149
+0.5008	1	-0.85959	-0.66514	2	-1.6141	0.29161	-0.89114
+0.309	2	1.0744	1.269	2	-0.96467	1.5905	-1.4207
+-0.03887	2	1.0667	1.0095	2	-0.089407	0.99929	1.1521
+-0.50172	1	-0.99479	-0.54327	1	-0.16208	-1.0551	0.47458
+-0.094959	2	2.17	1.7212	1	0.51568	0.53768	-1.2646
+-0.5209	1	-1.431	-0.70798	2	-0.4217	0.23091	0.57754
+0.6976	1	-1.2512	-0.50443	2	0.40922	-1.2722	-0.2292
+-0.15737	1	-1.3037	-1.2446	2	-0.25	-1.3128	-0.48314
+1.7004	1	-0.093222	0.18072	2	-0.77286	-1.1751	0.70345
+-0.34711	1	-0.40996	-0.38877	2	-0.74126	-0.076517	0.71528
+0.63301	1	-1.3066	-1.061	2	-0.020245	-0.47474	0.22126
+0.45593	2	0.98475	1.1245	2	-1.5284	0.87162	-1.1122
+-0.074398	1	0.086143	-0.71909	2	-0.72312	-0.58633	-0.1192
+0.5737	2	1.3999	0.41267	2	0.14453	0.30696	0.39156
+0.50652	1	-0.76797	-0.93352	2	-0.537	-0.41761	0.072314
+-1.6019	1	0.65979	-0.97526	2	0.28122	-0.88937	0.46691
+0.74414	2	1.6353	1.382	2	0.099487	1.2686	1.3096
+-1.3504	1	-1.1309	-0.53372	1	0.13853	-1.3604	1.3258
+-0.32328	1	-1.4115	-0.55521	2	-0.39333	-0.7941	1.0533
+-0.74323	2	1.7072	0.49329	2	-0.87786	0.48373	-1.3418
+0.8876	1	-1.0691	-0.47533	2	-0.65919	-1.2867	1.3564
+-0.26121	2	1.3665	1.3315	1	0.59812	1.5342	-0.51234
+-0.52176	2	1.5091	0.71759	2	-0.79433	0.67907	-0.77323
+-0.51351	1	-0.99866	-0.96005	1	-0.064251	-0.82275	1.8511
+-0.17328	1	0.54034	-1.7709	2	0.38529	-1.362	0.67177
+0.15516	2	1.1328	-0.19576	2	-1.135	1.0527	0.29149
+0.45546	2	0.45829	1.7196	1	0.62149	2.3385	-2.0505
+2.0143	2	1.7214	1.3935	2	-1.973	1.0241	-0.84131
+0.017525	1	-1.3151	-0.89644	2	-0.75598	-1.0529	0.10476
+-0.041089	1	-0.071698	-0.33496	2	-0.25915	-0.26742	0.55857
+-0.072325	2	0.14302	1.099	2	0.45095	0.51954	-1.5626
+0.9507	1	-0.99789	-1.1502	2	-0.63471	0.61259	0.50045
+-1.8153	1	-0.51697	-0.18793	2	-0.58518	-0.41489	-0.79317
+-0.37059	1	-0.18087	-0.77008	1	0.14794	-0.66655	0.62321
+-0.24334	1	0.033188	-0.22919	2	-1.8202	-0.18936	-0.69098
+-0.83923	1	-0.41353	-1.3264	1	1.8901	-1.3452	0.28542
+-1.5292	1	-0.28479	-0.49856	2	0.34714	-1.4144	-0.50498
+-1.1641	2	0.77391	1.0241	2	-0.77302	0.27655	-2.6887
+2.6624	2	1.7387	1.374	2	0.041422	2.3695	-0.062437
+2.3682	2	1.907	0.94637	1	0.8413	0.76571	-1.6402
+0.31396	1	-1.292	-0.78457	1	-0.31227	-0.84139	-0.22931
+-0.87392	1	0.53494	0.55115	2	-0.15179	-0.83441	1.0812
+-1.1022	1	-0.57856	-0.21265	1	1.4486	0.11044	-0.38779
+0.42993	1	-1.5502	-0.063309	1	2.2649	-0.59644	2.3369
+-1.5011	1	-2.2926	-0.96909	2	-0.40571	-1.1012	0.55992
+-1.567	2	0.014611	-0.069863	1	1.3161	0.89287	0.96849
+0.26418	2	0.46242	1.94	2	-1.3016	1.1926	-1.5231
+-0.77783	2	1.4946	0.92514	2	-1.1651	1.0425	-1.2692
+-0.17339	1	-0.86526	-0.090231	2	-0.09102	-1.3706	0.0046364
+0.11883	2	0.8622	0.94077	2	-0.76414	1.3308	1.4151
+0.12005	1	-0.20542	-0.74536	2	-1.2579	-1.2279	-1.2716
+-0.79628	1	-0.022269	-0.16145	2	-0.47715	-0.37329	1.1973
+0.58969	2	1.0063	1.3356	1	0.79987	1.5464	0.32778
+0.11633	2	0.73396	1.1437	1	1.3183	1.0156	-1.9521
+-0.88008	1	0.39215	-0.88212	1	0.77879	-0.071244	0.92159
+-0.74781	1	-0.31657	-1.2371	2	-1.356	-0.76328	-0.96718
+-0.069788	1	0.63495	-0.70214	2	-0.76454	-2.2215	1.7057
+0.3897	1	-0.59859	-0.81633	2	-0.04446	0.84047	-0.75128
+2.202	2	0.77915	0.03712	1	1.8438	1.1743	0.40311
+0.22687	1	-0.40806	-1.0788	2	-0.19213	-0.78118	0.48283
+-0.66335	2	1.4808	1.1399	2	-0.033787	0.43484	-0.12131
+0.13303	1	-0.66658	-0.14357	2	-1.073	-0.49395	0.70644
+-1.5417	2	0.2473	1.2125	1	1.9083	1.2778	3.085
+0.74601	2	-0.35212	0.88616	2	-0.87675	0.60499	-0.21171
+-0.80655	1	-1.1068	-1.3459	2	-0.26122	0.15508	-0.0070062
+-0.69135	2	1.0994	1.204	1	2.3161	1.0629	1.4257
+1.6905	1	-0.14242	-0.55749	1	0.359	0.41916	0.53199
+-0.77018	1	-1.5065	-0.53604	2	0.19357	0.059861	1.9155
+-2.2055	2	1.058	-0.29035	1	1.0301	0.11952	1.1589
+-0.70569	1	-0.73004	-1.6228	1	2.1348	-0.42942	0.9784
+1.3633	2	0.65794	0.98061	1	1.3078	0.64345	0.83163
+0.093858	1	-1.6142	-0.92049	2	-0.92394	-1.3444	-0.43257
+1.6603	1	0.037058	0.81538	2	-0.70654	-0.93759	-0.023971
+0.29687	2	0.84923	0.6669	1	0.66467	0.47209	-0.21304
+0.30837	1	-0.8147	-1.3296	2	-1.1736	-1.2252	-0.61307
+-1.7779	1	-1.1384	-1.0425	2	-0.69411	-0.39049	-0.48426
+-0.35135	1	-0.52672	-1.388	1	0.84612	-1.4625	0.071531
+0.18294	1	-0.96354	-0.6923	2	-0.91232	-0.9204	0.029913
+-0.34302	2	1.8167	0.77427	1	0.036232	0.81699	1.0643
+-1.0367	1	-0.55158	-0.84582	1	0.67713	-0.66779	-0.43147
+2.6147	1	0.14282	-0.33616	2	-0.83219	-0.17633	-0.13154
+-0.59086	1	-1.2139	-0.99552	1	1.9391	-1.1308	0.34104
+-0.90208	1	-0.28263	-0.58061	1	0.7467	-0.84617	-0.13434
+1.2668	1	-0.56449	-0.1964	2	0.79248	0.19601	0.41757
+0.75643	2	-0.011136	0.81301	2	0.34117	0.68247	-1.8639
+-0.62022	2	0.86997	0.6729	2	-1.1203	0.17657	-1.4252
+-0.18946	1	-0.55133	-0.86512	2	-0.83578	-0.40257	-0.03024
+-1.5498	2	0.32287	1.184	2	-0.62378	0.80455	0.92802
+-0.53493	1	-0.9391	-0.84301	1	1.3501	-0.31379	-0.058359
+0.3655	1	-0.74384	-1.3595	2	1.3067	-0.5247	-1.7346
+0.82879	1	-1.5915	-1.0102	1	1.0708	-0.6468	0.92563
+0.57673	1	-1.4808	-1.0779	2	0.47651	-1.062	0.26109
+0.59244	1	-0.8026	-1.7146	2	-0.020034	-1.3898	-1.5713
+0.44996	2	0.50751	1.0983	1	2.2137	2.8355	0.34885
+-0.75132	1	-0.52338	-0.74591	2	-0.84637	-1.6929	-1.6592
+-0.1943	2	1.2265	0.4739	2	-0.78558	0.81272	-0.023571
+2.0866	1	-0.19274	0.066839	2	-0.30442	-0.70635	0.8594
+-1.3268	1	-1.2952	0.023312	1	1.4432	0.036383	0.89534
+-1.4174	1	-0.43139	-0.97617	1	1.9378	0.79311	-0.17685
+-0.30469	1	0.072833	-0.069195	1	1.2683	-0.62404	0.25508
diff --git a/sourcecodes/data/temp_evidence_file b/sourcecodes/data/temp_evidence_file
new file mode 100644
index 00000000..b687ceaf
--- /dev/null
+++ b/sourcecodes/data/temp_evidence_file
@@ -0,0 +1,36 @@
+#!/bin/sh
+# script for execution of deployed applications
+#
+# Sets up the MCR environment for the current $ARCH and executes 
+# the specified command.
+#
+exe_name=$0
+exe_dir=`dirname "$0"`
+echo "------------------------------------------"
+if [ "x$1" = "x" ]; then
+  echo Usage:
+  echo    $0 \<deployedMCRroot\> args
+else
+  echo Setting up environment variables
+  MCRROOT="$1"
+  echo ---
+  LD_LIBRARY_PATH=.:${MCRROOT}/runtime/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/bin/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/sys/os/glnxa64;
+	MCRJRE=${MCRROOT}/sys/java/jre/glnxa64/jre/lib/amd64 ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/native_threads ; 
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/server ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/client ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE} ;  
+  XAPPLRESDIR=${MCRROOT}/X11/app-defaults ;
+  export LD_LIBRARY_PATH;
+  export XAPPLRESDIR;
+  echo LD_LIBRARY_PATH is ${LD_LIBRARY_PATH};
+  shift 1
+  args=
+  while [ $# -gt 0 ]; do
+      token=`echo "$1" | sed 's/ /\\\\ /g'`   # Add blackslash before each blank
+      args="${args} ${token}" 
+      shift
+  done
+  "${exe_dir}"/evidencemodified 
\ No newline at end of file
diff --git a/sourcecodes/data/temp_intervention_file b/sourcecodes/data/temp_intervention_file
new file mode 100644
index 00000000..cdf5ce0f
--- /dev/null
+++ b/sourcecodes/data/temp_intervention_file
@@ -0,0 +1,36 @@
+#!/bin/sh
+# script for execution of deployed applications
+#
+# Sets up the MCR environment for the current $ARCH and executes 
+# the specified command.
+#
+exe_name=$0
+exe_dir=`dirname "$0"`
+echo "------------------------------------------"
+if [ "x$1" = "x" ]; then
+  echo Usage:
+  echo    $0 \<deployedMCRroot\> args
+else
+  echo Setting up environment variables
+  MCRROOT="$1"
+  echo ---
+  LD_LIBRARY_PATH=.:${MCRROOT}/runtime/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/bin/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/sys/os/glnxa64;
+	MCRJRE=${MCRROOT}/sys/java/jre/glnxa64/jre/lib/amd64 ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/native_threads ; 
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/server ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/client ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE} ;  
+  XAPPLRESDIR=${MCRROOT}/X11/app-defaults ;
+  export LD_LIBRARY_PATH;
+  export XAPPLRESDIR;
+  echo LD_LIBRARY_PATH is ${LD_LIBRARY_PATH};
+  shift 1
+  args=
+  while [ $# -gt 0 ]; do
+      token=`echo "$1" | sed 's/ /\\\\ /g'`   # Add blackslash before each blank
+      args="${args} ${token}" 
+      shift
+  done
+  "${exe_dir}"/newintervention 
\ No newline at end of file
diff --git a/sourcecodes/data/temp_shell_file_initial_structure b/sourcecodes/data/temp_shell_file_initial_structure
new file mode 100644
index 00000000..5d1c323d
--- /dev/null
+++ b/sourcecodes/data/temp_shell_file_initial_structure
@@ -0,0 +1,36 @@
+#!/bin/sh
+# script for execution of deployed applications
+#
+# Sets up the MCR environment for the current $ARCH and executes 
+# the specified command.
+#
+exe_name=$0
+exe_dir=`dirname "$0"`
+echo "------------------------------------------"
+if [ "x$1" = "x" ]; then
+  echo Usage:
+  echo    $0 \<deployedMCRroot\> args
+else
+  echo Setting up environment variables
+  MCRROOT="$1"
+  echo ---
+  LD_LIBRARY_PATH=.:${MCRROOT}/runtime/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/bin/glnxa64 ;
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRROOT}/sys/os/glnxa64;
+	MCRJRE=${MCRROOT}/sys/java/jre/glnxa64/jre/lib/amd64 ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/native_threads ; 
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/server ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE}/client ;
+	LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${MCRJRE} ;  
+  XAPPLRESDIR=${MCRROOT}/X11/app-defaults ;
+  export LD_LIBRARY_PATH;
+  export XAPPLRESDIR;
+  echo LD_LIBRARY_PATH is ${LD_LIBRARY_PATH};
+  shift 1
+  args=
+  while [ $# -gt 0 ]; do
+      token=`echo "$1" | sed 's/ /\\\\ /g'`   # Add blackslash before each blank
+      args="${args} ${token}" 
+      shift
+  done
+  "${exe_dir}"/initialstructure 
\ No newline at end of file
diff --git a/sourcecodes/example.php b/sourcecodes/example.php
new file mode 100644
index 00000000..dc59cc3e
--- /dev/null
+++ b/sourcecodes/example.php
@@ -0,0 +1,31 @@
+<?php
+
+$oldkeyval=$_GET["My_key"];
+
+$type_n=array();
+
+$type_n=explode("|",$oldkeyval);
+
+
+$example=trim($type_n[0]);   
+$oldkeyval=trim($type_n[1]);   
+
+/////////////Generate a random key/////////////////////
+$alphas=array();
+$alphas = array_merge(range('A', 'Z'), range('a', 'z'));
+
+$al1=rand(0,51);
+$al2=rand(0,51);
+$al3=rand(0,51);
+
+$alpha="$alphas[$al1]"."$alphas[$al2]"."$alphas[$al3]";
+$keyval=$alpha;
+shell_exec('./examplefilecopy.sh '.$example.' '.$oldkeyval.' '.$keyval);
+
+?>
+<script>
+window.open("layout_example.php?My_key=<?php print($keyval);?>",'_self',false);
+</script>
+
+
+
diff --git a/sourcecodes/example_datasets/example_data_8nodes.txt b/sourcecodes/example_datasets/example_data_8nodes.txt
new file mode 100644
index 00000000..11f30f63
--- /dev/null
+++ b/sourcecodes/example_datasets/example_data_8nodes.txt
@@ -0,0 +1,201 @@
+Geno1	Geno2	Trait1	Trait2	Trait3	Trait4	Trait5	Trait6
+2	2	0.46259	1.2692	-1.3164	-0.44096	0.5929	-0.75422
+1	1	-0.10011	-0.88834	1.6407	0.99972	0.31288	0.65602
+1	1	-1.0533	-0.55296	1.2715	1.3686	-0.19153	0.37361
+1	2	0.042371	0.13573	-0.72659	-0.66133	0.43157	-1.6715
+1	2	-0.68686	-1.6152	-0.95019	-1.2239	0.12319	-0.79155
+1	1	-0.4558	0.090877	0.94224	1.2354	-0.36356	0.34937
+1	1	0.237	-0.49002	1.8939	1.4399	0.033059	1.3229
+1	2	0.070265	0.22547	-1.4903	-0.069341	-0.16148	-0.01449
+1	1	-0.69146	-0.43461	1.1501	0.21205	-0.18087	0.32746
+1	1	0.31535	-0.9858	0.57816	0.35924	0.12866	1.0553
+2	1	1.2718	0.39314	0.6669	0.90002	-0.30206	1.3376
+1	1	1.1871	-0.45611	0.87227	0.31014	-0.092846	0.81278
+2	1	-1.0168	-0.44286	1.6933	0.72968	0.038808	0.81906
+2	2	-0.25313	0.52468	0.02823	-0.20984	-0.075809	-1.3591
+1	2	-0.58108	-0.3967	-0.11925	-0.61288	0.46778	0.090941
+1	2	-0.88043	-0.28187	-1.1645	-1.2543	-0.28951	-1.039
+1	2	0.54121	0.24395	-1.0043	-1.4483	-0.19839	-2.5407
+2	1	0.47375	1.1319	0.68553	1.035	0.44043	1.3011
+2	1	0.57785	0.69093	1.5941	1.6735	0.19981	0.50708
+1	2	-0.43989	0.0024131	-1.5405	-1.2304	-0.15382	-1.1058
+2	1	0.38035	-0.063535	1.1606	1.3124	-0.38043	0.6277
+1	2	0.70114	-0.41044	-0.39767	-1.5424	0.27477	-0.76183
+1	1	-0.9406	-0.20526	1.3302	1.097	0.16006	1.2988
+1	2	0.52122	0.064793	-0.031492	0.21696	-0.41979	-0.79123
+1	2	-0.53387	-0.71043	-0.52344	-1.5584	-0.09538	-1.5781
+1	1	0.49563	-0.58126	0.7747	1.274	0.19196	0.10624
+2	2	1.1499	1.879	0.43595	0.73474	0.045381	-0.88645
+1	2	0.40705	-0.37647	-0.19815	-1.5366	0.37167	-0.10553
+2	2	0.62526	0.043371	-0.64449	-0.44076	-0.4318	-0.91807
+1	1	-0.61788	-0.62414	0.3169	0.85091	-0.10135	0.79065
+1	1	0.18491	-1.5226	1.1149	0.75046	0.25948	0.42431
+2	2	0.86063	0.92883	-1.1584	-0.099858	-0.55095	-0.064129
+1	2	-0.28946	0.0057533	-0.95703	-0.44018	0.084268	-0.23718
+1	1	-0.073096	0.16452	1.4444	1.1452	0.46025	0.30452
+1	1	0.15637	-0.73137	0.585	-0.046911	0.43881	1.2888
+1	2	0.081142	-0.63691	-0.14883	0.66593	-0.13479	-0.22207
+1	1	0.10876	-0.23383	1.8314	1.3282	0.4362	0.90139
+1	2	-1.0582	-0.97152	-0.57118	-1.2617	0.17115	-0.060679
+2	2	-0.47421	-0.56819	-0.38775	0.035215	0.51982	-1.6309
+2	2	-0.10242	0.8127	0.41773	-1.1308	-0.30719	-0.80758
+1	1	-0.083462	-0.4565	1.1556	0.3299	0.087362	0.31349
+1	2	-0.98158	0.01727	-1.3281	-1.4474	0.54555	-0.10096
+1	1	-0.80604	-0.19415	1.4986	1.3386	-0.16367	0.68271
+1	1	0.80082	-0.57853	1.0716	0.94015	-0.54114	0.032172
+2	2	2.0456	0.97954	-0.45536	-0.14332	-0.25819	-1.0833
+1	1	-0.30148	0.20623	0.64194	0.76414	-0.59067	0.64326
+1	1	-0.55625	-0.26957	1.8447	1.6568	-0.38077	0.58831
+1	2	0.11898	0.80706	-0.025844	-0.57984	-0.23395	-1.1554
+1	2	-0.095497	-1.0637	-0.92583	-0.57928	0.23695	-0.42992
+2	2	0.066154	0.73037	-0.73622	-0.57047	0.39169	0.40928
+1	1	0.81522	0.11381	0.68971	0.29219	0.037792	0.81502
+1	1	-0.65356	-0.20182	0.92089	0.92298	-0.5417	0.49215
+1	1	-0.90826	-0.10979	1.3847	0.75954	-0.20255	0.32975
+1	2	-0.25671	-1.1903	-1.4241	-1.6058	-0.062549	-1.3981
+2	2	-1.8038	-1.4801	-0.94121	-1.6244	0.4817	-0.0029469
+1	2	0.12651	0.028719	-1.5818	-1.0266	0.19779	-0.36357
+1	1	-1.0658	-0.58443	0.68956	0.35467	0.11177	1.5243
+1	2	0.14729	-0.15111	-0.027639	-0.2899	0.11533	-0.60305
+2	2	-0.76889	0.87161	-0.83556	-1.1777	-0.21878	-0.98527
+2	2	0.12252	0.49068	-0.2557	-1.5816	0.25332	-0.78715
+1	1	-0.40287	0.26456	0.62208	0.60909	0.36074	0.092703
+2	1	-0.78301	1.4641	1.3162	1.9448	-0.10841	0.9618
+1	2	-0.25018	-0.32797	-1.113	-1.6123	0.6272	-1.2718
+2	1	0.15804	-0.18147	2.4571	0.59504	-0.34056	0.8691
+2	1	-0.582	0.25738	1.4075	0.92251	-0.40889	0.66381
+1	1	-0.26827	0.58632	0.51883	1.5745	-0.13818	1.0526
+1	2	0.13453	0.18218	-0.51676	-0.54166	-0.36636	-1.206
+2	1	1.1502	0.36164	1.9983	1.0809	0.11272	0.67683
+1	2	0.27812	0.46559	-1.6109	-0.91039	0.3803	-0.71802
+2	1	0.15292	0.61921	0.71009	1.3063	-0.35819	0.8661
+1	2	0.19902	0.48986	-1.4026	-0.8495	0.47158	0.0622
+2	1	0.4838	1.1096	1.4392	1.1438	0.34739	0.084004
+1	1	-0.63609	-0.35105	0.63581	1.1939	-0.062938	0.91353
+1	2	0.64203	-0.5095	-1.7792	-0.88803	0.43482	-0.66314
+1	1	-0.18434	-0.48157	0.69942	0.56942	-0.019967	0.50506
+1	1	0.10168	-1.0928	1.2144	0.28313	0.22159	0.54058
+1	1	-0.18578	-0.45336	1.5468	0.99679	0.11821	1.0476
+1	2	-0.60607	-1.1275	-0.90963	-0.69014	-0.33163	-1.2734
+1	1	-0.35353	-0.42708	0.78989	0.14094	-0.056632	0.80598
+1	1	-0.020221	-1.1235	1.9782	-0.041281	0.19857	1.2488
+1	1	1.2346	-0.37121	1.3325	1.1237	-0.027458	1.0044
+2	2	-0.54489	1.6812	-0.59836	-0.012441	0.41243	-0.58835
+2	1	-0.029577	2.1707	1.3285	1.2109	0.29684	0.90646
+2	2	0.70774	1.0606	-1.3996	-0.020914	-0.60955	-1.2187
+2	1	0.07926	0.52862	1.3994	0.54549	0.55303	0.16155
+1	1	0.041856	-0.92023	0.87269	-0.66601	-0.15945	0.1004
+1	2	0.17665	0.31945	-1.7756	-0.60442	0.020525	-1.0625
+1	1	-0.090238	-0.65111	0.56993	-0.4117	-0.19486	-0.18849
+1	2	0.059166	-0.47194	-0.69068	-0.41022	0.25867	-0.057175
+1	2	0.10473	0.66887	0.082035	-0.55975	-0.28439	-1.468
+1	1	-0.20937	-0.36621	0.09609	0.28164	0.24673	-0.11107
+1	2	-1.2678	0.22369	-0.42201	-0.70103	0.075915	-1.3347
+1	2	-0.35467	0.11166	-0.42144	-0.095223	-0.29936	-0.68322
+2	2	0.84875	1.24	-0.81217	0.084034	-0.32224	-1.6241
+2	1	-0.45939	1.3208	0.97993	1.2991	-0.015791	1.487
+1	2	-0.42254	-0.57928	-0.58529	-2.2375	0.51999	-0.79909
+2	1	0.32092	-0.13796	0.67098	0.24639	-0.36066	-0.032948
+1	2	-1.2408	-0.94836	0.026276	-0.37981	-0.02237	-0.38777
+2	2	0.20959	2.1466	-1.7027	-1.3169	-0.16515	-1.046
+2	2	-0.10482	1.3773	-1.2998	-0.014223	0.34065	-0.35362
+1	2	-0.66188	-1.2477	-0.62084	0.27682	0.1674	-0.8918
+1	1	-0.97246	-0.73017	1.3843	1.5549	0.1067	0.85754
+1	1	0.74567	-0.032694	1.1153	0.97318	-0.0033905	0.85059
+2	2	0.29324	-0.090608	-0.4945	-1.0484	-0.14987	-1.0141
+2	1	-0.86818	0.44948	1.8531	0.51896	-0.021141	1.8486
+1	2	0.362	-0.29749	-0.66525	0.21709	-0.15594	-1.4087
+1	2	-0.17675	0.36465	-0.45423	-1.262	0.22968	-1.246
+1	2	-0.34633	-0.16067	-1.2216	-1.3019	-0.040891	-1.2935
+1	2	0.44608	-0.57732	0.25606	-1.1664	0.54705	-0.19859
+1	2	0.45398	-0.55214	-0.33433	-0.085418	-0.10094	-0.48509
+1	2	0.12407	0.022419	-1.0312	-0.47727	0.20924	-1.2961
+1	1	-0.76644	-1.1794	1.2345	0.84756	0.1532	0.77648
+1	2	-0.10329	-0.53768	-0.67677	-0.58708	-0.014634	-0.036347
+1	1	0.2378	0.15372	0.49652	0.29193	0.19047	1.152
+1	2	0.024605	-0.38937	-0.89907	-0.42106	0.16921	-0.80893
+1	2	0.28812	0.26265	-0.94234	-0.88527	-0.49803	0.48254
+1	1	0.85086	0.11783	1.5014	1.2382	0.24441	1.3649
+2	2	0.86172	0.14894	-0.4846	-1.3488	-0.41844	-1.1372
+1	2	0.67971	-0.27488	-0.50687	-0.79153	-0.093399	-1.391
+1	1	-0.91977	-0.66099	0.5801	0.46587	-0.2263	1.43
+1	2	0.88213	-0.48674	-0.42406	-1.2762	0.28981	-1.0813
+2	1	-0.36583	0.51518	1.4491	1.4995	-0.073755	1.1218
+1	1	-0.54006	-0.59443	0.81263	0.65809	-0.15621	1.2508
+2	2	1.2125	-0.012648	-0.92657	-0.81972	-0.1536	-1.0176
+1	2	0.42493	0.34558	-1.7672	-1.3503	-0.045928	0.37449
+1	1	0.17097	-0.86593	-0.13424	1.0257	0.058014	0.91044
+2	1	-1.393	0.5338	1.8514	2.291	0.15305	0.30028
+1	1	-0.58552	-1.5337	1.5133	0.9976	0.64638	1.4428
+1	2	0.046272	-0.56387	-0.86063	-1.0462	0.014457	-1.3038
+1	2	0.34933	-0.16796	-0.27854	-0.27327	-0.0040928	-0.17912
+1	1	-1.0672	0.3979	1.208	0.50111	-0.013978	0.015097
+1	2	0.31052	-0.46723	-1.1237	0.59267	0.30978	-1.0169
+1	2	-0.55337	-0.42776	-0.12612	-0.41838	-0.56558	-0.58189
+2	2	0.3925	0.15644	-0.72963	-0.66601	-0.10837	-0.27787
+1	2	-0.48513	-1.4119	-0.16889	-0.19646	-0.068098	-0.084247
+2	2	0.16692	1.5447	-1.3064	-1.3338	-0.25668	-0.48832
+1	2	-0.36092	0.31518	-0.44815	-1.4019	-0.47505	-0.37187
+1	1	-1.8192	-0.57745	1.1304	0.262	-0.3595	0.58577
+1	1	-0.065383	0.07156	1.4931	2.3215	0.85149	1.4585
+2	1	-1.119	0.70896	1.0498	0.74334	0.75838	1.6107
+2	2	-0.17682	-0.21029	-0.74465	-0.83806	0.10827	-1.2829
+1	2	0.69834	-0.082402	0.64008	-0.83119	-0.26766	0.36961
+2	2	-0.28266	1.1929	-0.15174	0.098554	-0.33989	-0.6376
+2	2	1.5369	1.8434	0.0030761	-0.59703	0.14497	-1.5165
+1	2	0.35023	-0.28475	-0.93594	-1.0937	-0.46614	-2.188
+2	1	0.62308	1.0873	-0.0037182	0.86847	-0.48699	-0.10105
+1	1	-1.0408	-0.99866	2.0799	1.1634	0.092516	0.30401
+1	1	-0.87125	-0.88987	1.0278	1.0157	-0.23725	1.2377
+1	2	-0.020591	-0.03398	-0.024834	-1.3588	-0.045961	-0.89693
+1	1	0.9213	-0.57037	1.044	1.2994	0.046517	0.66563
+1	2	-0.87288	-0.96382	-0.704	-1.2184	0.046903	-0.30008
+1	2	0.77586	-0.34168	-0.09867	-0.37744	-0.24309	-0.13441
+2	1	0.19521	0.67595	1.4533	1.5115	0.19553	0.79596
+2	1	-1.3273	1.0891	1.2544	0.98928	0.045725	0.54963
+2	2	0.59176	0.65915	-0.84578	-0.080229	-0.26961	0.24045
+1	2	-0.66958	-1.042	-1.2138	-0.7612	-0.22775	-0.40062
+1	2	1.1154	-0.57069	-0.6592	-2.1961	-0.013175	0.46007
+1	2	-0.5254	0.0031225	-0.77758	0.8169	0.13224	-0.65572
+2	1	0.24551	1.5078	0.10719	1.1454	0.70578	0.59051
+1	2	0.29875	-0.11455	-1.0497	-0.77881	0.080708	-0.48337
+1	1	-0.1047	0.011628	1.2504	0.41776	-0.20102	1.2252
+1	2	0.44808	-0.8165	-0.080134	-0.49618	0.051011	-0.71722
+2	1	2.0365	1.5592	1.3257	1.2472	-0.47899	0.10943
+1	1	-0.16507	-0.66011	0.98739	0.58519	0.245	-0.43277
+1	2	-0.028366	-0.16961	-1.3266	0.14248	-0.24634	-1.1154
+2	1	0.92842	1.8842	1.3169	1.0358	-0.20988	0.88021
+2	2	0.33158	0.32463	-0.50924	0.40233	0.54391	-0.24309
+1	2	1.2555	0.1928	-0.487	0.048779	-0.23483	-1.477
+2	1	0.75021	0.85943	-0.2323	0.10748	-0.68906	0.84276
+2	2	0.6297	1.7397	-1.6136	-0.43268	-0.21442	-0.77462
+2	1	0.53168	1.0807	1.0853	0.62304	0.44036	0.48087
+1	2	-0.31256	-0.69771	-0.88556	-1.333	0.038614	-1.5744
+1	2	-0.039695	-0.52447	0.91401	-0.93272	0.53434	-0.080746
+2	1	-0.16596	0.56821	0.76008	0.45442	0.10286	0.6539
+1	2	-0.4331	-0.89669	-1.3097	-1.2157	0.1065	-0.8512
+1	2	-0.34708	-0.51457	-1.012	-0.39437	-0.55374	-1.144
+2	2	0.024082	0.7128	-1.3702	-1.4492	-0.10228	-0.59071
+1	2	-0.0037109	-0.68845	-0.649	-0.91581	0.066805	-0.98583
+2	1	0.68706	0.067424	0.87139	0.7938	-0.099645	1.529
+2	2	-0.31183	0.57814	-0.80815	-0.66724	-0.31919	-0.61319
+1	2	-0.11153	-0.6246	-0.27979	-0.18363	0.83639	0.014919
+2	2	0.20406	1.5838	-0.96334	-1.1228	-0.17808	-1.2123
+2	2	-0.1134	0.63358	-0.53321	-0.84276	-0.27657	-0.36992
+1	2	0.25517	0.67006	-0.1349	0.18275	0.40982	-0.62487
+1	1	-1.2684	0.31042	0.91155	0.66143	0.2483	-0.12434
+1	1	-0.97542	-0.85419	0.7663	0.16362	-0.18737	0.67266
+1	2	-0.043882	-0.62746	-0.82816	-0.40626	-0.051048	-0.61297
+1	1	0.59605	-0.45852	1.2962	0.78156	-0.48154	0.17778
+2	2	-0.06266	1.1144	-0.80524	-0.3189	-0.16038	-0.96372
+1	2	-1.1821	1.0798	-1.3407	-0.52643	0.12458	-0.7871
+2	2	0.59446	0.89186	-0.97856	-0.64658	0.2712	-1.5538
+1	2	0.15067	0.41827	-1.0487	-1.0551	0.19143	-1.4537
+1	2	-1.073	0.022587	-1.7088	-1.3777	0.1964	-0.84025
+2	1	0.20928	1.8026	1.2073	2.78	0.15131	0.3448
+1	2	-1.1317	-0.6359	-0.70457	-1.676	-0.22886	-0.58769
+1	1	-0.039428	-0.58746	0.56	0.7896	-0.052581	0.99511
+1	2	0.55023	-0.20403	0.138	-0.70518	0.66927	-0.28861
+2	2	0.57423	1.1886	0.092876	0.025677	-0.41099	-1.2858
+2	2	-0.14179	1.5827	-0.94328	0.7703	-0.43967	-0.50448
+2	2	0.14666	1.0492	-0.0030259	-0.62418	-0.087515	-0.048386
diff --git a/sourcecodes/example_datasets/example_structure_matrix_8nodes.txt b/sourcecodes/example_datasets/example_structure_matrix_8nodes.txt
new file mode 100644
index 00000000..0741cfda
--- /dev/null
+++ b/sourcecodes/example_datasets/example_structure_matrix_8nodes.txt
@@ -0,0 +1,9 @@
+Geno1	Geno2	Trait1	Trait2	Trait3	Trait4	Trait5	Trait6		
+0	0	0	1	0	0	0	0
+0	0	0	0	1	1	0	1
+0	0	0	0	0	0	0	0
+0	0	1	0	0	1	0	0
+0	0	0	0	0	0	0	0
+0	0	0	0	1	0	0	0
+0	0	0	0	0	0	0	0
+0	0	0	0	0	0	0	0
diff --git a/sourcecodes/example_datasets/sci_5node_input_data.txt b/sourcecodes/example_datasets/sci_5node_input_data.txt
new file mode 100644
index 00000000..dc6b06df
--- /dev/null
+++ b/sourcecodes/example_datasets/sci_5node_input_data.txt
@@ -0,0 +1,101 @@
+Genotype	Gene1	Gene2	Gene3	Phenotype
+2	1.5856	0.55564	0.55242	1.3139
+1	-0.14146	-0.086375	0.05189	0.26111
+1	-2.0948	-1.9791	-2.3238	-1.9991
+2	0.17613	0.89772	0.49798	0.22116
+2	0.78313	0.87637	0.9285	1.0858
+1	-1.9728	-0.75695	-2.2369	-1.7399
+2	1.775	1.3178	1.3167	1.3973
+2	-1.2714	-1.1835	-1.412	-0.74772
+1	-0.95992	-0.81845	-1.035	-0.8709
+1	-0.18008	-0.1963	-0.055655	-0.68638
+1	-0.91878	-0.18406	-0.17584	0.70088
+2	0.97168	0.96167	0.82445	1.2612
+2	0.10034	0.25263	-0.176	-0.070045
+2	1.1077	-0.019582	0.14083	0.13839
+2	-0.41046	-0.86671	-1.0513	-1.0183
+1	-0.044187	0.39571	1.0857	0.39
+2	0.57588	0.19049	0.078282	-0.47325
+2	1.9464	2.0841	1.8318	1.9802
+2	0.46321	1.3578	1.021	1.8771
+2	1.9167	1.3101	-0.26599	0.90469
+2	-0.42985	0.239	-0.52662	-0.55523
+2	1.0403	0.52601	0.017946	-0.012835
+1	0.17842	0.6498	-0.016231	0.78005
+1	-0.11593	-0.7273	-0.52064	-0.20907
+1	-0.86376	-0.17876	0.18035	0.28076
+1	-0.24186	0.12528	-0.10569	0.65779
+2	-1.8571	-0.8041	-0.85423	-1.269
+1	0.39789	0.75178	0.27755	0.48727
+2	0.99021	1.2864	1.0158	1.1339
+2	-0.088439	0.55644	0.65845	-0.59516
+1	-0.72831	-0.30015	0.12644	0.066757
+1	-0.15252	-0.010712	-0.22172	-0.55251
+2	-0.21235	-0.41475	-0.2187	-0.86341
+1	-0.90534	-1.1265	-0.60156	-0.20972
+1	-0.67136	-1.2743	-0.3504	0.013198
+2	1.4111	0.6435	0.17169	-0.29794
+1	-1.2221	-0.67226	0.090401	0.70241
+2	-0.88346	-1.0499	-1.3199	-1.0976
+1	-0.48936	-0.54771	0.15673	0.8105
+2	1.5049	1.594	0.84865	0.72178
+1	-0.25056	0.48341	1.2365	1.1092
+1	0.13811	-0.58507	-0.95885	-0.61738
+1	-0.87264	-0.74791	-1.5181	-1.5901
+2	0.14211	0.6369	0.79376	-0.013034
+1	-0.24481	-0.44524	1.3187	0.82025
+2	0.575	-0.19314	-0.21002	0.55724
+2	2.0744	2.2796	1.3816	0.80652
+1	-1.6975	-0.79061	-0.99359	-1.0838
+2	0.42545	0.97151	1.074	0.99115
+1	0.29156	-0.16409	-0.53984	-0.53165
+2	0.78744	1.2463	1.1759	0.90476
+1	-0.73362	-0.4152	-1.4738	-1.0017
+2	0.69579	0.32557	0.81668	-0.18071
+2	-0.65341	-0.15034	-0.46282	-0.28704
+1	-0.3013	-0.46826	-0.71627	0.77452
+2	0.27929	0.34128	0.016051	0.31568
+2	1.2053	0.71997	0.52138	0.6513
+1	-1.2758	-1.53	-0.9493	-1.3122
+1	-0.4496	-0.49077	-0.58312	0.11437
+1	-1.194	0.078558	0.99998	1.1906
+2	1.1676	1.0917	1.4231	0.82601
+1	-2.4133	-1.7221	-1.4154	-2.3105
+1	-1.7349	-0.74588	0.70923	1.3554
+1	-1.0066	-1.2307	-1.2772	-1.9247
+1	-1.3599	-1.67	-1.0942	-0.88947
+1	-0.85031	-0.50545	0.13251	-0.29438
+2	1.1295	2.2709	1.5821	0.87414
+2	0.9404	2.2201	2.5706	2.2827
+2	1.2878	1.2808	1.2341	1.2212
+2	1.5657	1.6979	0.60126	0.016343
+1	-0.78161	-1.4101	-2.1212	-1.1646
+2	2.3684	2.4021	2.9528	2.8997
+2	1.4198	1.2756	1.2308	1.8256
+2	1.3385	1.1619	0.18614	0.5299
+1	-2.2351	-2.4864	-2.3812	-2.5204
+1	0.37027	0.84279	1.4497	0.66466
+2	0.38854	0.62781	-0.7411	-0.30425
+1	-1.4175	-0.93246	-0.86942	-0.75437
+2	2.7513	1.8671	1.9679	0.70267
+1	-0.24862	-0.46954	0.23864	-0.22039
+1	-1.1683	-1.126	-1.0483	-1.022
+2	0.88699	0.86321	1.4423	1.129
+1	0.58503	0.35468	0.52394	-0.072378
+2	2.6145	2.5218	2.7014	2.961
+1	-0.96916	-1.0452	-2.339	-2.3466
+2	-0.0037206	0.30223	0.74529	0.88013
+1	-1.0392	0.2696	-0.79208	-0.39101
+2	1.1444	0.69938	1.0147	1.0175
+1	-1.1242	-0.92379	-0.55404	0.022141
+1	-0.71288	-1.4036	-0.31533	-0.49676
+2	-0.26151	-0.10382	0.19007	-0.14386
+1	-0.36388	0.073868	0.61075	0.53165
+2	2.5483	2.4476	2.352	1.7179
+1	-1.7286	-0.55338	-0.49819	-0.9883
+2	1.8232	1.3801	1.0019	1.2709
+1	-0.40236	-0.7928	0.45495	0.23383
+2	0.70371	0.36383	0.67957	0.52054
+2	0.64323	0.16274	-0.5004	-0.65457
+2	1.5133	0.82002	0.70034	1.6914
+2	0.63141	0.38158	0.58788	-0.66281
diff --git a/sourcecodes/example_datasets/sci_5node_input_data2.txt b/sourcecodes/example_datasets/sci_5node_input_data2.txt
new file mode 100644
index 00000000..7b6f9fd3
--- /dev/null
+++ b/sourcecodes/example_datasets/sci_5node_input_data2.txt
@@ -0,0 +1,501 @@
+Genotype	Gene1	Gene3	Gene2	Phenotype
+2	-1.196	-1.0008	-0.44837	0.21808
+1	-0.10136	-0.29368	-0.53043	-1.0893
+2	-0.42907	0.70835	0.72886	-0.18098
+1	0.1425	0.63703	0.86428	1.7013
+1	-0.71634	-1.2402	-0.69712	-1.7002
+1	-1.0965	-1.1952	0.27155	-0.79413
+2	0.6135	0.62914	0.94265	1.8385
+1	-1.0924	-1.91	-2.379	-3.1094
+2	1.335	-0.83436	-0.90968	-1.3598
+1	-1.3309	0.15685	0.4766	1.2891
+2	1.2821	0.7047	1.0623	1.9811
+1	-0.8844	0.59747	-0.023123	0.88555
+1	-0.77687	-1.0557	-1.5548	-1.3016
+2	1.8089	1.5206	2.0289	0.90366
+1	0.41863	0.65525	-0.47226	-1.1824
+2	0.40947	-0.39262	0.382	-0.64829
+2	0.69647	0.14966	0.22972	0.33797
+1	-0.78961	-1.8836	-0.68534	-0.99941
+1	0.16835	0.48181	0.01241	1.2145
+2	2.5234	1.4673	2.0438	2.4674
+1	-0.31044	-1.3242	-0.80218	-1.6446
+1	-1.937	-1.2471	-2.0351	-1.0296
+1	-0.16484	0.23695	-0.01724	-0.32851
+1	-0.95538	-0.13986	-0.6065	-0.8491
+2	1.3507	0.90888	1.0365	2.7222
+1	-2.2006	-0.30556	-1.1546	-0.86033
+2	1.1575	0.5391	0.99532	0.96947
+2	0.94362	1.1235	0.37982	0.64439
+2	1.9158	1.7073	1.9303	2.8018
+1	-1.0697	-0.20553	-0.074104	-0.50073
+1	-0.11286	-0.27415	0.23076	-0.27564
+1	-1.3462	-1.304	-1.1213	-0.71793
+2	1.2432	0.54315	0.55846	0.87411
+1	-2.0927	-1.0659	-0.38067	-1.4372
+1	-0.72751	0.21278	-1.0115	-1.0984
+1	-2.0448	-2.9061	-1.3118	-3.8372
+2	0.12181	-0.69608	-0.61145	-1.0037
+1	-1.4165	0.66835	0.018886	-1.0081
+1	-0.40914	0.32575	-0.51767	1.0187
+2	2.2906	0.65837	1.2791	1.8388
+2	1.2643	0.37574	0.21618	-0.89435
+1	0.77712	0.13513	-0.31405	-0.16057
+2	1.6374	0.16054	0.40635	0.036165
+1	1.1933	1.9393	1.5717	2.6922
+1	-1.5576	-0.59118	-0.47154	-0.20293
+1	0.61043	-0.35938	-0.49565	-0.20837
+2	0.43312	-0.57133	0.15921	-0.44158
+1	0.17685	0.31835	0.49002	2.2029
+1	-1.6905	-0.0093708	-0.85889	-1.0934
+1	-1.828	-0.90501	-1.4637	-1.5526
+2	0.8607	0.11531	-0.022781	0.88843
+1	-0.056177	0.34978	-0.34306	0.95301
+2	0.18027	-0.22236	-0.13023	0.37608
+1	-0.78153	-0.90103	-0.38393	-1.1513
+2	3.3654	0.66848	0.81005	1.3945
+2	0.63865	0.10539	0.59781	0.77864
+1	-1.6867	-1.15	-1.4531	-2.929
+1	-0.31459	0.20842	-0.0039076	-0.12879
+2	1.9656	0.52155	1.248	1.0411
+2	1.0289	0.041926	0.86223	1.2222
+1	-0.77456	-0.70875	-0.15791	-1.1581
+1	-0.11873	-1.1701	-0.57889	-0.8843
+2	2.1834	0.98106	1.0805	0.95484
+2	1.9024	0.26676	0.7527	0.61491
+1	1.3127	-0.64765	0.19831	-1.4399
+2	2.7402	0.92209	2.2111	1.208
+2	0.20265	-0.93755	-0.26009	0.54448
+2	1.8359	1.2403	1.8468	1.6169
+1	-0.96105	-0.1313	0.14288	-0.48278
+1	-0.59027	-0.7222	-0.25191	-1.2122
+2	0.18234	-0.57013	-0.061267	-0.5438
+1	-0.2634	-1.5355	-1.1998	-2.6613
+2	-0.29711	0.86507	0.60361	1.2411
+1	-0.5736	-0.60117	-0.7424	-0.79575
+1	-0.56602	-0.91776	-1.5669	-2.1735
+2	2.645	0.9917	2.3088	1.7993
+1	-1.4458	0.17017	0.53321	0.84278
+2	0.87407	-0.22306	0.262	-0.86259
+1	-1.009	-0.42107	-0.69813	-0.48166
+1	-0.21258	0.46913	-0.76457	0.11077
+1	0.38785	0.066036	-0.48665	-0.74847
+1	0.23	0.16465	-0.57268	0.19043
+1	-2.5546	-1.2044	-2.2027	-2.9688
+1	-2.6541	-0.3031	-2.0277	-1.3027
+2	0.84669	-0.20063	0.3886	1.2227
+2	0.37173	-0.23897	0.0036995	-1.4547
+1	-1.2721	2.197	0.41411	0.68339
+2	3.1268	1.9922	2.748	3.0416
+1	-0.98514	-1.7922	-1.2233	-3.1352
+2	1.7507	0.66968	0.81377	1.9112
+2	1.4847	1.048	1.3718	1.5938
+1	-2.4761	0.56532	-0.97153	-0.91123
+2	-0.38562	-0.53609	-0.30043	-0.65398
+2	2.8441	1.0012	1.3344	2.0595
+1	-2.3575	-3.4639	-2.4231	-3.9055
+1	-1.1306	0.79272	-0.78962	-0.40706
+1	0.14086	0.78178	0.32152	0.79399
+2	2.1602	-0.28587	0.20138	0.78238
+2	2.1799	1.4137	1.6184	2.2458
+2	2.0587	1.409	1.6079	2.4053
+2	0.99457	-0.049571	1.1163	2.0792
+1	-0.33872	-1.394	-0.67782	-2.2302
+2	2.0025	0.5374	1.8476	2.205
+1	-1.2048	-1.4988	-0.90782	-1.4206
+1	-2.0306	-2.2683	-1.7667	-3.7613
+1	-0.6761	0.5275	-0.34657	0.11355
+1	-2.2032	-1.89	-2.1862	-2.3535
+2	1.7296	1.4183	2.5108	2.4607
+1	-1.7813	-0.19829	0.031868	0.014954
+2	3.6534	1.9842	2.0081	3.2753
+1	-1.396	0.60225	0.089417	0.37343
+2	1.684	0.15127	0.55563	-0.099824
+1	-0.42167	-0.30521	-0.0050244	-0.68635
+2	1.4011	0.65124	0.2796	-0.22261
+1	-1.2222	-0.71925	-1.8908	-2.0898
+2	0.40742	-0.56741	0.091717	-0.37763
+1	-3.429	-2.8956	-2.2286	-3.4496
+2	1.1085	-0.89598	1.0267	-0.4909
+1	-0.13335	-0.94952	-0.7555	-1.795
+2	1.9642	1.2407	2.0614	2.5452
+1	-0.72275	-0.11717	-0.54282	-1.9921
+1	-0.76589	-0.45987	-0.58174	-1.1552
+2	2.0381	1.4219	1.7052	1.3243
+1	-0.89424	0.17284	-1.1866	0.12735
+1	-1.4248	-1.5493	-1.5627	-2.191
+2	1.9829	-0.52149	0.50488	0.88087
+2	1.5622	-0.073205	0.87222	-0.68612
+1	-0.31189	-0.20595	-0.60619	-1.2632
+1	-2.0367	-1.6215	-2.0613	-2.6335
+2	2.2545	0.91305	1.4897	2.1731
+1	1.0419	1.142	1.8275	1.8053
+1	-0.48254	-0.45335	-1.322	-1.3973
+2	2.1017	0.74114	1.8757	1.4174
+1	-0.41796	-0.38344	-0.17813	-0.23266
+2	1.4736	0.92714	1.7223	2.7582
+1	-0.72647	-0.96407	-1.004	-1.3232
+1	-1.1821	-0.17388	-0.55234	-0.16535
+1	-0.2562	-1.4482	-1.0906	-1.9966
+1	-1.9089	-1.5948	-1.656	-2.1184
+1	-1.2012	0.30118	-0.24953	0.3965
+1	-1.8302	0.040955	-1.5321	-0.0067596
+2	1.4748	-0.47573	0.19062	-0.38082
+1	-0.87675	-0.57924	-0.90781	-1.0718
+2	1.3094	1.2355	1.6025	0.66291
+1	-0.84493	-0.85148	-1.0376	-0.35579
+1	1.1175	0.62128	-0.097245	1.1169
+1	-1.0278	-1.0166	-0.95689	-0.54272
+2	2.9534	2.2273	2.234	3.0504
+2	0.40693	0.39445	0.74964	0.49728
+1	-1.6927	-1.0992	-1.0596	-0.34052
+2	-0.87457	-0.87373	-0.044581	-0.87888
+1	-0.52145	-0.17361	-1.0992	-0.61197
+2	-0.021054	-0.81143	-0.23214	0.019331
+2	0.22445	0.4003	0.84559	1.3177
+2	1.2821	2.4797	2.3692	3.1041
+2	0.53117	-1.2217	0.28611	-0.91875
+1	-0.7679	-0.37718	-1.1674	1.1769
+2	1.7631	0.69641	1.3615	1.2907
+1	-2.051	0.058157	-1.4908	-1.6127
+2	1.4271	-0.10351	-0.26543	-1.1031
+2	1.6052	1.5874	1.159	2.1284
+2	2.6148	0.7304	1.8986	1.8219
+2	0.45098	1.2822	1.2151	1.6436
+1	-0.47995	-0.67686	-0.50447	-0.81689
+2	1.3463	0.099845	0.22575	-0.38467
+1	-0.9277	-0.60473	-0.56624	-1.0822
+2	0.36281	-0.09599	-0.052173	0.60328
+1	-1.196	1.3654	0.15181	1.0298
+2	0.73982	-1.4158	-1.1006	-1.9009
+1	0.15859	-0.035902	-0.11554	0.031789
+2	-1.1222	-0.41972	-0.75665	-0.12297
+2	0.74397	0.5198	1.1791	1.4405
+2	1.33	0.48739	-0.18437	0.062889
+1	-1.7785	-0.40637	-0.97335	-1.7407
+2	2.21	1.2506	2.1236	2.544
+1	-0.0184	0.2246	0.14729	0.19402
+1	-3.2628	-2.9787	-2.8634	-3.6482
+2	-0.1392	-0.34778	-0.88344	-0.53681
+2	0.076896	-1.8429	-1.7447	-1.2394
+2	1.4885	0.19618	1.4064	0.26418
+1	-0.38574	1.1131	-0.28387	-0.062115
+2	0.55504	0.49115	0.78076	1.4226
+1	-1.7518	-1.8202	-1.2481	-2.3751
+2	3.6806	1.2174	2.2183	1.4501
+1	-2.1189	-1.9377	-1.6646	-3.3068
+2	0.40033	0.54181	0.5947	0.58072
+1	-1.7397	-0.66287	-0.68746	-0.096024
+1	-0.50364	0.40851	0.30851	-0.17237
+2	0.44425	0.75742	0.4505	-0.78196
+1	-0.95328	-1.4505	0.020384	-0.43303
+2	0.46568	-0.028847	0.15037	0.5137
+2	1.5549	-0.63541	0.3954	-0.8684
+1	-1.4867	0.33942	-0.38445	-0.041492
+2	1.7193	0.47366	1.145	0.23226
+1	0.080651	0.023382	-0.041247	-0.82666
+1	-2.1069	-1.1404	-1.0549	-2.3807
+2	3.2157	0.33731	1.2985	0.71006
+1	-0.74487	1.14	-0.87596	0.068296
+2	0.5656	-0.049493	0.63	0.61696
+1	0.92164	-0.4566	0.65674	0.031943
+2	0.36798	0.017518	0.38805	0.53672
+2	1.0935	0.48676	0.83957	0.81814
+2	2.8726	2.7892	2.4059	4.9329
+1	-0.30789	0.43253	0.11799	1.095
+1	-0.88528	-1.1828	-0.8044	-0.85393
+1	-3.1197	-1.5592	-2.1209	-2.309
+2	-0.50383	-1.2601	-1.2767	-1.6618
+2	1.8793	2.1516	2.1742	2.8387
+2	0.53935	0.24623	0.69241	-0.010176
+1	-1.348	-0.22259	-0.40572	0.11176
+1	-1.576	-0.50134	-1.5699	0.070888
+1	-0.80873	-0.59262	-0.25483	-0.97248
+2	3.7789	0.59278	2.3224	1.2169
+2	2.2607	1.8088	2.2184	2.3414
+1	-1.4636	-1.4547	-0.92385	-2.0514
+1	0.049658	-1.0861	-0.97609	-1.4805
+2	-0.37917	-1.3983	-1.4913	-1.5386
+1	-1.038	0.39015	-0.60643	0.29969
+2	3.0029	-0.56574	0.93819	0.41397
+1	-0.55312	0.33141	0.18418	-0.58313
+1	-1.8829	-1.0672	-1.2348	-1.7643
+1	-3.2899	-2.6167	-2.6369	-2.7652
+2	2.6912	0.86111	1.9481	1.9289
+2	0.90592	-0.17146	0.59905	-0.32254
+1	-0.015986	0.56296	0.22567	0.50046
+1	-1.2915	0.27356	0.014082	0.53515
+2	0.86451	0.028483	0.74312	0.032785
+2	1.5293	0.45844	1.8271	1.9607
+1	-1.7485	-1.0948	-0.81939	-1.3227
+2	-0.083073	-1.9435	-1.416	-2.3622
+2	3.3754	1.9356	2.3905	3.3874
+2	1.0355	-0.51503	-0.61825	-1.0265
+1	-1.0565	-0.069375	-0.38404	0.76998
+1	-1.1237	-0.99145	-1.4551	-0.3469
+2	1.7352	0.22687	0.42981	-0.57465
+1	-2.1116	-0.6192	-0.85621	-1.5754
+2	0.077448	0.044283	0.22217	-0.46803
+2	1.6582	0.25206	0.75089	2.0777
+1	1.5023	-1.4421	0.36925	-1.3094
+2	1.5735	-0.37483	0.92607	0.66991
+2	1.8589	0.96079	1.4626	2.6634
+1	-0.69936	-1.3318	-0.19963	-1.0137
+1	0.32938	1.7601	1.2466	2.176
+1	-0.89472	0.30315	-0.016251	0.51713
+2	0.12156	-1.4913	-0.70336	-0.91095
+2	0.60273	-0.42001	-0.10023	-0.6748
+2	3.5656	1.3951	2.7444	2.8842
+1	1.7782	1.4232	0.6032	3.5048
+1	-0.57807	0.73551	0.75694	1.037
+2	0.21019	-0.39931	0.58809	-0.4973
+2	0.93599	1.3913	1.8648	1.7568
+2	1.9104	0.80965	0.4027	0.24317
+1	0.33224	-0.51752	1.1244	0.48382
+1	-0.26037	0.1481	-0.5792	-0.3214
+1	-0.87353	-1.3533	-0.43213	-0.42417
+2	1.7409	0.56938	0.99576	0.89716
+1	-2.5791	-0.079763	-1.7127	-0.63871
+2	2.7148	2.0641	2.5514	4.0436
+1	-1.4134	-0.19435	-0.15077	0.60547
+2	1.7548	0.081749	0.54813	0.96427
+1	0.10288	1.8213	0.88012	1.1502
+2	1.4314	-0.36776	1.0119	0.72045
+2	1.2714	-0.013532	0.88042	-0.065303
+1	-1.5945	-0.46271	-1.5631	-1.3127
+2	0.95562	0.32816	0.69476	1.2058
+2	2.7251	1.0995	1.9791	1.6754
+2	3.0741	1.2894	2.0428	2.7797
+2	1.1387	0.086177	0.13431	0.15097
+2	2.2914	1.4238	1.8326	1.452
+2	1.6861	-0.26067	0.085743	0.10703
+1	-0.49648	0.8651	0.16132	1.2287
+2	2.692	1.6258	2.0722	1.5768
+2	0.35736	-0.41045	-0.064344	-1.1639
+1	0.56768	0.87048	0.48066	1.3185
+1	-1.4305	-0.059767	0.65175	0.20121
+1	0.12948	-0.27649	-0.71256	-0.93355
+2	1.4175	0.40298	0.62103	0.38596
+2	1.9966	0.92929	1.4075	2.4664
+1	-2.1459	-1.7047	-1.5666	-1.9704
+2	0.63235	-0.31907	0.39015	-0.094609
+2	2.2081	1.43	2.3977	3.1491
+1	-0.61433	-1.6535	-0.62255	-1.1695
+2	-0.054849	-0.22619	-0.15443	0.80091
+2	1.4147	0.38626	1.6316	0.47058
+1	-0.86504	0.14484	-0.64224	0.0082434
+2	3.3653	1.8557	2.0853	3.4931
+2	2.2935	1.9842	3.3837	3.9431
+1	-0.46349	-1.8676	-0.25935	-1.384
+2	1.986	1.1631	1.8748	2.8603
+2	0.97497	0.28825	0.24785	1.285
+1	-1.5869	0.014074	-0.43179	0.47159
+2	1.4753	0.54993	1.3186	0.45672
+1	0.032798	0.36038	-0.17131	0.38497
+2	-0.44677	-0.80787	0.028976	0.37316
+2	1.0972	-0.28951	0.65841	-0.64075
+2	-0.76611	0.55213	0.20033	-0.03155
+2	0.7553	-0.39724	0.7762	0.84015
+1	-1.3907	0.93813	0.87454	1.4003
+2	1.6042	-0.32578	0.26563	-0.33416
+2	0.0011286	0.33084	1.2848	1.0439
+2	1.5178	-0.38575	0.17469	-0.30238
+2	1.5933	1.3498	1.2703	1.9845
+2	1.1296	0.58348	1.167	1.0504
+1	-0.23314	1.082	0.6528	0.81685
+2	2.9547	2.4742	2.4752	3.1153
+2	0.58213	0.12754	0.025728	-0.058504
+2	1.1949	1.817	2.0622	1.4037
+2	2.2411	0.8552	1.6038	1.0049
+1	-2.5176	-1.0052	-1.0198	-0.48341
+1	-1.8805	-1.3895	-1.8934	-2.3298
+2	0.026187	-1.0276	0.3109	-0.56926
+1	-2.0429	-1.3081	-0.57127	-2.0782
+2	1.1618	0.50882	-0.20697	0.013231
+1	-0.47612	-0.9931	-1.3226	-0.98672
+1	-1.2763	0.41926	-0.14847	0.91577
+1	-0.55364	-0.93098	-1.0248	-2.0666
+1	-0.4339	-0.25192	-0.73885	0.073947
+1	-1.5453	-0.6545	-0.21517	-1.3672
+2	2.6639	1.6327	2.0072	2.554
+2	0.88943	0.57601	-0.3015	0.74417
+2	1.0271	1.2264	1.7475	0.67207
+1	-0.83604	0.42271	0.040673	0.80654
+1	-1.3054	-0.67361	-0.91976	-2.2619
+2	1.077	0.36815	0.93526	1.3126
+2	1.9659	-0.1728	0.32075	0.54531
+2	3.4634	1.8385	2.4279	3.2285
+1	-1.4032	-1.4314	-0.89679	-1.154
+2	1.9036	0.38846	0.05761	1.0422
+1	-0.68719	0.80821	-0.15658	-0.62623
+1	-2.092	-1.302	-1.3887	-2.2708
+1	-3.0231	-1.2392	-1.4976	-1.3607
+1	-1.7643	-0.3896	-0.42846	-0.75791
+2	1.5574	1.5723	1.0907	2.0144
+2	1.9495	0.8587	1.1411	1.1627
+2	0.64003	-0.77478	-0.39283	-0.0099916
+2	1.3391	0.1672	0.63395	0.41181
+2	0.41884	-0.14637	0.26969	0.82956
+2	0.80367	0.14447	-0.10291	-0.287
+1	-0.63094	0.18687	-0.27602	0.27575
+2	3.0052	1.2428	1.5281	1.2243
+1	-1.208	-0.052875	-0.25162	-0.60352
+2	-0.013434	0.6821	0.21045	1.2654
+1	0.066436	0.26358	0.068284	0.22081
+2	0.74043	-0.62892	-0.053397	0.047075
+2	0.01624	-0.78913	-0.2106	-1.804
+1	-0.92733	0.22995	-0.80286	1.3801
+1	-2.7373	-1.9684	-1.1444	-1.8
+2	0.4016	-0.5569	-0.61626	-0.86638
+2	1.3313	0.1115	1.0784	-0.3657
+1	-1.5426	-0.64278	-0.82557	-0.24553
+2	-0.17113	0.20989	0.049778	0.14976
+2	1.1498	0.93007	1.927	1.9457
+1	0.44309	0.26164	0.15551	-0.033813
+2	2.4557	0.73092	1.0348	0.74128
+2	1.2194	-0.35204	0.606	-0.43078
+1	0.31738	-0.16719	0.40172	0.76466
+2	0.8312	0.97519	1.447	1.6576
+1	0.68482	-0.47105	-0.44196	-1.6032
+2	0.86476	-0.60894	-0.70426	-0.46443
+2	0.61242	-0.19328	0.33885	0.7601
+2	0.81747	0.12697	0.76843	0.73746
+1	-0.6702	0.031673	-0.68398	-0.5238
+1	-0.63522	-0.93868	0.50393	0.10229
+1	-2.5259	-1.0264	-1.1855	-1.9957
+2	0.77302	-0.5916	0.44419	0.014831
+1	-0.62945	1.0176	0.82793	0.63908
+1	-0.86403	0.76611	0.14394	0.43542
+2	0.50604	0.58551	0.21427	1.0034
+2	-0.40606	-0.34577	-0.40185	-0.61186
+1	-3.1861	-0.77597	-1.1617	-1.8329
+2	0.34588	0.068959	0.30321	0.76889
+1	-0.94907	-1.2576	-1.5157	-1.1779
+1	-0.53314	-0.83648	0.090435	0.56704
+2	2.255	0.88421	1.707	2.6335
+2	0.8637	0.55861	0.94463	0.9639
+1	-2.7845	-0.18064	-1.0746	0.99446
+1	-0.24873	0.76049	0.26843	1.5167
+2	0.11146	0.35634	-0.24447	-0.97159
+2	3.2303	1.7377	2.5182	2.4327
+1	-1.0498	-1.624	-1.42	-3.435
+1	-1.1608	-1.2389	-1.8164	-1.726
+1	-2.9043	1.0074	-1.0969	-0.0682
+2	1.1324	0.21432	0.54189	0.15421
+2	3.8317	1.5187	2.458	2.1317
+2	2.0655	1.5893	1.9248	3.0454
+1	-0.44455	0.35221	1.6454	1.8029
+1	-1.3991	-0.54894	0.55414	0.35949
+2	-0.49564	-1.1614	-0.48362	-0.73735
+2	0.3003	1.1159	1.0502	1.0648
+2	2.1461	0.96161	2.1506	1.531
+1	-1.1484	-1.2411	-1.0381	-1.1269
+1	-0.70906	0.11049	-0.27275	-0.55964
+2	2.2877	2.2862	2.1313	2.6027
+1	-1.8594	-0.64184	-1.1552	-0.63442
+2	1.9532	1.9075	1.8567	3.8481
+1	0.37771	-0.63126	-0.85427	-0.53335
+2	0.98581	0.59491	1.4425	1.9929
+1	-0.25628	1.5669	0.7286	2.3314
+1	-1.9161	-2.1064	-1.9792	-3.209
+2	1.4204	0.62872	0.51499	0.21648
+1	-1.3459	-0.51532	-0.93122	-0.72578
+1	-0.054858	0.041397	-0.61347	-0.034157
+1	-1.4906	-0.72287	-1.1269	-1.7365
+1	-0.088146	-1.8362	-0.24614	-1.2446
+2	0.77185	0.97014	1.3422	1.5292
+1	-2.5133	-1.8502	-1.2924	-1.9175
+2	0.26583	0.77748	0.89065	1.1444
+1	0.16672	-0.15405	0.089319	0.59477
+2	1.6727	1.3054	2.3544	3.2492
+2	2.0506	0.92409	1.3741	0.79866
+2	0.67307	-0.69943	-0.67926	-1.8186
+1	-1.7004	-3.2806	-1.8577	-3.5456
+2	2.328	0.74119	1.0011	-0.11293
+2	1.2604	0.73779	1.6924	1.7521
+1	-2.2288	-1.3683	-1.7765	-1.5974
+2	0.88269	0.46839	-0.27199	-0.1524
+1	-1.9886	-0.73595	-1.4506	-1.408
+2	-1.4869	-0.2289	-0.5663	-2.0807
+2	0.014777	-1.0052	0.16268	-0.48156
+1	-1.0203	-0.10211	0.087625	-1.1098
+2	0.19942	-0.090896	-0.057038	-0.69817
+2	0.049687	-0.42191	0.14803	-0.32168
+2	1.1233	0.84872	0.59768	1.9205
+1	-0.029631	0.029696	-1.4186	-0.39548
+2	1.6432	2.0013	1.9999	3.0139
+2	0.15109	1.1324	0.89689	-0.1229
+2	3.4367	0.93618	2.4521	1.7229
+1	-1.9473	-1.0037	-1.435	-2.2126
+2	-1.9611	-2.2472	-1.296	-2.3762
+2	1.4403	0.62477	1.5212	1.2814
+2	0.19632	0.17619	0.488	0.38575
+1	-0.45147	0.79693	0.15328	-0.26972
+2	2.1905	1.3618	1.6805	1.2152
+2	2.5707	-0.36075	1.0698	0.38569
+1	-1.134	-0.55325	-0.17572	-1.0232
+2	0.23258	0.9795	1.3777	0.26495
+1	-1.9011	-0.92872	-1.2233	-2.1998
+1	-0.57857	0.47029	-0.06201	-0.34515
+1	-1.949	-2.6597	-1.5144	-3.0038
+2	0.76334	-0.064474	-0.25394	-0.34794
+2	0.060827	0.52259	0.76325	0.93484
+1	-0.88464	0.89037	0.68007	0.50459
+2	0.75303	1.0031	1.3853	1.7313
+2	1.6174	0.6954	1.3692	0.19298
+2	-0.25913	-0.14026	1.1774	0.39386
+2	-0.36996	-1.7796	-1.2709	-2.5775
+2	1.1327	0.41557	1.9905	1.839
+1	-0.62597	0.53878	-0.71974	-0.65395
+2	1.2265	0.22326	1.3888	0.17221
+1	-3.6161	-0.12667	-1.1336	-0.67
+2	1.7509	1.0183	1.5883	2.2784
+1	-3.1148	-2.0415	-2.2483	-2.8307
+2	2.164	-1.1513	-0.08575	-0.62876
+1	0.039445	0.1961	0.075096	1.9551
+2	1.8371	-0.96925	0.12921	-1.2741
+1	0.55236	0.34137	0.086468	1.4716
+1	-0.7032	-0.20756	-0.74846	0.65256
+2	1.0002	1.1736	1.0214	1.258
+2	1.2194	0.48081	1.3275	0.54443
+2	0.90395	-0.45146	0.38298	0.64902
+1	-1.7689	0.75519	-1.0627	-0.35778
+1	-0.66361	-1.4308	-1.0998	-1.0094
+1	0.59444	-0.097019	0.18029	-9.04E-07
+2	0.98727	1.3769	2.4872	3.2855
+2	3.119	0.79201	0.76361	0.88459
+2	3.966	2.5125	2.4776	4.6119
+1	-0.42323	0.57129	-0.93689	-0.20516
+1	-0.99354	-0.91517	-0.25445	-1.3515
+1	-0.8997	0.17456	-0.98904	-0.49643
+1	-2.0882	-2.2724	-1.6869	-3.8034
+2	0.058963	-1.8188	-0.57721	-2.4386
+2	0.6644	-0.19227	0.038901	-0.85065
+1	-1.4081	-1.5517	-0.57182	-0.9874
+2	0.6261	-0.47999	0.49667	0.27351
+2	2.0659	0.45041	0.48469	0.55808
+1	-1.2712	-1.1302	-1.255	-2.7206
+1	-1.0078	-0.60672	-1.1008	-2.6889
+1	-1.0463	-1.0508	-0.99612	-1.555
+2	1.7391	0.14434	0.97791	1.2498
+2	1.8919	0.21333	1.6686	1.219
+2	-0.10481	-0.35461	-0.64694	-1.3312
+1	-1.6584	-2.0611	-2.1245	-3.6067
+2	0.45667	-0.3534	0.45962	-0.39991
+1	-1.3292	-0.37564	-0.63085	-1.2641
+1	-0.17139	0.30023	-0.20283	0.041852
+2	1.0493	0.25089	1.0204	1.8084
+1	-0.84288	-0.44041	-1.1143	-0.59224
+2	0.88897	-0.11392	0.5681	-0.054604
+1	-1.9512	0.41829	-1.042	-0.0042274
+2	3.1253	1.4863	2.9227	3.0012
+1	-0.92268	-0.60588	-1.1196	-1.4647
+1	-0.35425	-0.10497	-0.74629	-1.8353
+1	-1.4657	-1.2499	-0.83335	-2.4047
+1	-1.0475	-0.51414	-1.4602	-0.54649
+1	-0.59471	0.56956	0.79545	0.86494
+1	-2.2114	-0.64964	-0.78543	-1.9412
+2	1.3807	1.0044	0.56431	1.2968
+1	-1.7252	-1.1924	-0.69401	-0.72828
+2	1.4303	0.15739	1.0449	0.3742
+2	1.5814	0.49582	1.4353	1.1652
diff --git a/sourcecodes/example_datasets/spleen_chr2_example_data.txt b/sourcecodes/example_datasets/spleen_chr2_example_data.txt
new file mode 100644
index 00000000..4b164198
--- /dev/null
+++ b/sourcecodes/example_datasets/spleen_chr2_example_data.txt
@@ -0,0 +1,74 @@
+rs3664317	Oas1a	Parp9	Dhx58	Cd1d1	Irf7	Oas3	Pml	Mx1	Ifit1	Trim25	Oas1g	Pglyrp3	Ifih1
+1	8.34	9.812	8.774	9.79	9.663	8.27	11.036	7.284	8.286	10.395	8.521	6.186	8.83
+1	8.368	9.738	8.566	9.144	9.484	8.818	11.03	6.977	8.294	10.076	8.529	5.968	8.828
+1	8.178	9.57	8.726	9.575	10.106	8.99	10.878	7.205	8.676	10.036	8.61	5.976	9.024
+1	8.116	9.901	8.904	9.959	9.793	8.336	11.105	7.598	8.316	10.292	8.401	5.814	8.836
+2	8.099	9.68	8.876	10.116	9.771	8.379	11.028	7.438	8.541	10.215	8.32	5.917	9.073
+1	8.262	9.59	8.24	10.088	8.938	7.832	10.486	6.752	7.825	9.908	8.196	6.15	8.446
+1	7.915	9.415	8.308	9.707	9.12	8.702	11.102	7.208	8.243	10.034	7.897	6.06	8.892
+2	8.565	10.002	8.96	9.779	10.322	9.24	11.278	7.644	8.893	10.42	8.773	5.914	9.407
+1	8.189	9.774	8.541	9.939	9.134	7.819	10.766	7.122	8.352	10.113	8.492	6.269	9.055
+1	8.476	9.954	8.908	9.476	9.92	8.764	11.134	7.859	8.788	10.17	8.862	6.226	9.17
+2	8.119	9.946	8.876	9.578	10.02	8.734	11.244	7.85	8.838	10.557	8.56	5.98	9.353
+2	8.305	9.713	8.972	9.789	9.839	8.804	10.948	7.682	8.896	10.181	8.854	5.979	9.567
+2	8.654	10	9.306	9.439	10.457	9.223	10.922	7.082	8.942	10.131	9.162	6.01	9.74
+1	8.105	9.748	8.725	10.119	9.782	8.575	11.113	7.63	8.674	10.355	8.59	6.279	8.908
+1	8.247	9.715	8.829	9.646	9.953	9.668	11.112	7.384	9.221	10.19	8.64	6	9.552
+1	8.511	9.994	9.014	9.89	10.266	8.444	10.599	7.331	9.153	10.012	8.837	6.148	9.023
+2	8.947	10.28	9.483	9.398	11.23	9.86	11.324	8.006	9.772	10.524	9.587	5.865	10.067
+1	8.526	9.685	8.921	9.7	10.126	9.373	11.121	7.497	9.003	10.357	8.156	6.334	9.678
+2	8.06	9.745	9.092	9.278	10.231	8.976	10.998	7.578	9.145	10.283	8.611	6.168	9.413
+2	7.93	9.728	8.694	9.512	9.826	9.016	11.276	7.604	8.767	10.378	8.577	5.963	9.264
+2	8.511	9.686	9.014	8.982	10.508	10.108	11.304	7.441	9.133	10.341	9.04	6.2	9.974
+2	8.645	9.997	8.97	9.443	10.393	9.302	11.409	7.785	8.894	10.552	9.051	5.997	9.412
+2	8.293	9.802	9.001	9.524	10.156	9.263	11.212	7.772	8.581	10.433	8.514	6.093	9.177
+1	7.781	9.712	8.97	9.375	10.12	9.484	11.317	7.347	8.972	10.393	8.352	6.193	9.587
+2	8.465	9.88	8.913	9.816	9.965	8.852	11.138	7.537	8.625	10.426	8.617	6.044	9.556
+2	8.657	10.026	9.189	9.691	10.302	9.268	11.194	7.634	9.143	10.378	9.05	6.067	9.679
+2	7.634	9.606	8.36	9.465	8.41	8.605	11.183	6.942	8.174	9.952	7.478	6.09	9.535
+1	7.669	9.494	8.779	9.552	9.362	8.52	11.024	7.131	8.378	10.391	8.114	6.07	8.851
+2	8.618	10.212	9.433	9.672	10.442	9.21	11.328	8.045	9.322	10.5	9.128	5.994	9.656
+2	8.731	10.27	9.342	9.43	10.697	10.117	11.286	7.749	9.734	10.464	9.322	6.156	9.876
+1	7.554	9.524	8.759	9.93	9.52	8.279	10.82	7.32	8.316	10.31	8.186	6.068	9.046
+1	8.262	9.677	8.75	9.444	10.052	8.634	10.888	7.32	8.562	9.893	8.644	6.212	8.918
+1	7.823	9.628	8.66	9.529	9.578	8.736	11.206	7.171	8.408	10.062	8.111	5.838	9.033
+1	8.28	9.572	8.784	9.428	9.862	9.424	11.27	7.288	8.505	10.174	8.642	6.022	9.313
+2	9.09	10.053	9.599	9.469	11.004	9.882	11.436	8.521	9.814	10.562	9.704	6.044	10.061
+1	8.446	9.989	9.297	9.688	10.577	9.129	11.102	7.718	9.484	10.231	9.072	6.17	9.21
+1	8.668	9.858	9.195	9.385	10.695	9.249	11.028	7.765	9.367	10.319	9.179	6.136	9.563
+2	8.574	10.059	9.281	9.233	10.508	9.247	11.145	8.138	9.505	10.402	9.192	5.992	9.848
+2	8.523	10.052	9.131	9.507	10.418	9.413	11.187	7.641	9.304	10.465	9.063	6.095	9.733
+1	7.987	9.748	8.766	9.578	9.781	8.482	11.279	7.52	8.364	10.141	8.207	6.192	9.133
+2	8.466	9.429	8.946	9.395	9.715	9.071	11.388	7.592	8.078	10.32	8.326	6.108	9.021
+1	7.668	9.694	8.493	10.112	9.561	8.394	10.922	7.26	8.19	10.27	7.916	5.892	8.974
+2	8.379	10.037	9.155	9.683	10.281	9.2	10.913	7.173	9.404	10.381	9.097	6.099	9.714
+2	7.805	9.654	8.454	9.198	10.065	9.468	11.217	6.917	8.43	10.459	8.11	6.068	9.068
+1	7.981	9.8	8.553	9.946	9.862	8.901	11.085	7.214	8.393	10.373	8.19	6.05	9.015
+1	7.746	9.688	8.578	9.901	9.358	7.866	10.928	7.354	7.929	10.233	8.066	5.754	8.883
+1	7.997	9.859	8.795	9.867	9.817	8.734	11.109	7.416	8.67	10.247	8.176	6.143	9.081
+1	8.674	9.689	9.06	9.81	10.544	8.995	11.189	7.781	9.219	10.07	8.98	5.992	9.143
+1	8.088	9.49	8.676	9.456	10.184	8.737	10.998	7.222	8.538	10.192	8.441	6.147	8.55
+1	8.001	9.801	8.669	9.977	9.383	8.274	11.055	7.231	7.913	10.272	8.277	5.931	9.009
+2	8.218	9.458	8.781	9.214	9.66	8.87	10.738	7.241	8.289	10.029	8.612	6.125	9.38
+1	7.684	9.56	8.75	10.077	9.686	8.27	11.102	7.206	8.13	10.212	8.07	6.018	8.984
+2	8.326	9.696	8.88	9.714	10.014	9.08	11.055	7.256	8.494	10.054	8.63	6.177	9.162
+2	8.906	10.106	9.412	9.704	11.06	9.854	11.335	7.799	10.103	10.471	9.25	6.033	9.97
+1	8.073	9.793	8.626	9.879	9.262	8.408	10.844	7.108	8.368	9.959	8.261	6.052	8.916
+2	8.527	10.026	9.143	9.244	10.597	9.566	11.108	7.778	9.748	10.351	9.153	6.055	9.698
+2	8.614	10.05	9.202	9.508	10.66	9.63	11.156	7.758	9.789	10.324	9.068	6.15	9.948
+2	8.522	10.158	8.992	9.684	9.992	8.55	11.125	7.914	8.976	10.311	8.574	5.889	9.566
+1	8.086	9.6	8.522	9.544	9.641	8.514	10.99	7.386	8.506	10.194	8.234	6.02	8.736
+1	7.873	9.596	8.452	9.422	9.278	8.509	10.958	7.057	8.081	9.981	7.969	6.136	8.958
+2	8.371	9.99	8.949	9.931	10.195	8.935	10.83	7.694	9.183	10.493	9.124	6.128	9.396
+2	8.476	9.982	9.115	9.639	10.465	9.833	11.105	8.058	9.9	10.351	9.182	6.05	9.884
+1	8.512	9.995	8.846	9.951	9.561	8.558	10.769	7.584	8.901	10.139	8.769	5.959	9.203
+1	8.358	9.858	8.99	9.981	10.123	9.368	10.989	7.463	9.327	9.93	8.54	6.02	9.543
+1	8.23	9.614	8.806	9.919	9.939	9.108	11.184	7.766	8.793	10.174	8.605	5.972	9.068
+2	8.238	9.802	8.926	9.595	10.062	8.77	11.202	7.712	9.131	10.34	8.57	6.05	9.464
+1	8.533	10.108	9.083	10.214	10.514	8.463	11.008	7.356	9.344	10.196	8.736	6.262	9.257
+1	7.866	9.444	8.223	9.865	8.95	8.539	10.935	6.754	7.748	10.177	7.826	6.29	8.716
+2	8.888	10.031	9.158	9.407	10.8	9.547	11.238	7.659	9.602	10.398	9.337	6.028	9.529
+1	8.026	9.682	8.398	9.824	9.202	8.041	10.703	7.322	8.352	10.209	8.196	6.009	9.001
+2	8.974	10.071	9.451	9.348	11.061	9.686	11.255	8.077	10.101	10.323	9.557	6.006	10.072
+1	8.181	9.432	9.045	9.544	10.651	9.18	10.832	7.419	8.742	9.818	8.546	6.33	9.201
+1	8.137	9.676	9.024	9.37	10.206	9.944	10.985	7.226	8.9	10.362	8.918	6.352	9.367
diff --git a/sourcecodes/example_datasets/spleen_chr2_example_data.txt~ b/sourcecodes/example_datasets/spleen_chr2_example_data.txt~
new file mode 100644
index 00000000..ca8ea1e5
--- /dev/null
+++ b/sourcecodes/example_datasets/spleen_chr2_example_data.txt~
@@ -0,0 +1,76 @@
+rs3664317	Oas1a	Parp9	Dhx58	Cd1d1	Irf7	Oas3	Pml	Mx1	Ifit1	Trim25	Oas1g	Pglyrp3	Ifih1
+2	1	1	1	1	1	1	1	1	1	1	1	1	1
+1	8.34	9.812	8.774	9.79	9.663	8.27	11.036	7.284	8.286	10.395	8.521	6.186	8.83
+1	8.368	9.738	8.566	9.144	9.484	8.818	11.03	6.977	8.294	10.076	8.529	5.968	8.828
+1	8.178	9.57	8.726	9.575	10.106	8.99	10.878	7.205	8.676	10.036	8.61	5.976	9.024
+1	8.116	9.901	8.904	9.959	9.793	8.336	11.105	7.598	8.316	10.292	8.401	5.814	8.836
+2	8.099	9.68	8.876	10.116	9.771	8.379	11.028	7.438	8.541	10.215	8.32	5.917	9.073
+1	8.262	9.59	8.24	10.088	8.938	7.832	10.486	6.752	7.825	9.908	8.196	6.15	8.446
+1	7.915	9.415	8.308	9.707	9.12	8.702	11.102	7.208	8.243	10.034	7.897	6.06	8.892
+2	8.565	10.002	8.96	9.779	10.322	9.24	11.278	7.644	8.893	10.42	8.773	5.914	9.407
+1	8.189	9.774	8.541	9.939	9.134	7.819	10.766	7.122	8.352	10.113	8.492	6.269	9.055
+1	8.476	9.954	8.908	9.476	9.92	8.764	11.134	7.859	8.788	10.17	8.862	6.226	9.17
+2	8.119	9.946	8.876	9.578	10.02	8.734	11.244	7.85	8.838	10.557	8.56	5.98	9.353
+2	8.305	9.713	8.972	9.789	9.839	8.804	10.948	7.682	8.896	10.181	8.854	5.979	9.567
+2	8.654	10	9.306	9.439	10.457	9.223	10.922	7.082	8.942	10.131	9.162	6.01	9.74
+1	8.105	9.748	8.725	10.119	9.782	8.575	11.113	7.63	8.674	10.355	8.59	6.279	8.908
+1	8.247	9.715	8.829	9.646	9.953	9.668	11.112	7.384	9.221	10.19	8.64	6	9.552
+1	8.511	9.994	9.014	9.89	10.266	8.444	10.599	7.331	9.153	10.012	8.837	6.148	9.023
+2	8.947	10.28	9.483	9.398	11.23	9.86	11.324	8.006	9.772	10.524	9.587	5.865	10.067
+1	8.526	9.685	8.921	9.7	10.126	9.373	11.121	7.497	9.003	10.357	8.156	6.334	9.678
+2	8.06	9.745	9.092	9.278	10.231	8.976	10.998	7.578	9.145	10.283	8.611	6.168	9.413
+2	7.93	9.728	8.694	9.512	9.826	9.016	11.276	7.604	8.767	10.378	8.577	5.963	9.264
+2	8.511	9.686	9.014	8.982	10.508	10.108	11.304	7.441	9.133	10.341	9.04	6.2	9.974
+2	8.645	9.997	8.97	9.443	10.393	9.302	11.409	7.785	8.894	10.552	9.051	5.997	9.412
+2	8.293	9.802	9.001	9.524	10.156	9.263	11.212	7.772	8.581	10.433	8.514	6.093	9.177
+1	7.781	9.712	8.97	9.375	10.12	9.484	11.317	7.347	8.972	10.393	8.352	6.193	9.587
+2	8.465	9.88	8.913	9.816	9.965	8.852	11.138	7.537	8.625	10.426	8.617	6.044	9.556
+2	8.657	10.026	9.189	9.691	10.302	9.268	11.194	7.634	9.143	10.378	9.05	6.067	9.679
+2	7.634	9.606	8.36	9.465	8.41	8.605	11.183	6.942	8.174	9.952	7.478	6.09	9.535
+1	7.669	9.494	8.779	9.552	9.362	8.52	11.024	7.131	8.378	10.391	8.114	6.07	8.851
+2	8.618	10.212	9.433	9.672	10.442	9.21	11.328	8.045	9.322	10.5	9.128	5.994	9.656
+2	8.731	10.27	9.342	9.43	10.697	10.117	11.286	7.749	9.734	10.464	9.322	6.156	9.876
+1	7.554	9.524	8.759	9.93	9.52	8.279	10.82	7.32	8.316	10.31	8.186	6.068	9.046
+1	8.262	9.677	8.75	9.444	10.052	8.634	10.888	7.32	8.562	9.893	8.644	6.212	8.918
+1	7.823	9.628	8.66	9.529	9.578	8.736	11.206	7.171	8.408	10.062	8.111	5.838	9.033
+1	8.28	9.572	8.784	9.428	9.862	9.424	11.27	7.288	8.505	10.174	8.642	6.022	9.313
+2	9.09	10.053	9.599	9.469	11.004	9.882	11.436	8.521	9.814	10.562	9.704	6.044	10.061
+1	8.446	9.989	9.297	9.688	10.577	9.129	11.102	7.718	9.484	10.231	9.072	6.17	9.21
+1	8.668	9.858	9.195	9.385	10.695	9.249	11.028	7.765	9.367	10.319	9.179	6.136	9.563
+2	8.574	10.059	9.281	9.233	10.508	9.247	11.145	8.138	9.505	10.402	9.192	5.992	9.848
+2	8.523	10.052	9.131	9.507	10.418	9.413	11.187	7.641	9.304	10.465	9.063	6.095	9.733
+1	7.987	9.748	8.766	9.578	9.781	8.482	11.279	7.52	8.364	10.141	8.207	6.192	9.133
+2	8.466	9.429	8.946	9.395	9.715	9.071	11.388	7.592	8.078	10.32	8.326	6.108	9.021
+1	7.668	9.694	8.493	10.112	9.561	8.394	10.922	7.26	8.19	10.27	7.916	5.892	8.974
+2	8.379	10.037	9.155	9.683	10.281	9.2	10.913	7.173	9.404	10.381	9.097	6.099	9.714
+2	7.805	9.654	8.454	9.198	10.065	9.468	11.217	6.917	8.43	10.459	8.11	6.068	9.068
+1	7.981	9.8	8.553	9.946	9.862	8.901	11.085	7.214	8.393	10.373	8.19	6.05	9.015
+1	7.746	9.688	8.578	9.901	9.358	7.866	10.928	7.354	7.929	10.233	8.066	5.754	8.883
+1	7.997	9.859	8.795	9.867	9.817	8.734	11.109	7.416	8.67	10.247	8.176	6.143	9.081
+1	8.674	9.689	9.06	9.81	10.544	8.995	11.189	7.781	9.219	10.07	8.98	5.992	9.143
+1	8.088	9.49	8.676	9.456	10.184	8.737	10.998	7.222	8.538	10.192	8.441	6.147	8.55
+1	8.001	9.801	8.669	9.977	9.383	8.274	11.055	7.231	7.913	10.272	8.277	5.931	9.009
+2	8.218	9.458	8.781	9.214	9.66	8.87	10.738	7.241	8.289	10.029	8.612	6.125	9.38
+1	7.684	9.56	8.75	10.077	9.686	8.27	11.102	7.206	8.13	10.212	8.07	6.018	8.984
+2	8.326	9.696	8.88	9.714	10.014	9.08	11.055	7.256	8.494	10.054	8.63	6.177	9.162
+2	8.906	10.106	9.412	9.704	11.06	9.854	11.335	7.799	10.103	10.471	9.25	6.033	9.97
+1	8.073	9.793	8.626	9.879	9.262	8.408	10.844	7.108	8.368	9.959	8.261	6.052	8.916
+2	8.527	10.026	9.143	9.244	10.597	9.566	11.108	7.778	9.748	10.351	9.153	6.055	9.698
+2	8.614	10.05	9.202	9.508	10.66	9.63	11.156	7.758	9.789	10.324	9.068	6.15	9.948
+2	8.522	10.158	8.992	9.684	9.992	8.55	11.125	7.914	8.976	10.311	8.574	5.889	9.566
+1	8.086	9.6	8.522	9.544	9.641	8.514	10.99	7.386	8.506	10.194	8.234	6.02	8.736
+1	7.873	9.596	8.452	9.422	9.278	8.509	10.958	7.057	8.081	9.981	7.969	6.136	8.958
+2	8.371	9.99	8.949	9.931	10.195	8.935	10.83	7.694	9.183	10.493	9.124	6.128	9.396
+2	8.476	9.982	9.115	9.639	10.465	9.833	11.105	8.058	9.9	10.351	9.182	6.05	9.884
+1	8.512	9.995	8.846	9.951	9.561	8.558	10.769	7.584	8.901	10.139	8.769	5.959	9.203
+1	8.358	9.858	8.99	9.981	10.123	9.368	10.989	7.463	9.327	9.93	8.54	6.02	9.543
+1	8.23	9.614	8.806	9.919	9.939	9.108	11.184	7.766	8.793	10.174	8.605	5.972	9.068
+2	8.238	9.802	8.926	9.595	10.062	8.77	11.202	7.712	9.131	10.34	8.57	6.05	9.464
+1	8.533	10.108	9.083	10.214	10.514	8.463	11.008	7.356	9.344	10.196	8.736	6.262	9.257
+1	7.866	9.444	8.223	9.865	8.95	8.539	10.935	6.754	7.748	10.177	7.826	6.29	8.716
+2	8.888	10.031	9.158	9.407	10.8	9.547	11.238	7.659	9.602	10.398	9.337	6.028	9.529
+1	8.026	9.682	8.398	9.824	9.202	8.041	10.703	7.322	8.352	10.209	8.196	6.009	9.001
+2	8.974	10.071	9.451	9.348	11.061	9.686	11.255	8.077	10.101	10.323	9.557	6.006	10.072
+1	8.181	9.432	9.045	9.544	10.651	9.18	10.832	7.419	8.742	9.818	8.546	6.33	9.201
+1	8.137	9.676	9.024	9.37	10.206	9.944	10.985	7.226	8.9	10.362	8.918	6.352	9.367
+
diff --git a/sourcecodes/example_datasets/time_series_example.txt b/sourcecodes/example_datasets/time_series_example.txt
new file mode 100644
index 00000000..5ea44854
--- /dev/null
+++ b/sourcecodes/example_datasets/time_series_example.txt
@@ -0,0 +1,501 @@
+Genotype	TraitA_T1	TraitA_T2	TraitA_T3	TraitB_T1	TraitB_T2	TraitB_T3	TraitC_T1	TraitC_T2	TraitC_T3
+1	1.4297	-0.13715	-0.33041	1.3972	-0.17802	1.0272	-1.322	0.0027715	0.85527
+1	2.0687	-2.5819	-0.71386	-0.25338	0.64604	-0.25402	-1.1947	0.60348	1.5977
+2	0.52771	0.19656	0.40967	0.039336	1.57	-0.036341	-1.6301	-0.15434	0.93397
+1	1.7929	-0.85399	-0.21102	0.36528	0.14997	-0.072283	0.25214	1.8044	1.4149
+1	-0.090929	-0.17288	-2.808	0.79192	-1.5175	-0.90041	0.39689	-0.18146	-0.55432
+1	0.86086	-0.049472	-0.82074	0.18954	0.51157	0.30995	-0.50952	-0.047852	0.25632
+1	0.37794	-0.49737	-1.5634	-0.61123	-1.6172	-0.025387	-0.50463	1.0061	-0.55909
+1	0.061886	-1.3173	-0.38674	0.66584	0.023432	-1.0821	0.14268	-0.21189	-0.60498
+1	0.96427	-1.6652	-0.61177	-0.295	0.12641	-1.6644	-1.0372	0.033566	1.3366
+2	0.16295	0.59047	0.7747	-0.32623	1.6996	-0.042892	-0.0034198	-0.30944	0.67765
+1	1.7419	-0.94567	-1.8121	0.80385	0.23144	-1.4004	2.0605	-0.83835	1.3823
+2	-0.92772	0.34934	0.87438	-0.62792	0.7641	-0.5865	0.24522	0.6353	-0.0017539
+2	-2.9367	1.609	2.0928	0.61651	-2.0775	-0.24164	-0.3587	-0.95545	-3.0393
+1	0.52613	0.43773	0.75866	0.73066	0.46388	-1.4681	-1.5908	1.6872	0.89314
+2	-0.10721	1.7759	1.6821	-0.56868	1.6447	-0.92002	-0.27447	-0.62549	0.91373
+1	-1.073	-1.8228	-0.34751	-0.54007	-1.7593	-0.7431	0.61821	-0.054988	-1.7414
+2	-1.0532	1.0319	1.0531	-0.09473	-0.82174	0.45084	-0.38299	-0.6361	-0.90619
+1	1.7064	-1.8984	-2.6061	0.99661	-0.67065	0.17936	0.97103	0.38751	-0.11531
+2	-3.2527	-1.1361	0.56795	-0.39584	-1.5189	-1.7637	1.2149	-1.3971	-1.8622
+1	2.3471	-2.1036	-2.092	1.544	-0.21178	0.3446	1.0474	-0.64427	0.73628
+2	-0.63792	1.3156	0.92169	-0.67815	1.4089	1.1938	0.82905	0.16566	0.09164
+2	-2.0379	0.74861	0.16368	0.58693	-0.67589	0.81824	0.33633	-0.19727	-1.243
+2	-1.7441	2.4915	0.89809	-1.0265	0.35767	-1.159	0.63023	0.97341	0.29971
+2	-1.9637	0.94259	1.169	1.9451	-0.96485	0.49152	-1.1393	-1.2415	-0.58885
+2	-1.0536	2.4253	0.94996	-2.3874	0.23825	0.224	-0.073329	-1.2231	-0.24801
+1	-0.032849	-1.1426	-1.1507	-0.10711	-1.6383	-0.80394	1.5126	0.28303	0.083105
+2	-2.2192	0.84322	0.73021	0.71513	-0.79164	0.61126	-1.2986	0.89057	-1.4685
+1	0.42429	-0.65294	-1.9493	-0.77983	-1.2761	0.99263	0.051924	0.83436	-0.0079187
+2	-0.85155	0.9691	1.1731	1.0504	0.39302	0.030178	-0.70262	-0.014959	-0.31945
+1	-1.4662	-0.5934	-2.0914	-0.76279	-1.7903	0.94245	0.96374	-1.6733	-1.8091
+1	2.0716	-0.52844	-0.183	-0.032514	1.4843	0.28402	0.37221	-1.4476	2.8712
+2	-1.0437	1.5094	-0.23396	-0.84804	0.43785	0.19966	0.3728	0.15043	0.10549
+1	1.0647	-0.35638	-1.0854	0.78756	-0.99107	0.098816	-0.32975	-0.68451	0.71344
+1	0.58146	-0.46614	-2.9113	-0.032848	0.052376	-0.36411	0.87461	0.28033	-0.61848
+2	-0.6251	1.3257	0.36072	-0.042944	0.66071	-0.33981	2.0873	1.2161	0.089706
+1	1.57	-1.26	-2.0278	1.5331	-1.5343	0.019093	-0.73556	1.0316	0.41452
+2	-1.6998	1.0471	-0.0095397	-0.72037	0.30428	0.18062	0.86143	-0.31801	-0.86127
+2	-1.0544	1.9761	1.1994	1.7876	-0.24561	0.01978	1.4123	0.19675	-0.022687
+2	0.38235	2.3798	0.42045	0.97856	1.7099	0.20914	1.0505	1.9808	1.482
+1	1.8991	-2.1024	-0.53897	0.20839	1.3568	-1.4725	0.16263	0.069291	1.5719
+2	-2.2901	1.333	1.1433	-0.53918	-0.41394	-1.0484	-1.2332	0.068735	-2.0475
+1	1.9123	0.027091	-0.067604	-0.86429	-0.73426	0.65875	-0.59697	1.1903	-0.068242
+2	-1.8834	1.7232	1.3404	-0.096031	-0.1779	1.2453	0.23601	-0.81722	-0.8237
+1	-0.33029	-1.4141	-0.24236	0.3117	-0.28893	-1.536	0.63391	0.97915	-0.30591
+2	-1.0004	-0.17153	0.80903	-1.3152	-0.28004	-2.5356	0.25062	-1.6221	-0.2114
+2	0.92525	0.78374	0.44585	0.87215	0.67229	1.6991	-0.45347	0.21751	0.95898
+1	0.47842	-0.79727	0.0099566	0.8919	0.31135	-0.62503	-0.99073	1.5268	0.43918
+1	-0.52618	-0.57407	-1.5704	-1.9977	-1.8715	0.99632	1.124	2.1038	-1.3776
+2	-0.8334	1.5897	0.82506	-0.045645	0.23407	-1.1836	-0.86756	0.52102	0.23901
+1	1.0179	-0.6531	-0.53277	0.32403	1.226	-0.27361	-1.5967	-0.20229	1.5482
+2	-0.82762	0.26361	2.4807	-0.49628	-0.44792	1.295	-1.0416	0.29424	-1.0789
+1	1.569	0.14532	-1.3216	-1.1622	-0.46791	0.10723	-0.74658	1.7246	0.087136
+1	0.93783	-1.0786	-1.6758	-2.3367	-1.4745	-0.78743	0.85399	0.0085691	0.79439
+2	-2.9555	1.122	1.8506	0.65602	-0.66402	0.25697	0.75048	0.21667	-2.1374
+2	-1.5843	0.24076	0.71071	-0.16959	-1.0254	0.44363	1.1218	1.0872	-1.2214
+2	0.82202	1.2273	-0.2641	1.1674	0.72576	-0.6655	-0.33565	-0.57264	1.0462
+1	0.83408	-0.90235	-0.3935	0.086621	1.5353	-0.37978	-0.040736	0.54884	1.0078
+2	-0.30426	0.26772	1.1941	0.52251	1.9104	-0.10785	0.40619	1.0277	1.0258
+1	0.81767	-2.1549	-1.0066	-1.1068	-0.3204	0.70458	-1.0728	0.7519	0.49365
+1	0.67964	-1.4603	-1.4347	0.76332	-0.97228	-0.9221	1.0028	0.98058	-0.18843
+1	1.3794	1.3504	-0.081978	0.31556	0.32948	-2.6404	-1.0646	-1.2234	0.23259
+2	0.11139	1.1587	0.66712	-0.46969	0.42	0.31504	0.4697	2.6848	0.14172
+2	0.28767	-0.065134	1.3282	0.43016	1.4838	-0.63014	0.62746	0.93536	1.6029
+1	2.4805	-0.73041	-2.1434	-0.61007	0.89886	-0.34815	0.53564	-0.83092	1.359
+2	-1.7925	1.8972	1.3604	-1.0549	-1.2652	1.3518	-0.049884	-1.2196	-0.88755
+2	0.47058	1.4302	-0.034783	-0.11473	1.0041	1.0036	-0.46028	1.0611	1.2613
+1	2.6579	-0.31683	-1.1155	-0.65359	0.96673	0.64757	1.2194	-0.90696	1.8217
+2	-0.29097	0.91367	1.5236	-1.0735	0.71821	-2.1156	0.11456	-0.37247	0.64467
+1	0.68355	0.40105	-1.7852	1.3169	0.6179	-1.3712	0.05004	-0.65314	1.1103
+2	-1.8738	2.4006	1.8782	-2.1995	0.49239	-0.6918	-0.70293	-0.74597	-0.3239
+2	-0.36364	1.0943	0.62818	0.1429	0.85651	-0.96809	0.12213	-0.94343	0.42158
+1	0.40116	-1.4861	-0.049336	0.72652	0.1255	-1.1187	-0.38912	0.060771	-0.29816
+1	1.1364	-0.828	-0.44475	0.81314	-0.45463	0.73019	-0.57071	0.32484	0.046647
+1	0.91034	-0.95145	0.43201	0.76891	-1.5873	-0.38206	0.28662	0.23105	0.11712
+2	-0.27208	2.2223	1.2591	0.70003	0.89367	1.0322	0.41848	0.96986	0.17078
+1	1.0624	0.048938	-1.002	-1.0531	-0.28385	0.30108	0.62074	0.39829	0.27699
+1	0.57701	0.094694	-1.3989	0.15018	-0.44071	0.74259	-1.2663	0.33047	-0.45917
+2	0.11706	2.795	0.35611	-0.68956	2.1138	0.36961	-1.3806	-1.1414	1.9844
+2	-1.2526	0.11214	0.40367	0.83874	0.37692	1.4445	-0.77317	-0.40136	-0.42244
+2	-1.4336	-0.32339	1.3392	0.7596	0.0091892	1.0806	-0.81666	-0.39415	-1.9858
+2	0.5554	1.0643	0.50191	0.37325	2.0674	0.38376	-0.13487	-0.37455	0.64987
+1	1.6028	1.107	-0.9114	0.97541	0.88036	1.66	1.4044	-0.46919	0.80681
+1	1.6228	-1.3906	-1.8136	0.56649	-0.87823	-1.8194	0.30195	1.2461	-0.07587
+2	-0.97076	1.5212	1.1269	0.4029	0.19516	-1.5031	0.85567	0.18958	-0.20832
+1	1.3197	-1.8366	-0.24704	0.34608	-0.77044	1.1945	1.6826	0.91217	0.30079
+2	-0.38255	-0.2812	0.27203	-1.2858	0.86735	-0.54848	-1.3505	0.57415	0.12916
+2	-2.878	1.5199	0.74535	-1.4308	-2.2635	-1.4245	0.89574	0.037623	-2.7177
+2	-1.7715	0.74699	0.96279	-1.306	-0.36677	-0.36708	1.4602	-0.85456	-0.40898
+2	-1.3391	1.2012	0.7409	-1.3102	0.40133	-0.076096	0.51637	0.33495	0.25003
+1	0.65017	-0.57483	-1.7053	0.21131	-0.38338	1.6998	-0.70762	1.5248	0.1473
+1	-0.14679	-1.5979	-1.2765	1.041	-0.00072624	-0.19359	0.17338	-0.96136	0.51031
+1	1.8145	-1.0318	-1.0633	-0.098291	1.1755	-0.57137	1.7174	-0.14248	1.4282
+1	0.80523	-0.96777	-1.8989	0.063236	-1.2783	0.72214	-0.99392	-0.017507	-0.52743
+1	1.479	-1.2772	-1.1642	0.13841	0.83641	0.12311	1.2557	-0.37799	1.6174
+2	-1.423	-0.24793	0.49465	1.1461	-1.0896	-0.16348	-0.76872	-0.40631	-1.8538
+1	1.5733	-0.26875	0.42772	-0.75241	-0.0059677	0.65109	0.67958	0.47183	-0.10405
+1	1.7405	-1.3987	-0.91804	0.30851	-0.37195	-0.30858	-1.2002	0.51775	0.60525
+1	1.0571	1.4951	-2.5784	0.023453	0.064363	0.2392	0.93292	-0.37825	0.58165
+2	-0.35492	0.69359	1.5161	0.58499	-0.44209	-0.09004	-0.70298	-1.1197	-0.12251
+1	0.61469	-1.1159	0.11919	0.1796	-0.94894	0.012732	-0.69651	0.21311	-0.52283
+1	-1.2282	-0.050497	-0.83443	-0.28534	-2.0051	-1.3528	0.096769	-0.67245	-1.2668
+1	1.0411	-0.016327	-1.927	-0.10683	-0.70277	-1.4696	-0.021181	-0.34105	0.46198
+2	0.64635	0.84883	1.6319	0.2406	1.8836	0.31359	-0.69264	0.96691	1.3021
+2	-0.3604	0.050276	0.95661	0.18902	1.5034	1.3017	-0.045011	-0.92727	0.70494
+2	0.60646	1.598	1.395	-1.3791	1.8106	0.097276	0.74515	-0.4425	0.62478
+2	-0.099653	-0.54799	-0.1078	-0.18908	1.4643	-0.49221	0.050585	-1.2949	1.4842
+2	-0.98803	0.016928	1.2978	-0.29336	-0.2433	-0.90577	-0.18704	-0.22856	-0.39148
+2	-1.2267	0.82318	0.77338	0.0029744	0.15114	1.4265	1.6722	-0.18878	0.083877
+2	0.32455	0.48697	0.87077	-1.2598	0.89457	-0.2656	-0.4774	-0.22382	0.86019
+2	-1.6768	0.28366	1.7541	1.4309	-1.0277	-0.49835	-0.31204	-0.04057	-2.2507
+2	-0.83915	0.98617	0.024566	0.14541	0.40801	-0.010211	1.7726	-1.3709	0.30366
+2	-0.12663	0.15335	0.70774	2.1504	1.6066	-0.39836	1.078	-0.017324	0.94477
+1	1.1185	-0.39853	-0.011251	-0.0047654	-0.018256	-0.97102	1.8801	0.5724	0.70777
+2	-0.96731	-0.023776	1.2924	-0.94814	1.0413	0.3092	-0.06342	-0.032081	-0.22356
+1	1.1481	-1.0434	-2.2223	-1.2686	0.27026	-0.40422	-0.34583	2.2763	-0.16972
+2	-0.73981	1.2266	0.71139	-1.5638	0.084373	0.09421	-0.94629	-0.73173	-0.13897
+1	0.10133	0.032746	-1.5397	-1.7164	-0.96537	0.18106	0.47324	-0.32186	-0.44953
+1	2.3032	0.37332	-1.7518	-0.97719	0.21786	-0.29424	-1.6122	-0.3313	0.34243
+2	0.30487	0.96988	0.7649	1.2021	0.93113	-0.55965	-1.8153	-0.34231	1.0416
+1	0.9734	-1.1492	0.54826	0.24535	-1.1123	-0.013547	-0.72623	0.9444	-0.19613
+1	1.3053	-1.4227	-2.1548	-0.99601	0.99751	0.37094	-0.24703	-0.92319	0.81674
+2	-0.0084211	1.8266	0.94339	-0.96922	2.2496	0.14622	2.3348	-0.34993	1.4151
+1	0.64848	-1.4999	-0.79935	-0.18624	-2.4443	0.91037	-0.16866	-0.15122	-1.2117
+1	0.99806	-1.9897	-0.90507	0.86062	-0.34118	-0.4535	-0.54746	1.5108	0.91863
+1	-0.30169	-1.2768	-1.1305	-0.01759	0.06726	-0.39978	0.52015	0.96655	0.12442
+1	0.76671	-0.91781	-2.0919	0.37685	-0.19301	0.73072	1.2156	1.439	0.0070513
+2	0.66141	0.90111	1.0491	-0.66199	1.9568	-1.2392	0.18616	1.0926	1.652
+1	2.2346	0.19579	-0.82941	0.65367	0.48104	-0.33862	0.11669	0.66087	1.1783
+2	-1.3061	1.9587	1.3667	1.1907	-0.51821	-0.2974	-1.0178	0.34352	-0.018939
+2	-2.4636	0.65586	1.618	-0.50642	-0.63857	-0.65954	-0.9133	0.027975	-1.4977
+1	0.89124	-0.8583	0.34126	-0.30785	0.91808	-2.22	1.2944	-0.27909	1.487
+1	1.9669	-0.26343	-2.0878	-0.29226	1.7407	0.64013	0.32367	0.44562	1.1292
+2	-1.6773	1.1266	1.5663	0.16226	-0.34514	0.84293	-0.44423	1.0172	-0.78509
+2	-0.7714	0.64263	0.67055	-0.12578	0.030391	0.57791	-0.87634	0.28154	-0.261
+2	-1.0233	1.1382	0.044689	-1.1241	0.94709	-0.58888	-0.6081	-1.1033	0.0014883
+1	-0.89032	0.083064	-0.12604	-0.88751	-0.91556	0.98782	-0.96295	0.75564	-0.69265
+1	1.3655	-1.0533	-2.2171	0.66166	0.025806	0.67579	0.34249	-0.62323	1.0886
+1	0.56399	-0.71728	-2.1219	0.31633	-0.71031	0.87407	-0.34701	0.53176	0.10037
+1	-0.29942	-2.2988	-3.1477	0.24441	-0.72899	0.88463	-0.8288	-1.1141	-0.93797
+2	-1.6019	1.5308	0.77275	-0.1597	-0.62304	-0.59345	2.1367	0.64165	-1.6089
+1	0.43998	-1.5333	-1.9005	0.44722	-0.13187	0.57419	-0.61413	-0.37988	0.13118
+1	0.32451	-0.97656	-0.87335	0.35494	-1.1928	-0.086298	-1.1026	-0.97919	-0.21726
+1	1.1693	-0.39422	-1.1447	-0.52351	-0.30333	-0.48954	-2.0032	0.46507	0.28567
+2	-1.0178	-0.043439	0.70679	0.14463	0.58141	0.098977	-0.88721	-0.15542	-0.56848
+2	-1.864	0.19456	0.95611	-0.51705	-0.71043	0.72604	-0.62148	0.50157	-1.4442
+1	1.1946	-2.0839	-0.6101	-0.83583	-0.63001	-2.1693	0.72895	-1.5658	-0.082817
+1	1.1312	-0.95042	-0.78674	-0.86549	-1.6625	-1.463	0.99593	-0.16553	-0.34155
+1	0.1384	-1.7694	-1.1965	0.66966	-0.69619	0.30805	-0.080061	-1.5587	-0.319
+1	1.4232	0.30662	-1.3935	-0.69947	-0.00055014	-0.019403	1.7703	1.0318	0.42129
+1	1.3138	-1.6567	-1.8236	-0.83594	0.59818	-1.9568	-0.73185	0.59719	0.62349
+1	2.1276	-1.5641	-1.0272	-0.22706	-0.61297	-0.86845	-0.16811	1.1233	0.63294
+1	0.86327	-1.1672	-0.4862	0.32957	-0.080302	0.81128	0.71627	0.55966	0.56367
+2	-1.1147	1.2413	0.85755	-0.98983	0.37471	-1.5058	0.52838	0.36411	-0.48627
+1	0.75511	-1.5314	-1.2234	-0.066617	0.54207	-0.84565	-0.12893	1.9402	0.7808
+1	1.1796	-1.5249	-0.84271	0.7095	0.87459	0.4211	0.58894	-0.13679	0.9324
+1	0.93365	-0.83064	-1.7063	-0.39808	-0.20153	-0.35447	-0.30854	-0.57078	0.36515
+1	1.8917	-1.3609	-1.8857	-0.17194	1.2951	1.1315	1.4558	-0.089841	1.2983
+2	-2.5895	-0.48061	0.79532	0.78346	-0.065639	-1.4548	-0.32083	-0.6721	-0.66455
+2	-0.63117	1.7367	0.74948	-0.57156	0.163	0.86543	0.20003	-0.75063	-0.21691
+1	0.95464	-0.59931	0.43364	-1.307	0.20536	-1.2766	1.1449	0.17596	0.4256
+2	0.38623	0.55334	1.5367	-1.3081	1.5091	-0.032931	0.56364	0.54856	0.53007
+1	1.1646	-2.9641	-0.86913	-0.68118	-0.086229	0.93707	-0.76042	0.057056	0.064744
+2	-0.51373	2.3748	0.37243	1.8737	1.2164	0.68405	-1.2926	0.33967	0.46045
+2	-1.716	-0.27518	0.71898	2.139	-1.1262	-0.42262	0.11487	1.2112	-1.1357
+1	0.81098	-1.6862	-1.1448	1.5806	0.07478	2.1746	-1.067	-1.0274	0.15241
+2	-0.52225	1.1834	1.2802	-1.2321	0.53041	-0.29027	1.498	-0.42998	0.29824
+1	1.4067	-0.73586	-1.4675	0.36902	1.0718	1.0513	1.6971	-0.35651	1.4181
+1	1.6396	-0.50918	-1.5239	0.079563	-0.21164	0.21185	1.565	-0.65063	0.82484
+2	-1.8129	1.1552	0.21773	0.85556	-0.54894	-1.3206	-0.70958	-0.76325	-0.45363
+1	0.08024	-2.4412	-2.6136	0.63901	-0.43723	0.30985	-0.87622	0.32545	-0.64188
+2	-1.3992	1.86	0.38514	-0.16959	-0.24569	-0.82319	-0.33765	-1.4312	-1.2661
+2	-0.86537	1.8958	0.18147	-1.9666	-0.72909	0.10657	-0.67092	-0.092301	-0.26755
+1	2.036	-0.70975	-0.61637	-0.56185	0.88033	0.41052	-1.1744	1.3238	1.9451
+1	-0.72085	-1.0706	-1.5233	-1.0609	-2.2981	-0.92031	0.85305	0.92412	-2.0596
+1	0.55799	-0.18829	-1.3832	-0.54916	-0.1609	1.5505	0.19265	-0.46904	-0.37963
+1	0.57613	-0.29024	-0.82884	-0.28827	-0.62227	-1.1992	-0.81165	1.2746	-0.14435
+2	-2.1458	-0.13362	1.3613	-0.6849	0.26747	0.16034	0.47253	-1.0468	-1.4435
+1	0.75481	-0.80985	-1.7562	0.11274	-1.361	0.2692	-0.33398	-1.981	-0.45146
+2	-0.63689	1.4115	1.1256	-0.48954	0.22227	0.083383	-0.68005	-1.3527	0.15794
+1	0.20488	-0.8585	-1.7057	-0.10785	-0.51512	-0.21105	-0.2347	0.50991	-0.2296
+1	0.33051	-0.82281	-1.4551	-0.49943	-2.2164	-1.243	0.92027	-0.28432	-0.9815
+2	-1.5323	1.4825	0.19568	-1.2659	0.39757	-0.31925	-1.2746	1.0148	-1.2882
+1	1.5044	0.37718	-2.1235	-0.61248	0.60182	2.0258	1.4868	-1.3682	0.2884
+2	-1.6985	1.5229	0.84929	-0.10283	0.041132	0.4637	0.8772	0.68429	-0.14624
+2	-1.3935	1.1026	0.31729	1.3348	0.69002	0.8169	-1.0187	-1.2712	-0.32986
+2	-0.86151	1.1122	1.3	-0.32921	-0.41074	-0.70612	0.6009	0.3163	-0.097953
+2	-2.0673	1.6355	0.097123	0.91473	0.5959	1.3796	-1.1231	1.8893	-0.22321
+2	-2.4777	1.7124	-0.15192	-0.52093	-0.16443	0.4923	0.66793	-1.2934	-0.85227
+2	-1.3134	0.016105	1.4176	-1.6019	0.1775	0.25622	-0.55297	0.3436	-0.7072
+2	-1.0597	1.7595	0.80528	-1.8325	0.76506	-0.3233	-1.6869	2.265	-0.08971
+1	1.1695	1.0881	-0.63283	-1.785	-1.7752	-0.58415	0.69137	0.82675	-0.3004
+1	2.1262	-1.8156	-0.39282	-0.80595	0.050324	-0.16373	-0.47151	0.80027	0.54389
+1	1.063	0.25296	0.17061	-0.1157	-0.59899	-0.43356	0.60152	-1.3515	1.3947
+1	-0.10155	-0.81702	-0.9886	-1.1247	-1.0497	-1.185	-0.15332	0.4469	-0.096871
+2	-0.57577	0.74889	1.8408	0.28509	1.5472	1.9763	1.6429	-2.0436	0.74455
+1	-0.75989	-1.2425	-0.34199	-0.818	-2.3858	0.47522	-0.23387	-0.28078	-1.309
+2	-2.0495	2.5682	1.5694	-0.41676	-0.74454	-2.4393	-1.1153	-0.57367	-0.54138
+1	0.77924	-2.4438	0.15312	1.4288	-1.2908	0.81841	-1.6958	-0.26358	0.81237
+1	1.3679	0.40158	0.13439	-1.4677	0.89536	0.41708	-1.1908	0.96858	0.56786
+2	-1.4326	-0.13779	0.41395	-0.42952	-0.17306	2.1264	-1.3315	0.86756	-1.089
+1	0.88958	-2.3905	-0.67529	1.2911	-0.38016	-0.3412	1.1386	0.057707	-0.36773
+2	-1.5711	0.45979	1.0688	0.26169	-1.6144	-0.35448	-0.53559	0.42875	-1.6729
+1	1.0892	-0.40625	-1.2024	-0.24455	0.22748	0.98424	0.43801	-0.59885	0.46111
+2	-0.99813	0.68247	1.2314	-1.1455	0.047651	0.30609	0.32837	0.35498	-0.81578
+2	-0.68839	1.6801	2.0582	-1.4603	-0.88636	1.3908	-0.57986	-0.0037434	-0.53515
+1	0.40464	-2.6344	-0.28752	-0.51213	-0.48685	0.69834	-1.2208	0.065339	-0.45076
+2	-2.4333	-0.012759	1.469	2.659	-0.5377	-0.71507	1.0595	-0.18563	-1.5926
+2	-0.6268	1.4389	1.2319	0.08302	0.44274	0.39782	-0.67528	0.38559	-0.65921
+2	0.8026	0.80659	1.1495	0.74086	1.2964	0.062532	-0.28188	1.5504	1.1851
+1	0.21066	-1.3587	-1.018	-0.87592	-0.69085	-0.72849	0.38214	0.62269	0.18878
+1	1.0048	-0.91952	-0.66448	-1.3416	0.25265	-1.2612	-0.049135	0.82484	1.005
+2	-1.7507	1.7795	1.0866	1.9423	0.058961	0.96838	-0.3094	-0.2146	-0.7414
+1	0.97472	-0.061041	-0.36624	-0.7592	0.64262	0.81729	0.82749	1.823	0.34266
+1	-0.18399	0.0091627	0.45289	-1.2116	-1.9977	1.0641	0.8541	-0.49246	-0.92098
+1	2.9043	-1.4253	-1.4868	1.7467	0.4367	0.05544	0.35801	-0.91383	1.8223
+2	-2.5691	0.54849	1.5138	-0.75521	-1.646	0.98134	-0.18735	-0.6348	-1.9734
+1	2.3396	0.33806	0.69458	1.1091	1.2125	0.33828	-0.35002	1.1751	2.2485
+1	1.6685	-1.3783	-1.9317	-0.42944	1.2029	-1.4867	0.066998	-0.79486	1.4035
+2	-2.0928	0.53632	0.66581	1.2841	-0.60555	0.040915	3.1538	-0.056627	-0.83943
+1	1.5062	-0.82059	-0.74344	0.44647	0.59511	0.72422	0.62593	1.4268	1.2028
+1	0.37623	-2.4777	-1.3103	0.80402	-1.0351	-0.65952	1.4683	0.29902	-0.49379
+1	1.4315	-2.0349	-0.31206	0.050746	-0.13336	-0.038433	-0.51562	0.99598	0.8749
+1	0.46095	-1.5658	-1.8801	-0.54485	-0.65584	0.76544	0.2493	-1.0033	0.76074
+1	2.6758	-1.3401	-0.74083	-0.48907	1.4859	0.80109	0.084022	-1.1922	2.1735
+1	2.0061	-1.4527	-1.0237	-0.0063521	0.45363	-0.80533	0.53272	1.6309	1.1671
+2	-0.13994	1.3236	0.36193	-1.5754	0.31655	-0.87259	-0.30997	0.42034	0.078694
+1	0.48288	-1.4314	-1.2834	-0.79288	-0.031895	-1.3756	1.1439	0.092314	-0.51815
+2	-0.47435	0.79761	0.43073	0.79731	0.57061	-0.28187	-0.50956	0.11834	-0.90176
+1	0.29318	-0.50799	-1.2929	0.33339	-1.3628	-0.65651	1.332	-0.60648	-0.83894
+2	-1.606	1.6449	0.77136	-2.1167	-0.16742	1.837	0.85353	-0.61236	-0.63417
+1	-0.1001	-0.77059	-1.5772	-1.6877	-0.97173	0.63499	-0.3566	0.22712	-0.64236
+1	1.2767	0.51264	-1.027	-1.5029	0.52605	1.3738	0.83457	0.29704	0.33919
+1	1.1191	-0.064296	-0.48267	-1.782	-1.2738	0.17159	-0.28188	0.29923	-0.58741
+2	-0.63826	1.8527	1.7133	-0.056135	1.8808	-1.6172	-1.0494	0.61158	0.043977
+1	1.2643	0.64783	-1.0678	0.74684	0.01604	0.0964	3.1502	1.0929	0.73344
+1	0.12706	-0.4412	-0.89289	-1.3539	-0.058561	0.67775	-0.3655	0.095055	0.96019
+2	-3.0835	1.5862	0.75303	-0.24237	-1.08	-0.96917	-0.3816	-0.81532	-2.8002
+1	0.51225	-1.7399	-0.75798	-0.067637	-1.3492	-1.6732	0.13661	0.60332	-0.10099
+2	-1.7725	0.80999	1.2954	1.1806	-0.26584	1.0747	-1.4449	-0.67675	-0.87535
+1	0.14033	-1.4421	-0.77783	-0.66938	-0.73477	0.79103	-1.159	-0.063733	0.25614
+2	0.076697	0.50986	1.3258	1.965	0.90572	-0.69409	-0.34803	-0.63785	0.081812
+1	0.66949	-1.0812	-0.32498	1.1384	-0.35031	0.88344	1.5788	0.36127	0.94262
+1	1.8522	-1.2292	0.14775	-0.72146	-0.62468	0.46004	1.3635	-0.57543	0.34048
+1	1.0906	-0.60665	-0.65963	1.0382	-0.42593	1.3403	-0.15771	0.76656	-0.12989
+1	0.27921	-0.21562	-0.17954	0.91419	-2.0093	1.7467	-0.4308	-1.0916	-1.2044
+1	1.1757	-1.4632	0.1861	-0.99194	0.13545	2.4954	0.10044	-0.27133	0.69247
+2	-0.99062	-0.018655	1.4302	0.24467	1.1165	1.0648	-1.6885	1.0959	0.95405
+2	0.86302	0.92628	1.1209	2.4521	0.28548	0.38878	1.5759	-0.85559	0.53646
+1	0.69515	-0.49791	-1.0236	-0.92469	-1.2116	1.3456	-0.79874	1.204	-0.56016
+2	-2.4796	1.3958	0.87657	0.44706	-0.16121	1.5481	0.71852	0.27896	-0.66289
+1	0.43301	-0.79901	-0.59228	0.77222	-1.3966	0.25029	1.254	0.29857	-0.62542
+1	-0.27647	-1.1822	0.41671	-1.3611	-0.55777	-0.50963	-0.30934	-0.59363	0.061939
+1	0.38513	-2.9318	-0.54247	0.37014	-0.073925	1.5321	0.23051	-0.57138	0.11674
+2	-1.8571	0.45699	1.201	0.10404	-0.60138	-1.7736	0.42053	-0.79846	-1.4224
+1	0.62359	-1.7125	-0.62582	-0.042918	-0.36669	-0.56715	-0.062339	0.89859	0.30456
+2	-1.6533	0.84354	1.6735	-1.2605	-0.43289	0.48404	0.28039	0.78245	-0.57258
+2	-0.080794	1.1924	1.4788	-0.67232	0.47322	1.1845	-0.012908	-1.4312	0.93776
+1	0.16058	-0.57081	-2.6514	1.4884	-2.1855	0.65477	0.47093	0.15081	-1.1277
+2	-1.1955	0.99242	0.9036	0.18329	0.18	-1.2844	-0.11974	0.18755	-0.45505
+1	1.1671	-2.6976	-0.50301	-0.58948	-0.51739	-0.45284	-0.012968	0.20125	0.57372
+1	-0.32345	-1.1455	-1.2572	0.10599	-0.55736	-0.50023	-0.14238	-0.46824	-1.259
+1	-0.25853	-1.7978	-0.029919	-0.29829	-1.0868	1.6792	-1.0787	-2.2796	-0.53019
+1	-0.36174	-1.3337	-1.1195	-0.31725	-0.95852	1.0132	1.7214	-1.0866	-0.13132
+2	-1.1173	0.24817	1.2532	-0.7469	0.27598	-0.84941	-0.49835	0.56046	0.59012
+2	0.30144	2.7931	0.91519	-0.84696	0.23668	-0.88296	0.72892	1.0513	0.19212
+1	1.4905	-0.4007	-0.54397	0.15127	-0.74687	0.61323	-1.8356	0.59089	1.1093
+1	-0.35132	-1.9883	-1.256	0.93049	-0.70667	-0.28659	-0.42879	-1.362	-0.50144
+1	1.2429	-1.5525	-0.20626	0.072086	-0.39782	0.68157	-0.53323	1.8666	0.045473
+2	-1.2196	0.14752	-0.53211	-0.7467	1.1406	-0.56244	0.29943	-1.4297	0.46157
+2	-1.6198	1.9155	1.2365	-0.95186	-0.06658	0.96942	-0.18211	-0.49517	-0.41439
+2	-1.0683	0.96089	1.1544	-1.6614	-0.35334	-0.4625	-0.21637	-0.32475	-0.10647
+2	-1.6914	1.0877	0.4725	-1.5111	0.83773	0.32967	-0.94111	1.3745	1.1852
+1	0.84313	-0.24952	-0.56678	-0.27797	-0.54407	-1.3431	-0.25809	1.282	-0.056027
+1	-0.035988	-2.0608	0.40945	0.30565	-0.62316	0.29468	-0.23983	-1.3008	-0.22695
+2	0.075977	1.9441	0.49189	0.37696	0.70796	-0.86073	0.4114	0.22453	0.98819
+2	0.28842	1.232	0.33576	0.038484	0.8227	-0.67275	0.41736	0.022429	1.0885
+1	1.6374	0.024546	-1.7459	-0.57923	0.68063	0.16658	0.0016636	0.47144	1.1552
+1	1.8588	-0.93368	0.28434	-0.7861	1.8997	1.5632	0.67609	1.9808	2.1869
+1	1.1439	-2.5158	-0.94428	1.3944	0.47815	1.0813	-0.82034	-0.4671	1.6872
+1	-0.83643	-1.1109	0.74783	0.14825	-1.8961	0.53083	0.12628	-0.97035	-1.2131
+1	0.80792	-1.2206	-0.53769	-1.9796	-2.0225	-1.3183	1.5367	-0.089998	-0.63818
+1	0.46322	-1.6832	-0.68896	-0.11466	0.82291	0.49543	0.64194	-0.78985	0.7928
+1	1.1134	-0.7632	-0.52309	0.050666	-0.11115	0.22091	-0.50697	-0.083966	0.28955
+1	1.6489	-1.4257	-0.079768	-0.17866	1.3682	0.99716	-0.14071	0.57401	2.0271
+2	-3.4201	1.1332	0.55733	1.7639	-1.0408	0.49521	-0.89075	0.63786	-2.4173
+2	0.049496	0.17018	0.63955	0.82924	0.50401	1.7456	1.2791	-0.82747	-0.056268
+1	0.82888	-1.6152	-0.67552	-0.18412	-0.8324	0.63814	-0.32875	0.56435	0.45993
+1	0.38504	-0.014272	-0.79157	0.17829	-1.0883	0.34832	-1.2247	-0.11977	-0.48077
+2	-1.4876	0.61139	0.9406	-0.32299	-0.4817	0.91219	0.97626	-0.25486	-0.64597
+1	1.3562	-0.30066	-1.6972	-0.51976	-0.31725	-0.76347	0.90608	-1.1069	1.1407
+2	-2.5614	0.1045	1.6435	0.97534	-1.3122	-0.7861	-0.20101	0.13606	-1.6992
+2	-2.6662	0.95905	-0.35403	-0.3552	-1.8512	-0.15132	-0.41612	0.31836	-2.2106
+2	-0.00031444	0.62953	0.088267	0.68222	1.0037	-0.97501	0.05455	2.1016	0.79972
+2	0.22638	1.2227	1.4105	0.80602	0.55541	-1.5322	0.0043904	-0.15507	0.68087
+2	-2.334	1.5675	1.163	0.272	-1.2525	0.60333	-0.37448	0.8214	-1.9516
+1	1.2905	-0.88687	-1.3286	-2.4723	-0.20557	-0.46225	-0.43282	0.0080673	0.6155
+1	0.4564	-0.76149	-1.0996	0.91754	-1.2544	0.85041	-1.4562	1.2935	-0.46559
+1	1.4499	-0.66586	-0.35765	-1.2333	0.27339	0.71405	0.31118	0.35473	0.29444
+2	-0.77922	-0.42723	1.5001	0.0051638	1.708	-1.1243	-1.7226	0.88573	1.091
+1	1.4447	-0.16076	-0.43264	-1.3692	0.49062	0.72536	1.0569	-1.0645	1.0431
+2	-2.1249	1.55	1.0703	-0.33715	-0.93988	-0.46815	0.37327	0.14989	-1.378
+2	-2.1409	1.9364	0.89125	-1.3418	0.0029328	-0.62313	-0.08749	0.8668	-0.022832
+1	1.3168	-0.52716	-1.8803	-0.036537	0.018738	-0.35049	-1.0451	0.91575	0.5615
+2	-0.71066	1.9845	1.49	0.34891	1.2436	-1.4879	-0.19868	-1.2859	1.4068
+1	1.5001	-2.1148	-0.77803	2.3299	1.4564	-2.0676	-0.022721	-0.10446	0.26055
+2	-0.6739	0.41846	1.7318	0.68893	0.13108	-0.31544	-1.5612	1.2954	-0.92584
+1	1.4702	-1.0425	0.6928	0.072418	0.54485	0.85063	0.0081416	-1.4887	1.4283
+1	0.70021	-0.96049	0.073815	-0.42884	-0.069394	-0.21559	-0.026326	1.4426	-0.1714
+2	-1.1011	1.959	0.42525	-1.1689	-0.59141	0.10594	0.018948	0.20462	-0.52074
+1	1.4069	0.39853	1.1331	0.19914	-0.10243	0.018621	-0.43318	-0.66927	0.39015
+1	0.87655	-1.0124	-1.224	-0.46666	-0.07615	0.58575	-2.5462	0.94584	0.028689
+2	-1.4734	0.60836	0.57896	-0.63359	0.57633	-1.7896	0.17572	1.9757	-0.63815
+1	1.0333	-1.5614	-1.5383	1.438	0.52141	0.24245	-0.53578	1.6605	1.2533
+2	-0.3273	1.0926	1.1519	0.16952	1.0365	-0.23815	0.64169	0.60631	0.070148
+1	1.7758	-1.2199	-0.5642	-0.30348	-0.64616	0.58837	0.3667	-0.22602	0.18959
+1	1.5199	-1.4167	0.75493	-0.56876	-0.25767	-0.15304	-0.50137	0.95964	0.82786
+1	1.4824	-1.6233	0.43914	-0.42964	-1.3404	0.22643	-0.1404	-0.61313	0.084143
+1	0.44429	-0.57239	-0.87756	0.35081	0.18739	-0.3721	-0.026971	0.30198	0.1578
+2	-0.99851	1.6131	-0.023407	0.93921	-0.39113	0.3954	0.61223	-1.5171	-0.23186
+1	1.5526	-0.53216	-1.2919	0.2302	-1.4551	-0.78631	0.76506	-1.3068	-0.65802
+1	0.94848	-0.51015	-1.0914	2.9383	0.26782	-0.85511	-0.60545	0.54075	0.66057
+1	1.3473	-1.6193	-1.3367	0.35306	1.0269	0.9064	0.45715	1.1513	1.8352
+2	-1.8273	2.0565	1.3104	0.29618	0.35044	-0.48547	0.88384	0.14121	-0.5916
+1	1.5566	0.31096	-1.8396	-0.42655	1.4972	-0.77059	0.19228	-0.23885	1.1498
+2	-0.91541	1.1099	-0.025734	0.51863	0.20206	-1.1191	-1.1133	0.045123	-0.50422
+1	0.51812	-0.60581	-0.51525	-0.27024	-0.24289	-0.12177	0.08843	-1.1701	0.54732
+2	-2.2517	1.8548	0.3887	-0.48496	-0.44221	0.94129	0.86746	-1.3026	-1.1678
+2	0.18212	0.78036	0.37111	-0.27298	1.7074	0.34353	-1.4465	0.42845	1.358
+1	1.4023	-2.1882	-1.587	-1.7672	-1.0834	1.6286	-1.2021	-1.6029	-0.13929
+2	-1.2956	2.1152	2.7519	0.066883	1.1916	-0.43506	1.3982	0.50402	0.12064
+1	2.3367	-0.27214	-1.3764	0.11017	1.453	-1.5568	0.8465	-0.078289	1.7156
+2	-0.50576	1.8409	0.39684	-0.67433	0.52285	0.39823	0.79306	-0.45694	-0.26349
+1	1	-0.59182	-0.31766	0.98958	-0.2262	0.51294	-0.60031	1.0725	0.59729
+2	0.19153	0.8046	1.643	0.034662	0.859	0.7859	-0.32844	0.67515	0.20322
+1	1.7901	-0.59357	-1.2522	-1.4543	-0.68975	0.39807	0.66376	-0.34466	1.1902
+1	1.7089	-0.060397	0.35043	0.80625	0.099879	0.35182	-0.79309	-1.5215	1.0715
+2	0.1343	0.95427	0.96941	1.4958	1.5293	0.80648	0.27086	0.22725	1.1392
+1	2.8634	0.47861	-2.0142	0.11694	1.8637	0.021456	-0.030072	1.0836	2.0311
+2	0.48387	-0.64355	1.4169	0.74074	1.2122	-1.1388	-0.27931	0.32164	0.54646
+2	-0.74265	2.4938	2.0609	0.27613	0.097949	0.19312	-0.5424	0.075476	-0.43488
+2	-0.29163	0.040455	0.82654	-0.28016	1.2311	1.9005	0.3332	0.84937	1.0188
+1	1.4611	0.12262	-1.6808	0.83668	0.73216	-0.78731	-0.78309	0.048527	1.9664
+1	0.18222	-1.1837	-0.45627	-0.39739	-1.7104	0.031619	1.0594	-0.63454	-1.8183
+1	-0.65677	-0.84807	-1.6193	-0.47942	-1.0684	0.88853	-0.89937	0.52119	-1.4839
+1	1.2698	-1.435	-0.63897	-0.01313	-0.99173	2.5522	-0.56152	-0.56106	-1.1274
+1	1.385	-0.13768	-1.0754	-0.47919	-0.003611	-1.5125	0.052625	1.5811	-0.12839
+2	-1.0548	0.052238	0.2412	0.27463	0.22433	1.4336	1.0572	0.26996	0.41029
+1	0.7721	-0.67292	0.39868	0.37861	-1.4934	-0.47718	0.17927	0.85268	-0.72091
+1	1.2427	-1.9735	-0.29186	-0.52621	-0.11644	-0.43715	-0.24664	-0.93071	0.31767
+2	-2.8043	1.0978	1.4787	0.36056	-0.96764	0.88555	-0.15218	0.98887	-1.5008
+2	-1.2951	0.83324	1.171	-1.2691	0.36927	0.76625	-0.92005	0.24768	-0.054118
+2	1.3095	0.99843	0.13992	0.66979	2.1828	0.89717	-0.72625	-0.34445	2.1892
+1	1.2584	0.38994	-0.68463	-0.18974	-0.78064	0.77286	-0.83635	-0.60385	0.92861
+2	-1.0711	2.0033	1.0809	-0.51058	-0.023381	0.67482	-0.59591	1.1403	-0.45183
+2	0.21944	1.3571	1.4359	0.78966	1.663	1.6785	0.58208	-0.74842	0.20906
+1	0.011518	-1.0425	-1.1304	-0.070319	-2.5168	0.39814	-0.33423	-0.78894	-2.0357
+2	0.69198	0.5718	0.47852	0.63681	1.8381	-0.38219	-0.27264	-0.64378	2.0531
+1	1.7602	-0.041861	-1.5806	1.2187	0.62789	0.63859	-0.56816	1.0461	1.2766
+1	1.3974	-0.72864	-1.3122	0.98553	-0.40148	0.73259	-0.54019	1.2025	0.62291
+1	2.0292	-1.17	-0.92469	-0.4438	1.0769	0.3171	1.863	-1.4777	2.183
+1	0.82444	-0.11125	-1.7986	0.22037	-0.58058	-0.28998	-0.36893	0.1951	-0.014686
+1	-0.26775	-1.8824	-1.0596	-1.1796	-0.88341	-0.41298	0.2225	-0.34038	-1.9099
+1	1.0464	-1.5432	-1.1439	-0.16887	-0.58282	-0.58015	0.071053	-2.0172	0.40629
+2	0.48496	0.88721	0.068703	-0.062814	1.8539	0.76736	-0.69119	2.5673	1.7942
+2	-2.5964	1.666	0.64624	0.29818	-1.2247	-1.7919	-0.46627	-0.48313	-2.4143
+1	1.2985	-0.65098	0.20448	-0.94345	0.87214	-1.6734	-0.068609	-0.4095	1.9333
+2	0.22616	1.0924	1.3477	0.055694	1.4254	1.8744	0.11516	1.7865	-0.63249
+2	-0.088217	0.9008	0.6155	-0.80262	1.0367	0.52624	0.47333	-0.99159	1.1763
+2	0.49566	0.27083	0.36027	0.81907	2.1477	-0.09016	-0.060519	-0.84038	1.2276
+2	-0.95509	0.76962	1.617	-0.18465	0.54306	0.11383	-0.74663	1.2036	-0.15892
+2	-2.1626	0.76688	0.61098	-0.58151	-0.48433	-1.65	-0.4727	-0.81084	-1.991
+1	1.7072	-1.4061	-0.93099	0.20659	-0.6383	-0.52376	-0.59362	0.73275	0.14137
+1	1.1248	-0.25303	-0.59647	0.88007	0.15399	0.51682	0.81114	0.50757	1.0622
+2	-0.71804	0.42061	1.375	-0.1329	-0.13315	0.694	0.51403	0.7759	-0.19636
+2	-0.78286	1.5434	1.1806	-1.684	-0.84914	-0.26491	-0.18979	-0.39503	-0.52299
+2	0.014488	1.8201	0.1954	-0.95429	1.2411	-0.58396	0.55811	-0.46832	0.47374
+1	1.0749	0.50186	-1.2937	-0.90643	-1.2159	-0.19162	0.7674	1.3112	0.1246
+1	0.68887	-0.44578	-1.0028	-0.11492	-0.20396	0.84785	-0.15439	0.32438	-0.039298
+2	0.16742	2.9261	-0.74973	-0.39068	1.7798	0.42686	-0.080223	0.42411	1.6039
+1	-0.18087	-1.5505	-0.62971	0.016341	-1.5144	-1.0188	2.0846	0.043907	-1.1922
+1	0.95661	-2.0166	-2.1997	0.90248	0.54062	0.041709	0.90484	-0.85369	-0.13388
+2	-0.31077	0.51779	0.95641	-0.4625	1.0018	-1.0891	-1.3434	0.41807	0.50029
+1	0.91328	-0.44549	-2.0298	-1.174	-1.034	0.4279	-2.5807	0.4737	-0.85271
+1	-0.23575	-2.037	-0.2611	-1.4787	-2.7359	-0.17981	0.87371	0.47744	-2.3323
+2	-1.4541	0.20996	-0.05013	0.84273	0.46742	1.5516	-1.0325	0.70636	0.30572
+2	-1.2945	0.85979	1.4434	0.58762	0.48371	-0.71804	-0.9537	-0.78726	-0.53815
+2	0.74344	0.32219	0.79813	-0.31128	2.9169	-0.23629	1.4931	-0.35416	1.8392
+1	0.17191	-0.10805	-0.90104	-1.2155	-1.8461	0.41305	-1.3882	-0.70599	-1.4386
+2	-0.40498	1.9161	0.64926	-0.022772	0.98396	-0.26674	1.295	1.3676	0.78339
+2	-0.37054	1.509	1.6115	-0.58429	0.1452	1.167	-1.1994	0.076682	-0.76871
+2	0.61117	-0.31328	1.4496	-1.0086	1.5965	-0.44863	0.87281	-0.013992	1.2945
+2	-2.5627	2.5993	1.1595	-0.14098	0.0029615	0.58802	-1.7538	-0.44999	-1.599
+2	-0.871	0.043195	1.076	-0.56146	0.50375	0.85785	-0.11991	0.58565	-0.12111
+1	0.26437	-1.5194	-0.99247	2.0087	-0.53643	-0.028452	-0.60254	-1.0593	-0.44553
+1	1.4337	-0.4955	-0.38857	1.7006	-0.029221	0.72542	-0.5476	-0.25228	0.99248
+1	1.2526	-1.0033	-1.5107	-0.50129	0.52008	1.8291	0.25094	0.8054	1.4381
+2	-1.2973	0.63457	0.23922	-0.83426	-0.3921	0.48332	0.6937	-0.90008	0.28163
+2	-0.68226	1.0692	1.7561	0.16471	0.93344	-0.85611	0.17721	-2.744	0.79804
+1	1.1524	-2.2292	-0.55308	1.0928	-0.12293	-1.1935	1.2415	-0.70506	1.079
+1	0.9021	-0.91029	-2.3501	-0.4621	0.22359	0.6318	0.020605	1.0348	0.40828
+2	-0.76595	0.8248	1.9282	-2.1827	0.12486	0.79045	-1.0793	0.85428	-0.38859
+2	-1.8465	1.2372	1.4255	-0.64113	1.7146	1.75	1.0757	2.1723	-0.10888
+1	0.4124	-0.023721	-0.75091	0.0023936	-0.28659	-0.41428	-0.016011	0.6957	0.69187
+2	-0.45813	0.69702	1.7516	1.0408	0.15944	0.1227	0.38587	0.74631	-0.89003
+1	0.538	-0.35454	-0.3801	-0.53212	-0.68379	1.224	-0.77711	-0.90789	0.49391
+1	-0.20833	-2.8331	-1.3705	1.1197	-1.344	-0.82517	1.523	-0.91541	-0.96558
+1	0.7891	-1.2808	-1.1525	0.88602	-0.16858	-1.7123	0.77873	-0.20954	-0.16867
+2	-1.3314	2.8851	0.58893	1.7864	-0.23105	0.055718	-0.12725	0.76001	-1.5992
+1	0.73632	-1.3301	-2.9522	0.52725	-1.08	-0.06714	-0.94698	0.45418	0.41486
+1	-0.35063	-1.2931	-1.7601	0.69363	-1.4744	0.24266	-0.53511	0.79048	-1.1274
+1	0.49595	-1.7854	-2.069	-0.16771	-0.40006	0.44868	-0.4303	-1.5395	-1.066
+2	-0.83194	1.8975	0.64283	0.057645	-0.11672	-0.27891	0.11427	0.37462	-1.1174
+1	0.13137	-1.3172	-1.3952	0.60281	-0.59451	0.40422	-1.903	0.19047	0.63287
+1	0.79379	-2.4506	-0.74815	0.095119	-0.99504	0.56827	-0.27855	1.1757	-0.06042
+1	-0.082568	-3.4167	0.10544	-0.46771	-0.47642	-1.255	1.1708	-1.1147	-0.49832
+1	2.2039	-1.3601	-2.4033	-0.96653	0.33475	1.6743	-0.18215	0.26277	1.2449
+2	-2.4832	1.2267	1.3225	-0.44129	-0.82506	-0.44882	-1.3962	-0.7991	-1.6171
+2	-0.46149	0.35062	0.24453	0.83174	1.0664	-0.43189	-0.035901	-0.01857	-0.36555
+1	1.3889	0.052183	-1.2924	1.3615	-0.04596	-2.3656	0.38864	-1.7679	0.75491
+1	-0.68146	-1.242	-1.0646	-1.43	-1.2204	-0.57024	1.9686	-1.3026	-1.5174
+2	-1.7219	1.7273	1.3099	-1.4944	0.38043	-0.45523	-0.1014	0.22334	-0.28025
+1	0.4601	-1.2706	-3.0004	0.76391	-1.0926	-0.62232	-1.4501	1.8045	-0.8909
+2	0.63508	0.82051	0.86771	-0.03764	2.0161	0.47394	0.72173	0.1272	0.90096
+2	-0.50664	0.34365	-0.25494	-0.017548	0.40843	-0.051173	-0.39524	0.91238	-0.53873
+2	-2.0811	0.89924	1.0192	0.43669	-0.49654	-0.23137	0.41548	-0.30013	-1.4364
+1	-0.056347	-1.55	-0.99371	-1.2894	-0.54273	0.29751	0.20504	-0.42535	-0.30966
+1	0.63831	-1.9968	-0.82023	0.55724	-2.0781	0.85777	0.23729	-0.92902	-1.6423
+1	0.7966	-1.5913	-0.52401	-0.19794	-1.6834	-0.3534	-0.46345	1.1393	-0.65595
+2	0.10773	-0.33975	-0.087855	0.29636	0.96272	-0.39449	-0.9227	0.43119	0.37524
+1	1.0429	-2.6154	-1.0715	-0.95629	-0.89564	0.66231	0.11241	1.2325	0.32819
+2	-1.6843	1.3516	0.30108	0.72455	-0.23492	1.5917	0.52992	0.55089	-0.67923
+1	0.83236	-1.7333	-1.3285	-0.84552	-1.5398	0.63718	-0.92241	0.65631	-0.20652
+2	-1.4221	2.5458	0.98922	-0.97179	0.27368	0.51406	0.34173	0.18592	-1.2884
+2	-1.7862	0.7866	0.99765	-1.3351	0.49844	-0.43267	-0.53121	-1.4309	-0.56164
+1	1.4776	-0.21831	-0.99715	-0.43224	-0.74575	-0.54461	-0.93794	0.96267	-0.10238
+1	1.7229	-1.0653	-1.0424	-0.3796	0.61655	0.95133	0.98557	-0.36444	0.86756
+2	-0.23995	-0.13066	0.42758	2.147	1.4597	-0.19292	-0.86687	-0.39257	0.27569
+2	-0.20121	0.59656	1.9887	0.13145	0.1327	-0.19727	-0.05865	0.48741	0.25007
+2	-0.34495	2.2333	1.1524	-0.3531	0.51244	-1.0083	-0.22929	0.97338	0.57683
+2	0.03843	2.0985	1.5399	-0.44067	0.39468	0.66165	0.66233	2.0593	-0.89779
+2	-0.79583	-0.26167	1.7969	-0.83981	0.44149	0.7226	0.89209	0.58699	-0.022219
+1	0.44433	-0.9731	-1.1557	0.30092	-2.0491	-0.64077	-1.2024	0.27957	-0.594
+1	-0.5687	-1.2111	-0.75535	0.14432	-2.5169	2.0343	0.43688	0.19656	-1.4058
+1	0.74067	-2.7385	-0.5607	-0.1682	0.75534	-0.10032	-0.57514	-0.6271	0.86134
+1	1.3443	-1.3033	-2.9093	-1.1089	0.13087	-0.64097	0.3585	0.68683	0.40175
+1	0.34499	-1.2307	-1.0615	-0.056169	-0.66885	1.0018	0.82215	-1.2896	0.33605
+1	1.7055	-1.6123	-1.7269	1.149	0.91344	0.15816	0.08206	-1.0272	1.1846
+2	-2.257	1.8592	0.85977	1.5261	0.41802	1.6948	0.56961	2.0545	-1.7022
+2	-1.1666	0.71643	1.5052	0.88419	0.97675	-1.125	0.3411	-1.8831	-0.36783
+2	-2.8249	1.0453	1.0209	1.1005	-1.2481	-0.97923	-0.2972	1.2716	-1.4542
+1	-0.22349	-1.4876	0.16086	1.2627	-1.3753	-1.4312	1.5506	-0.28627	-0.13164
+2	-1.6498	0.87841	0.00037123	0.074895	-0.55409	-0.36662	1.0731	2.664	-0.749
+2	-0.46646	0.70235	1.1324	-2.5793	0.67907	0.35468	-0.32694	-1.1455	0.56525
+1	1.2694	0.46784	-1.4293	-0.50127	-2.0587	-1.8261	0.36831	1.7871	-1.5834
+1	1.5754	-1.0397	-0.5639	2.0739	0.53841	-0.70667	-0.65273	1.3444	0.45546
+1	-0.13986	-0.92734	0.87918	-0.72209	-0.5052	0.39414	-1.8605	0.98483	-0.37829
+2	-0.95014	0.83973	1.4337	-1.1105	0.072627	-1.2172	-1.6062	0.079614	-0.040378
+1	1.1359	-1.4676	-0.79366	0.068314	0.20653	-0.21332	0.8022	0.58405	0.92071
+2	-4.4596	1.8899	1.1644	0.58514	-2.6451	-0.26627	1.6536	1.2677	-3.7338
+1	1.5815	-1.7598	-1.5736	0.46493	0.015353	-0.31082	-2.2055	0.14685	0.11537
+2	-0.79178	0.27783	0.5954	-0.78667	0.40642	0.42974	-0.63366	1.0762	0.62431
+2	-1.0134	1.2166	1.1865	1.5637	1.1099	2.4594	0.40801	-0.85353	0.72663
+1	0.77943	-1.4202	-1.6749	0.0012415	-0.83458	-0.12672	-0.94554	0.89884	0.012849
+2	-1.4274	0.9359	0.88402	-0.76419	-0.50766	0.55146	-0.63931	-0.65644	-1.0529
+2	-0.71825	0.92276	1.0007	1.2904	1.4708	-0.52982	0.9275	0.94508	0.4575
+1	0.502	-1.2444	-0.25346	1.2023	0.16167	0.85576	0.034795	0.46868	1.3265
+1	-0.025698	1.1754	-1.0638	1.0218	-2.0164	0.55502	-0.12178	-0.10811	-1.6111
+2	-0.86777	0.31084	1.7383	0.39918	0.22035	0.14221	1.646	-0.97712	-0.59459
+2	-0.19808	1.9089	0.60873	0.12475	0.10092	-0.5944	-0.66923	0.055193	0.31899
+2	-1.0644	2.2357	0.13503	1.2076	1.657	-0.83795	-0.46089	0.42362	0.29853
+2	-0.53265	0.76969	1.0687	-0.79048	1.1924	0.53681	-0.38366	-1.1613	0.42401
+2	-1.4567	1.5038	1.7125	-1.9757	1.1075	-0.81071	0.29591	0.95985	-0.25161
+2	-2.7546	-0.21024	-0.041926	-0.24552	-0.6494	1.8608	0.86785	1.3512	-0.89236
+2	-0.54365	0.8237	-0.31856	-1.6296	0.73174	0.89915	0.91228	-0.66788	0.075926
+1	0.65472	-2.4675	-1.2267	-0.64632	-0.24147	0.5015	-0.24368	1.7307	-0.33117
+1	1.9061	-2.4358	-0.62051	-0.40306	0.35877	0.13681	0.5665	1.1077	0.90585
+1	-0.34786	-0.97138	-1.3607	0.74793	-2.3185	1.1517	0.35912	-0.22501	-1.7136
+1	1.509	-0.58183	-1.336	0.095131	-1.0719	-0.17454	-0.42425	0.21663	0.41672
+2	-1.1281	0.73596	1.3241	0.75066	-0.0098067	0.94941	-0.88569	0.96608	-0.58258
+1	2.0808	-1.2665	-0.27892	0.034005	1.5957	0.34276	-1.3939	0.20516	1.0361
+2	-0.27208	1.3514	0.78429	0.54442	1.2344	-1.0745	0.28837	-0.84074	-0.20416
+1	2.5732	-1.8429	0.35018	0.47113	-0.22532	-1.779	1.5326	-1.0015	1.0285
+1	1.524	-2.2514	-1.7375	-0.45648	1.0921	-1.1141	1.436	0.99093	1.3581
+1	0.60324	-0.46804	-0.11489	-2.454	-2.7665	0.61676	-1.5213	-1.192	-1.4163
+2	0.29712	1.188	0.57954	1.3259	0.95488	-0.70707	0.067457	0.47216	1.0369
+2	-0.97992	0.019053	1.3311	-0.33347	0.2814	-1.2616	0.90909	-1.0725	-0.62617
+2	-0.9056	0.73973	0.35093	-2.111	-0.50769	1.2491	0.64846	-1.0716	-0.35201
+1	1.3209	1.9154	-0.56509	0.70008	-1.6874	-0.92485	1.2406	1.7231	0.39622
+2	0.10632	0.88089	1.1544	0.27737	2.4332	-0.063819	-0.084136	-0.58305	1.1337
+1	0.7003	-1.4112	0.77725	0.95921	-1.239	-2.6684	-0.48008	-0.92359	-0.94882
+2	-2.0912	0.21124	1.0428	1.3279	-0.6659	-0.89398	0.5482	-0.029518	-1.2925
+2	-1.1484	2.2537	1.3423	-0.20816	0.31427	1.3603	1.6596	-0.49629	-0.63146
+1	1.2996	-2.8499	-0.97843	0.57176	-1.0424	-0.30734	-1.7632	-0.64856	-0.28028
+1	2.4392	-0.85404	-0.1262	-0.054289	0.1684	-1.3913	-0.4719	1.0582	1.4183
+2	-2.8357	2.1818	1.307	-1.1424	-0.97969	0.53689	0.33598	-0.11592	-2.0398
+2	-3.381	0.65778	0.8815	0.35115	-1.0556	-0.15942	-0.15958	0.57712	-2.8992
+1	1.9169	-0.15977	-1.1239	0.80773	-0.63434	-0.77712	-0.74684	0.97499	0.8461
+1	1.3703	-1.0164	0.45114	0.073799	1.259	0.40628	-0.11775	0.14354	2.0331
+2	-0.57067	-0.26266	0.56169	0.65535	0.78349	-0.66788	-0.41928	-0.77901	-0.27518
+1	-0.31373	-3.348	0.66363	-0.88205	-0.69595	1.0783	-1.9735	1.7579	-0.011735
diff --git a/sourcecodes/examplefilecopy.sh b/sourcecodes/examplefilecopy.sh
new file mode 100644
index 00000000..cd49d670
--- /dev/null
+++ b/sourcecodes/examplefilecopy.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+cd ./data/$1/
+FILES=$2*
+for f in $FILES
+do
+  echo "Processing $f file..."
+  new=${f//$2/$3} 
+  # take action on each file. $f store current file name
+  #echo "new Processing $new file..."
+  cp $f ../$new
+done
\ No newline at end of file
diff --git a/sourcecodes/examples/cardiagnosis.php b/sourcecodes/examples/cardiagnosis.php
new file mode 100644
index 00000000..1c2b14e4
--- /dev/null
+++ b/sourcecodes/examples/cardiagnosis.php
@@ -0,0 +1,83 @@
+<?php 
+
+$key=$_POST["My_key"];
+if($key=="")
+  $key="ab";//uniqid("");
+
+include("../header_new.inc");
+?>
+<!-- Site navigation menu -->
+<ul class="navbar">
+  <li><a href="../bn_file_load_gom.php">Learn a network model from data</a>
+  <li><a href="../home_upload.php">Make predictions using a known structure</a>  
+  <li><a href="../help.php">Help</a>
+  <li><a href="../faq.php">FAQ</a>
+  <li><a href="../home.php">Home</a>
+
+
+</ul>
+
+<div id="outer">
+<!-- Main content -->
+<br>
+
+<h2>Car Diagnosis [<a href="../example.php?My_key=examplecar15node|eIA">View network</a>]</h2>
+</br>
+<p>
+Car Diagnosis is an example of Bayesian Network structure originally designed by Norsys Software Corp. The example structure shows the relationships between different parts of a car. This network includes 15 discrete variables. Label values of the variables are annotated in the following table. </br>
+</br><table border="1">
+<tr>
+<th>Variables</th><th>Label 1</th><th>Label 2</th><th>Label 3</th>
+</tr>
+<tr>
+<td>Voltage_at_plug</td><td>1=none</td><td>2=weak</td><td>3=strong</td>
+</tr>
+<tr>
+<td>Car_cranks</td><td>1=False</td><td>2=True</td>
+</tr>
+<tr>
+<td>Spark_plugs</td><td>1=fouled</td><td>2=too wide</td><td>3=okay</td>
+</tr>
+<tr>
+<td>Spark_quality</td><td>1=very bad</td><td>2=bad</td><td>3=good</td>
+</tr>
+<tr>
+<td>Distributer</td><td>1=faulty</td><td>2=okay</td>	
+</tr>
+<tr>
+<td>Spark_timing</td><td>1=very bad</td><td>2=bad</td><td>3=good</td>
+</tr>
+<tr>
+<td>Car_starts</td><td>1=False</td><td>2=True</td>
+</tr>
+<tr>
+<td>Headlights</td><td>1=off</td><td>2=dim</td><td>3=bright</td>
+</tr>
+<tr>
+<td>Alternator</td><td>1=faulty</td><td>2=okay</td>	
+</tr>
+<tr>
+<td>Charging_system</td><td>1=faulty</td><td>2=okay</td>	
+</tr>
+<tr>
+<td>Battery_voltage</td><td>1=dead</td><td>2=weak</td><td>3=strong</td>
+</tr>
+<tr>
+<td>Battery_age</td><td>1=very old</td><td>2=old</td><td>3=new</td>
+</tr>
+<tr>
+<td>Main_fuse</td><td>1=blown</td><td>2=okay</td>	
+</tr>
+<tr>
+<td>Starter_system</td><td>1=faulty</td><td>2=okay</td>	
+</tr>
+<tr>
+<td>Starter_motor</td><td>1=faulty</td><td>2=okay</td>	
+</tr>
+</table>
+</br>
+</p>
+
+</div>
+</body>
+</html>
diff --git a/sourcecodes/examples/chl_example.php b/sourcecodes/examples/chl_example.php
new file mode 100644
index 00000000..f695ad5c
--- /dev/null
+++ b/sourcecodes/examples/chl_example.php
@@ -0,0 +1,32 @@
+<?php 
+
+$key=$_POST["My_key"];
+if($key=="")
+  $key="ab";//uniqid("");
+
+include("../header_new.inc");
+?>
+<!-- Site navigation menu -->
+<ul class="navbar">
+  <li><a href="../bn_file_load_gom.php">Learn a network model from data</a>
+  <li><a href="../home_upload.php">Make predictions using a known structure</a>  
+  <li><a href="../help.php">Help</a>
+  <li><a href="../faq.php">FAQ</a>
+  <li><a href="../home.php">Home</a>
+
+
+</ul>
+
+<div id="outer">
+<!-- Main content -->
+<br>
+
+<h2>Genetic network of immure response to infection with Chlamydia psittaci [<a href="../example.php?My_key=example_chl|bWR" target="_blank">View network</a>]</h2>
+</br>
+<p>
+  This network models the differential susceptibility to infection with <i>Chlamydia psittaci</i> observed in B6 and D2 mice, as well as in the BXD recombinant inbred strains that have been developed from these parental strains. The model predicts that disease status, as quantified by the weight loss after infection (Weight), is directly influenced by the level of neutrophils and the genotype at the Ctrq3 locus on Chr 11. Macrophage activation status (MAS) is also predicted to influence the level of neutrophils and the pathogen load. This network has been fully described in a previous paper [<a href="http:\\www.ncbi.nlm.nih.gov/pubmed/22438999" target="_blank">PubMed link</a>], in which several predictions made by the model were experimentally validated.</br>
+</br>
+</p>
+</div>
+</body>
+</html>
diff --git a/sourcecodes/examples/my_new_style.css b/sourcecodes/examples/my_new_style.css
new file mode 100644
index 00000000..20db184f
--- /dev/null
+++ b/sourcecodes/examples/my_new_style.css
@@ -0,0 +1,155 @@
+* {
+padding: 0;
+margin: 0;
+}
+html, body {
+height: 100%;
+}
+
+body {
+  margin:0px;
+  font-family: Georgia, "Times New Roman",
+        Times, serif;
+  color: #33339F;
+  background-color: white;
+  padding-bottom:0px; 
+
+}
+
+
+
+.td_title
+{
+        padding: 0;
+        margin: 0;
+        font-family:Arial;
+        font-size:24pt;
+        HRIZONTAL-ALIGN: center;
+        color:#FFFFFF;
+        font-weight:bold;
+        //FONT-STYLE: italic;
+        background-color: #33339F;
+        text-align:center
+
+}
+
+
+
+#outer {
+  padding: 0;
+  margin: 0;
+  position: absolute;
+  top: 9em;
+  left: 12em;
+  text-align:left;
+  background:white;
+  min-width:50%;
+  min-hieght:50%;
+  max-width:70%;
+
+}
+
+#outernew {
+  padding: 0;
+  margin: 0;
+  position: absolute;
+  top: 9em;
+  left: 12em;
+  text-align:left;
+  background:white;
+  min-width:50%;
+  min-hieght:50%;
+  max-width:60%;
+
+}
+
+#outernewnew {
+  padding: 0;
+  margin: 0;
+  position: absolute;
+  top: 12em;
+  left: 25em;
+  text-align:left;
+  background:white;
+  min-width:50%;
+  min-hieght:50%;
+  max-width:60%;
+
+}
+
+
+
+ul.navbar {
+  list-style-type: none;
+  padding: 0;
+  margin: 0;
+  /*position: relative;*/
+  float: top;
+  /*margin-top: 20px;*/
+  top: 9em;
+  left: 1em;
+  width: 9em }
+
+ul.navbar2 {
+  list-style-type: none;
+  padding: 0;
+  margin: 0;
+  /*position: absolute;*/
+  float:top;
+  top: 9em;
+  left: 1em;
+  width: 9em }
+
+ul.listbar {
+  list-style-type: none;
+  padding: 0;
+  margin: 0;
+  position: relative;
+  }
+
+
+
+h1 {
+  font-family: Helvetica, Geneva, Arial,
+        SunSans-Regular, sans-serif }
+ul.navbar li {
+/*  background: #D0A9F5; */
+  background: #33339F;
+  margin: 0.5em 0;
+  padding: 0.3em;
+  border-right: 1em solid black }
+ul.navbar a {
+  text-decoration: none 
+}
+ul.navbar a:link {
+ color: white; }
+ul.navbar a:visited {
+ color: white; }
+
+ul.navbar2 li {
+/*  background: #D0A9F5; */
+  background: black;
+  margin: 0.5em 0;
+  padding: 0.3em;
+  border-right: 1em solid #33339F;
+  color: white }
+ul.navbar2 a {
+  text-decoration: none 
+}
+ul.navbar2 a:link {
+ color: white; }
+ul.navbar2 a:visited {
+ color: white; }
+
+a:link {
+  color: black; }
+a:hover {
+	color: black;
+	}
+a:visited {
+  color: black; }
+address {
+  margin-top: 1em;
+  padding-top: 1em;
+  border-top: thin dotted }
+
diff --git a/sourcecodes/examples/spleen_immune_example.php b/sourcecodes/examples/spleen_immune_example.php
new file mode 100644
index 00000000..89df2c7b
--- /dev/null
+++ b/sourcecodes/examples/spleen_immune_example.php
@@ -0,0 +1,33 @@
+<?php 
+
+$key=$_POST["My_key"];
+if($key=="")
+  $key="ab";//uniqid("");
+
+include("../header_new.inc");
+?>
+<!-- Site navigation menu -->
+<ul class="navbar">
+  <li><a href="../bn_file_load_gom.php">Learn a network model from data</a>
+  <li><a href="../home_upload.php">Make predictions using a known structure</a>  
+  <li><a href="../help.php">Help</a>
+  <li><a href="../faq.php">FAQ</a>
+  <li><a href="../home.php">Home</a>
+
+
+</ul>
+
+<div id="outer">
+<!-- Main content -->
+<br>
+
+<h2>Genetic network of immune-related genes in the spleens of BXD mice [<a href="../example.php?My_key=example_chr2_spleen|cuL" target="_blank">View network</a>]</h2>
+</br>
+<p>
+  This network models how a SNP on Chr 2 impacts the expression of several immune-related genes in BXD mice. To create the network, we selected expression values for genes with an immune-related GO annotation from a microarray dataset that is available in the <a href="http://genenetwork.org" target="_blank">GeneNetwork</a>. The dataset contains gene expression in the spleens of 81 BXD strains and is further described <a href="http://genenetwork.org/webqtl/main.py?FormID=sharinginfo&GN_AccessionId=283" target="_blank">here</a>. Next, we performed QTL mapping of these immune-related gene expression traits and found that many genes mapped near rs3664317, a SNP at 63.69 Mb on Chr 2.<br><br>
+  To make a Bayesian network model of the interactions among the locus and the genes, we created an input file, following the BNW file format, containing the genotype at rs3664317 and the expression of the genes with QTLs at this locus. In the file, which can be downloaded <a href="../example_datasets/spleen_chr2_example_data.txt">here</a>, each row is a BXD strain and each column is a variable (a gene expression trait or the genotype). We coded the genotype to fit the BNW input file format, giving strains with a D genotype a value of 1 for the rs3664317 variable and strains with a B genotype a value of a 2.<br><br> When performing structure learning for this example, we adjusted settings and added constraints using the BNW structural constraint interface. First, we performed model averaging over the 100 highest scoring network structures and set the model averaging selection threshold to 0.9, so that only edges that were in a large majority of high scoring network structures were included. Next, we separated the network variables into 3 tiers: Tier1 contained the genotype at rs3664317, Tier2 contained cis-regulated genes, and Tier3 contained trans-regulated genes. Using the default settings for within and between tier interactions, this method of tier construction prevents trans-regulated genes from being the parents of cis-regulated genes. In this case, only one gene, Ifih1, was cis-regulated by this locus.</br>
+</br>
+</p>
+</div>
+</body>
+</html>
diff --git a/sourcecodes/examples/synthetic_example2.php b/sourcecodes/examples/synthetic_example2.php
new file mode 100644
index 00000000..aed9d357
--- /dev/null
+++ b/sourcecodes/examples/synthetic_example2.php
@@ -0,0 +1,32 @@
+<?php 
+
+$key=$_POST["My_key"];
+if($key=="")
+  $key="ab";//uniqid("");
+
+include("../header_new.inc");
+?>
+<!-- Site navigation menu -->
+<ul class="navbar">
+  <li><a href="../bn_file_load_gom.php">Learn a network model from data</a>
+  <li><a href="../home_upload.php">Make predictions using a known structure</a>  
+  <li><a href="../help.php">Help</a>
+  <li><a href="../faq.php">FAQ</a>
+  <li><a href="../home.php">Home</a>
+
+
+</ul>
+
+<div id="outer">
+<!-- Main content -->
+<br>
+
+<h2>Synthetic genetic network [<a href="../example.php?My_key=example2|hQG" target="_blank">View network</a>]</h2>
+</br>
+<p>
+  This network was created using simulated genetic data. The input data file, which is available <a href="../example_datasets/example_data_8nodes.txt">here</a>, contains 2 genotypes and 6 traits. However, one of the traits (Trait5), is not connected in the network, indicating that it is not influenced by other variables in the dataset and that it does not influence other variables in the network. A complete workflow describing the use of BNW to learn the network structure and make predictions of the resulting model with this dataset is provided in <a href="../BNW_workflow_net1.htm" target="_blank">this tutorial</a>.</br>
+</br>
+</p>
+</div>
+</body>
+</html>
diff --git a/sourcecodes/examples/synthetic_example3.php b/sourcecodes/examples/synthetic_example3.php
new file mode 100644
index 00000000..167132e2
--- /dev/null
+++ b/sourcecodes/examples/synthetic_example3.php
@@ -0,0 +1,34 @@
+<?php 
+
+$key=$_POST["My_key"];
+if($key=="")
+  $key="ab";//uniqid("");
+
+include("../header_new.inc");
+?>
+<!-- Site navigation menu -->
+<ul class="navbar">
+  <li><a href="../bn_file_load_gom.php">Learn a network model from data</a>
+  <li><a href="../home_upload.php">Make predictions using a known structure</a>  
+  <li><a href="../help.php">Help</a>
+  <li><a href="../faq.php">FAQ</a>
+  <li><a href="../home.php">Home</a>
+
+
+</ul>
+
+<div id="outer">
+<!-- Main content -->
+<br>
+
+<h2>Synthetic genetic network with time-series data [<a href="../example.php?My_key=example_time_series|TEb" target="_blank">View network</a>]</h2>
+</br>
+<p>
+This network was created using a simulated time-series genetic dataset that is available <a href="../example_datasets/time_series_example.txt">here</a>. The dataset contains a genotype and the three quantitative traits (TraitA, TraitB, and TraitC) that were each measured at 3 time points (T1, T2, and T3). In this example, T1 might represent the baseline measurement the traits at the time of or shortly before an experimental intervention, while T2 and T3 could represent measurements of the traits in response to the experiment. <br><br>
+When performing structure learning of this dataset, we used the BNW structural constraint interface to provide constraints on the structure to incorporate the prior knowledge provided by the time the data was collected. Specifically, we separated the data into 4 tiers: Tier 1 contained the genotype, Tier2 containted the three traits at time T1, Tier3 containted the traits at time T2, and Tier4 contained the traits at time T3. We maintined the default options for allowing interactions within or between tiers, preventing any traits from being the parent of the genotype and any trait at a later time point from being the parent of an earlier time point. The network shown was learned using a model average of the 100 highest scoring structures.<br><br>
+The network model shows that the genotype consistently influenced TraitA at each of the time points, but that other interactions in the network were dependent on time. The variation in TraitB caused by the genotype could only be observed at time T2, after the experimental intervention, and this influence on TraitB decreased by time T3. There were also time-dependent interactions between the quantitative traits, as TraitB at T2 could be predicted by TraitA at T1 and TraitC at T3 could be predicted by TraitA at T1 and TraitB at T2.</br>
+</br>
+</p>
+</div>
+</body>
+</html>
diff --git a/sourcecodes/execute_bn_gom.php b/sourcecodes/execute_bn_gom.php
new file mode 100644
index 00000000..ead7bd3f
--- /dev/null
+++ b/sourcecodes/execute_bn_gom.php
@@ -0,0 +1,98 @@
+
+<?php 
+$keyval=$_GET["My_key"];
+
+//////////////execute c codes for local score///////////////////
+$dir="./data/";
+
+$pfile="./data/".$keyval."parent.txt";
+$parentf=file_get_contents("$pfile");
+$maxp=trim($parentf);
+
+
+$kfile="./data/".$keyval."k.txt";
+$kf=file_get_contents("$kfile");
+$maxk=trim($kf);
+
+
+
+$thrfile="./data/".$keyval."thr.txt";
+$thr=file_get_contents("$thrfile");
+$thr=trim($thr);
+
+
+//$cmd="./run.sh $keyval $maxp $maxk";
+//system($cmd);
+shell_exec('./run.sh '.$keyval.' '.$maxp.' '.$maxk.' '.$thr);
+
+/////////////////////////////////structure matrix//////////////////////////////////////////////////////////
+
+$matfile=$dir.$keyval."structure_input.txt";
+
+$fout=fopen($dir.$keyval."graphviz.txt","w");
+
+$matrix1=file_get_contents("$matfile");           
+$str_arrmat=array();
+$str_arrmat=explode("\n",$matrix1);
+$datamat=array();
+$data_cell=array(); 
+
+$dataname=array();
+$dataname=explode("\t",$str_arrmat[0]);
+$n=count($dataname);
+
+$initialstring="digraph G {\n"."size=\"10,10\";  ratio = fill;\n"."node [shape=square,width=1.5];\n";
+$endstring="}";
+fwrite($fout,"$initialstring");
+
+$g_file_name="./data/".$keyval."grviz_name_file.txt";
+$grviz_name_file=fopen($g_file_name,"w");
+
+for($i=0;$i<$n;$i++)
+{
+      $row_name=trim($dataname[$i]);  
+      fwrite($grviz_name_file,"$row_name\n");
+}
+
+for($i=1;$i<=$n;$i++)
+{
+         $ii=$i-1; 
+         $row_name=trim($dataname[$ii]);  
+
+         $col_arr=explode("\t",$str_arrmat[$i]);
+        
+        
+	   for($j=0;$j<$n;$j++)
+	   {
+               $col_val=trim($col_arr[$j]);
+               if($col_val==1)
+               { 
+                  $col_name=trim($dataname[$j]);
+                  fprintf($fout,"%s -> %s;\n",$ii,$j);  
+                  //fprintf($fouttemp,"%s -> %s;\n",$row_name,$col_name);
+                 
+	        }
+          }
+          
+     
+} 
+fwrite($fout,"$endstring");   
+fclose($fout);
+
+$file1="./data/".$keyval."run_initialstructure.sh";
+$initiallines=file_get_contents("./data/temp_shell_file_initial_structure");
+$all_lines="$initiallines"."$keyval\nfi\nexit";
+$fp = fopen($file1,"w"); 
+fwrite($fp, "$all_lines\n");
+fclose($fp);
+//prepare and execute shell script for matlab with a write lock
+//$cmd="./runmat.sh $keyval";
+//system($cmd);
+
+shell_exec('./runmat.sh '.$keyval);
+
+?>
+<script>
+window.open("layout.php?My_key=<?php print($keyval);?>",'_self',false);
+</script>
+
diff --git a/sourcecodes/executionprogress.php b/sourcecodes/executionprogress.php
new file mode 100644
index 00000000..99483a02
--- /dev/null
+++ b/sourcecodes/executionprogress.php
@@ -0,0 +1,76 @@
+<?php
+////////////////This code load a data file and creates input file for continuous global optimal search (our modification). execute_bn_gom.php link is for execution of structure learning and create_tiers_gom.php is for adding restrictions///////////////////////////////////
+
+include("header_new.inc");
+include("runtime_check.php");
+
+
+$keyval=$_GET["My_key"];
+$dir="./data/";
+
+//number of parents
+$pfile=$dir.$keyval."parent.txt";
+$parent_number=file_get_contents("$pfile");
+
+
+//number of k for model averaging
+$kfile=$dir.$keyval."k.txt";
+$k_number=file_get_contents("$kfile");
+
+
+$parent_number=trim($parent_number);
+$k_number=trim($k_number);
+
+//////////////////Check execution time///////////////////////////////////////////////
+$runtime=exe_time($keyval,$parent_number,$k_number);
+
+?>
+
+<div>
+<p><h3><?php 
+print("Estimated run time: $runtime seconds");
+?>
+<br><br></h3>
+<br>
+<table align="center"><tr><td><b></br></br></br>Computing ....</b>
+<div style="font-size:20pt;padding:6px;border:solid black 4px">
+<span id="progress1">&nbsp; &nbsp;</span>
+<span id="progress2">&nbsp; &nbsp;</span>
+<span id="progress3">&nbsp; &nbsp;</span>
+<span id="progress4">&nbsp; &nbsp;</span>
+<span id="progress5">&nbsp; &nbsp;</span>
+<span id="progress6">&nbsp; &nbsp;</span>
+<span id="progress7">&nbsp; &nbsp;</span>
+<span id="progress8">&nbsp; &nbsp;</span>
+<span id="progress9">&nbsp; &nbsp;</span>
+<span id="progress10">&nbsp; &nbsp;</span>
+</p>
+</div>
+</td></tr></table>
+
+<script language="javascript">
+<!-- Begin Script
+var progressEnd = 10;	// set to number of progress <span>'s.
+var progressColor = 'blue';	// set to progress bar color
+var progressInterval = 1000;	// set to time between updates (milli-seconds)
+
+var progressAt = progressEnd;
+var progressTimer;
+function progress_clear() {
+for (var i = 1; i <= progressEnd; i++) document.getElementById('progress'+i).style.backgroundColor = 'transparent';
+progressAt = 0;
+}
+function progress_update() {
+progressAt++;
+if (progressAt > progressEnd) progress_clear();
+else document.getElementById('progress'+progressAt).style.backgroundColor = progressColor;
+progressTimer = setTimeout('progress_update()',progressInterval);
+}
+// End -->
+
+progress_update();	
+</script>
+</div>
+<script>
+window.open("execute_bn_gom.php?My_key=<?php print($keyval);?>",'_self',false);
+</script>
diff --git a/sourcecodes/faq.php b/sourcecodes/faq.php
new file mode 100644
index 00000000..65926f33
--- /dev/null
+++ b/sourcecodes/faq.php
@@ -0,0 +1,161 @@
+<?php
+
+$key=$_POST["My_key"];
+if($key=="")
+  $key="ab";//uniqid("");
+
+include("header_new.inc");
+?>
+
+<!-- Site navigation menu -->
+<ul class="navbar">
+  <li><a href="bn_file_load_gom.php">Learn a network model from data</a>
+  <li><a href="home_upload.php">Make predictions using a known structure</a>  
+  <li><a href="workflow.php">Tutorials and examples</a>
+  <li><a href="help.php">Help</a>
+  <li><a href="faq.php">FAQ</a>
+  <li><a href="home.php">Home</a>
+</ul>
+
+
+<!-- Main content -->
+<div id="outer">
+
+<table width=100% align=center>
+<tr>
+<td>
+<h2>Frequently Asked Questions</h2>
+<ol>
+<li><a href="#default_setting">What are the default settings for structure learning in BNW?</a>
+<li><a href="#size_limits">Are there limits on network sizes in BNW?</a>
+<li><a href="#input_files">What input files do I need to use BNW?</a>
+<li><a href="#tier_examples">What are some examples of using tier assignments to incorporate prior knownledge in structure learning?</a>
+<li><a href="#evid_inter">What is the difference between the evidence and intervention prediction modes?</a>
+<li><a href="#unconnected">Why are nodes missing from the network or why does the network consist of separate, unconnected parts?</a>
+<li><a href="#old_model">Can I restore a previous session containing a model in BNW?</a>
+<li><a href="#browser_use">Which browser should I use when accessing BNW?</a>
+
+</ol>
+</td>
+</tr>
+</table>
+
+
+<br>
+<table>
+<tr>
+<a name=default_settings><h3>1. What are the default settings for structure learning in BNW?</h3></a>
+</tr>
+<br>
+<tr><td>
+  <p align="justify">By default, structure learning is performed with the maximum number of parents for every node in the network set to 4 and <i>k</i>, the number of best scoring structures to include in model averaging, set to 1 (i.e., no model averaging is performed). 
+</td></tr>
+</table>
+
+<br>
+<table>
+<tr>
+<a name=size_limits><h3>2. Are there any limits on network sizes when using BNW?</h3></a>
+</tr>
+<br>
+<tr><td>
+  <p align="justify">The most computationally expensive step in BNW is structure learning, and BNW limits the size of datasets that can be used for structure learning. Currently, the maximum number of nodes when performing structure learning in BNW is 19, and the maximum number of samples is 10,000. We also estimate the time required for structure learning based on the input file size and the structure learning options provided by the user. Structure learning of networks on BNW should complete within approximately 10 minutes. For longer structure learning jobs, a structure learning package which is written in C is also available for <a href="../downloads/BNW_src_files.tar">download</a>. The network structure file provided as output by the package can be loaded into BNW for use with the BNW graphical prediction interface. Alternately, users can reduce the computational cost associated with structure learning by reducing the maximum number of parents for each node or the value of <i>k</i> used in model averaging.
+</td></tr>
+</table>
+
+
+<br>
+<table>
+<tr>
+<a name=input_files><h3>3. What input files do I need to use BNW?</h3></a>
+</tr>
+<br>
+<tr><td>
+  <p align="justify">If you want to learn the network structure from a dataset, the only input file required for BNW is a text file where each row is a sample of the dataset. If you already know the network structure, you need two input files, one containing the structure and one containing the data. The format of these files is more fully described <a href="help.php#file_format">here</a>.<br> 
+</td></tr>
+</table>
+
+<br>
+<table>
+<tr>
+<a name=tier_examples><h3>4. What are some examples of using tier assignments to incorporate prior knownledge in structure learning?</h3></a>
+</tr>
+<br>
+<tr><td>
+  <p align="justify">Examples of assigning nodes to tiers are given below. Additionally, a tutorial with examples of using the structural constraint interface is available <a href="BNW_workflow_sci.htm">here</a>.<br><br><u>Example 1: A genetic network linking genotype and phenotype</u><br>Bayesian network modeling can be used to understand the biological processes that link genotype with phenotypes. For example, consider a dataset than contains three types of data: genotypes; molecular level phenotypes, such as gene expression traits; and higher order phenotypes. This network could be organized into three tiers. Tier 1 would contain the genotypes, Tier 2 would contain the molecular level phenotypes, and Tier 3 would contain the higher order phenotypes. In many cases, biologically relevant network models start with genotypes and terminate with higher order phenotypes, and the BNW structural constraint interface can be used to include this prior knowledge when performing structure learning. By default, the structural constraint interface would allow directed edges from genotype (Tier 1) nodes to both types of phenotype nodes (Tier 2 and Tier 3) and from the molecular level phenotypes (Tier 2) to the higher order phenotypes (Tier 3). It would also allow directed edges between nodes in the same tier. Depending on the specifics of their dataset, users may want to prevent directed edges between nodes within Tier 1 (i.e., prevent innate genotype nodes from being caused by other genotype nodes) or prevent Tier 1 nodes from being the immediate parents of Tier 3 nodes, which would require that molecular level phenotypes intervene between the genotypes and higher order phenotypes.<br><br>
+<u>Example 2: Time series data</u><br>
+While it does not fully support dynamic Bayesian network modeling, BNW can be used for modeling of time-series datasets and time-order information can be incorporated with the structural constraint interface. Data at each time point can be grouped into a tier and these tiers can be used to provide constraints on the network structure. For example, data from the second time point can be placed in a tier that cannot be the parents of a tier containing data from the first time point but can be the parents of tiers containing data from all subsequent time points.<br>
+</td></tr>
+</table>
+
+
+<br>
+<table>
+<tr>
+<a name=evid_inter><h3>5. What is the difference between the evidence and intervention prediction modes?</h3></a>
+</tr>
+<br>
+<tr><td>
+  <p align="justify">To compare the evidence and intervention prediction modes, consider a genetic network model that was learned for a set of mouse strains:<br>
+<u>Evidence</u>: The evidence mode can be used to predict data generated for a new set of strains which would be useful for testing the model or for estimating gene expression data that may be experimentally missing. For example, the model may predict that high expression of Gene1 results in high expression of Gene2, and this prediction can be tested by measuring the expression levels of Gene1 and Gene2 in the new set of strains. Then, the predicted expression of Gene2 from the network model given the observed expression of Gene1 for each of the new strains can be compared with the actual observed values of Gene2.<br>
+<u>Intervention</u>: In contrast, the intervention mode is appropriate for cases when you are not passively observing network interactions, but instead are experimentally perturbing the network. Again, consider a case in which the model predicts that high expression of Gene1 results in high expression of Gene2. To intervene on the network, a treatment that is known to cause high expression of Gene1 could be given. This treatment will cause all of the strains to have high expression of Gene1, and it will no longer be dependent on its parents in the original model. Also, the model will predict that Gene2 should have high expression in all strains. The expression levels of Gene2 in treated strains can be measure to test this predicted effect of intervention.<br> 
+</td></tr>
+</table>
+
+
+<br>
+<table>
+<tr>
+<a name=unconnected><h3>6. Why are variables missing from the network or why does the network consist of separate, unconnected parts?</h3></a>
+</tr>
+<br>
+<tr><td>
+  <p align="justify">After structure learning, it is possible that all variables will not be connected within a single network. Some variables may not be found to be associated with any other variables in the input dataset and may be left out of any network model, or there may be two or more distinct networks. In these cases, the highest scoring network model did not have all variables in a single network given the data and our scoring metric. To our knowledge, parameter learning and predictions with these unconnected models should still work correctly, but this has not been tested extensively.<br> 
+</td></tr>
+</table>
+
+<br>
+<table>
+<tr>
+<a name=unconnected><h3>7. Can I restore a previous session containing a model in BNW?</h3></a>
+</tr>
+<br>
+<tr><td>
+<p align="justify">While there is no current method to automatically restore a previous session of BNW, users have the option of downloading a file that contains the structure of their model. This file can be loaded in BNW on return visits to the site, allowing them to skip the potentially time consuming structure learning step. To download the structure matrix file after structure learning of the dataset for the first time, click on "Display structure matrix" on the left side of the prediction interface, scroll to the bottom of the popup window, and click "Download". This file and the original input data file and then be loaded into BNW by clicking "Make predictions using a known structure" on the BNW home page.<br> 
+</td></tr>
+</table>
+<br>
+
+
+<table>
+<tr>
+<a name=browser_use><h3>8. Which browser should I use when acessing BNW?</h3></a>
+</tr>
+<br>
+<tr><td>
+  <p align="justify"> We are aware that the structural constraint interface does not display or operate correctly using Internet Explorer. This seems to be due to IE not supporting HTML5 drag-and-drop functions, and we have not noticed any problems with this interface using other web browsers. The majority of testing of BNW has been performed using recent versions of Google Chrome and Mozilla Firefox web browsers on computers with Windows operating systems. We have also done used several browers on Linux and Apple computers and have not noticed problems.<br>
+</p>
+</td>
+</tr>
+</table>
+<br>
+
+
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+</div>
+</html>
diff --git a/sourcecodes/filecopy.sh b/sourcecodes/filecopy.sh
new file mode 100644
index 00000000..15ce4e24
--- /dev/null
+++ b/sourcecodes/filecopy.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+cd ./data/
+FILES=$1*
+for f in $FILES
+do
+  #echo "Processing $f file..."
+  new=${f//$1/$2} 
+  # take action on each file. $f store current file name
+  #echo "new Processing $new file..."
+  cp $f $new
+done
\ No newline at end of file
diff --git a/sourcecodes/getting_started.php b/sourcecodes/getting_started.php
new file mode 100644
index 00000000..15652b91
--- /dev/null
+++ b/sourcecodes/getting_started.php
@@ -0,0 +1,33 @@
+<?php 
+
+include("header_new.inc");
+?>
+
+<!-- Site navigation menu -->
+<ul class="navbar">
+  <li><a href="bn_file_load_gom.php">Learn a network model from data</a>
+  <li><a href="home_upload.php">Make predictions using a known structure</a>  
+  <li><a href="workflow.php">Tutorials and examples</a>
+  <li><a href="help.php">Help</a>
+  <li><a href="faq.php">FAQ</a>
+  <li><a href="home.php">Home</a>
+
+
+</ul>
+
+
+<!-- Main content -->
+<div id="outer">
+<h1>Getting Started with BNW</h1>
+<br>
+    <p align="justify">The Bayesian Network Webserver (BNW) is designed to be a comprehensive tool for Bayesian network modeling of biological datasets. It should allow users to, within seconds or minutes, go from having a simply formatted input file containing a dataset to using a network model to make predictions about the interactions between variables and the potential effects of experimental interventions. New users of BNW may want to start by following <a href="BNW_workflow_net1.htm">this tutorial</a> which uses an example dataset that is used to create a genetic network. An additional <a href="BNW_workflow_sci.htm">tutorial</a> provides an introduction to using the BNW structural constraint interface. Several example networks using real and synthetic data are available <a href="workflow.php">here</a>.<br>
+<br>
+BNW also provides a <a href="help.php">help</a> page that provides an overview of the use of BNW as well as a <a href="faq.php">FAQ</a> page that addresses specific questions.
+<br>
+<br>
+    To begin modeling your own data, prepare an input file following these <a href="help.php#file_format">file formatting guidelines</a>, upload the file <a href="bn_file_load_gom.php">here</a> to learn the network structure that best explains the data, and begin using it to make predictions. If you already know the structure of your network, you can upload files containing your data and the network structure <a href="home_upload.php">here</a>.
+</p>
+<br>
+</div>
+</body>
+</html>
diff --git a/sourcecodes/graphviz_structure.php b/sourcecodes/graphviz_structure.php
new file mode 100644
index 00000000..251c7557
--- /dev/null
+++ b/sourcecodes/graphviz_structure.php
@@ -0,0 +1,97 @@
+<script language="JavaScript">
+<!--
+function calcHeight()
+{
+  //find the height of the internal page
+  var the_height=
+    document.getElementById('the_iframe').contentWindow.
+      document.body.scrollHeight;
+
+  //change the height of the iframe
+  document.getElementById('the_iframe').height=
+      the_height;
+}
+//-->
+</script>
+
+
+<?php 
+include("header_new.inc");
+$keyval=$_GET["My_key"];
+
+/////////////////////////////////structure matrix//////////////////////////////////////////////////////////
+
+
+$matfile="./data/".$keyval."structure_input.txt";
+$fout=fopen("./data/".$keyval."graphviz.txt","w");
+
+$matrix1=file_get_contents("$matfile");           
+$str_arrmat=array();
+$str_arrmat=explode("\n",$matrix1);
+$datamat=array();
+$data_cell=array(); 
+
+$dataname=array();
+$dataname=explode("\t",$str_arrmat[0]);
+$n=count($dataname);
+
+$initialstring="digraph G {\n"."size=\"10,10\";  ratio = fill;\n"."node [shape=square,width=1.5];\n";
+$endstring="}";
+fwrite($fout,"$initialstring");
+//fwrite($fouttemp,"$initialstring_temp");
+
+
+$g_file_name="./data/".$keyval."grviz_name_file.txt";
+$grviz_name_file=fopen($g_file_name,"w");
+
+for($i=0;$i<$n;$i++)
+{
+      $row_name=trim($dataname[$i]);  
+      fwrite($grviz_name_file,"$row_name\n");
+}
+
+for($i=1;$i<=$n;$i++)
+{
+         $ii=$i-1; 
+         $row_name=trim($dataname[$ii]);  
+
+ 
+         $col_arr=explode("\t",$str_arrmat[$i]);
+        
+        
+	   for($j=0;$j<$n;$j++)
+	   {
+               $col_val=trim($col_arr[$j]);
+               if($col_val==1)
+               { 
+                  $col_name=trim($dataname[$j]);
+                  fprintf($fout,"%s -> %s;\n",$ii,$j);  
+                  //fprintf($fouttemp,"%s -> %s;\n",$row_name,$col_name);
+                 
+	        }
+          }
+          
+     
+} 
+fwrite($fout,"$endstring");   
+//fwrite($fouttemp,"$endstring");
+ 
+//shell_exec('/usr/bin/dot -Tpng -o /var/www/html/compbio/BNW/graphviz.jpg /var/www/html/compbio/BNW/graphviztemp.txt');
+
+$file1="./data/".$keyval."run_initialstructure.sh";
+$initiallines=file_get_contents("./data/temp_shell_file_initial_structure");
+$all_lines="$initiallines"."$keyval\nfi\nexit";
+$fp = fopen($file1,"w"); 
+fwrite($fp, "$all_lines\n");
+fclose($fp);
+//prepare and execute shell script for matlab with a write lock
+//$cmd="./runmat.sh $keyval";
+//system($cmd);
+shell_exec('./runmat.sh '.$keyval);
+?>
+<script>
+window.open("layout.php?My_key=<?php print($keyval);?>",'_self',false);
+</script>
+
+
+
diff --git a/sourcecodes/header_batchsearch.inc b/sourcecodes/header_batchsearch.inc
new file mode 100644
index 00000000..9cf50178
--- /dev/null
+++ b/sourcecodes/header_batchsearch.inc
@@ -0,0 +1,242 @@
+<html>
+<head>
+<LINK REL=StyleSheet HREF="./my_style.css" TYPE="text/css">
+<script language="JavaScript">
+<!-- hide
+
+function demo_str()
+{
+    with(window.document.key_search)
+    {
+       searchkey.value="Genotype\tGene1\tGene2\tGene3\tPhenotype\n0\t1\t0\t1\t0\n0\t0\t1\t0\t0\n0\t0\t0\t0\t1\n0\t0\t0\t0\t1\n0\t0\t0\t0\t0\n"; 
+    }
+}
+
+function demo()
+{
+  with(window.document.key_search)
+  {
+
+      // searchkey.value="Genotype\tGene1\tGene2\tGene3\tPhenotype\n9.287\t9.191\t9.206\t9.285\t9.284\n10.039\t9.976\t10.129\t9.985\t10.055\n9.785\t9.852\t9.955\t9.972\t10.067\n8.529\t8.663\t8.707\t8.691\t8.743\n9.122\t9.057\t9.139\t9.067\t9.065\n8.964\t8.888\t8.879\t8.887\t8.803\n10.264\t10.317\t10.406\t10.344\t10.26\n9.089\t9.017\t9.121\t9.072\t9.021\n9.329\t9.321\t9.408\t9.398\t9.363\n9.47\t9.112\t9.399\t9.423\t9.481\n8.575\t8.404\t8.39\t8.554\t8.523\n9.093\t8.89\t9.092\t9.028\t9.016\n8.421\t8.375\t8.467\t8.439\t8.436\n9.678\t9.522\t9.65\t9.517\t9.679\n8.114\t8.38\t8.387\t8.324\t8.344\n8.447\t8.341\t8.731\t8.262\t8.675\n9.522\t9.488\t9.612\t9.505\t9.569\n10.742\t10.597\t10.76\t10.566\t10.668\n9.266\t9.292\t9.37\t9.219\t9.454\n8.052\t8.358\t8.311\t8.225\t8.29\n9.82\t9.655\t9.788\t9.805\t9.75\n9.343\t9.473\t9.513\t9.601\t9.454\n10.249\t10.208\t10.24\t10.089\t10.29\n8.612\t8.472\t8.565\t8.586\t8.528\n8.749\t7.892\t8.736\t7.965\t8.711\n9.54\t9.584\t9.678\t9.807\t9.65\n9.327\t9.233\t9.316\t9.416\t9.341\n9.005\t8.718\t9.03\t8.952\t9.163\n9.356\t9.112\t9.28\t9.184\t9.255\n9.712\t9.362\t9.554\t9.566\t9.533\n9.369\t9.504\t9.519\t9.589\t9.529\n11.104\t10.966\t11.056\t11.224\t11.122\n9.689\t9.61\t9.715\t9.707\t9.739\n9.512\t9.241\t9.343\t9.362\t9.391\n9.21\t9.025\t9.231\t9.196\t9.109\n8.607\t8.753\t8.85\t8.822\t8.778\n9.762\t9.782\t9.783\t9.822\t9.812\n8.881\t8.764\t8.897\t8.816\t8.85\n9.368\t9.401\t9.435\t9.348\t9.487\n8.65\t8.489\t8.619\t8.606\t8.586\n8.58\t8.708\t8.468\t8.77\t8.452\n9.444\t9.279\t9.423\t9.445\t9.403\n8.656\t8.744\t8.755\t8.714\t8.704\n9.628\t9.372\t9.522\t9.379\t9.442\n9.586\t9.525\t9.67\t9.638\t9.562\n8.363\t8.363\t8.414\t8.455\t8.343\n11.008\t10.678\t10.886\t10.953\t10.696\n9.148\t9.058\t9.197\t9.185\t9.131\n8.936\t8.9\t8.909\t9.036\t8.808\n9.244\t9.13\t9.177\t9.321\t9.311\n7.707\t7.75\t7.752\t7.802\t7.704\n8.917\t8.785\t8.953\t8.871\t8.805\n9.121\t8.95\t9.031\t9.029\t9.018\n9.635\t9.615\t9.788\t9.662\t9.752\n9.214\t9.401\t9.565\t9.44\t9.504\n8.408\t8.47\t8.577\t8.496\t8.418\n9.252\t9.347\t9.432\t9.394\t9.443\n9.615\t9.43\t9.564\t9.399\t9.528\n9.202\t8.755\t9.124\t8.915\t8.954\n9.558\t9.736\t9.69\t9.813\t9.707\n9.066\t9.094\t9.027\t9.055\t9.067\n8.607\t8.516\t8.635\t8.661\t8.557\n9.266\t9.073\t9.141\t9.131\t9.078\n9.074\t8.944\t9.082\t9.075\t8.962\n10.191\t10.084\t10.192\t10.215\t10.222\n9.116\t8.656\t9.057\t9.007\t9.01\n10.25\t9.957\t10.151\t10.131\t10.095\n9.159\t9.196\t9.584\t9.291\t9.239\n8.397\t8.502\t8.453\t8.559\t8.598\n9.176\t9.095\t9.255\t9.256\t9.249\n9.648\t9.584\t9.788\t9.801\t9.652\n9.055\t9.151\t9.097\t9.169\t9.103\n8.799\t8.522\t8.756\t8.649\t8.712\n9.457\t9.062\t9.387\t9.363\t9.233\n9.389\t9.161\t9.316\t9.288\t9.353\n8.349\t8.54\t8.57\t8.555\t8.512\n9.708\t9.586\t9.688\t9.69\t9.731\n8.853\t9.128\t9.107\t9.152\t9.131\n9.349\t9.14\t9.28\t9.304\t9.318\n9.151\t9.131\t9.229\t9.305\t9.276\n8.471\t8.224\t8.394\t8.327\t8.393\n9.549\t9.661\t9.642\t9.717\t9.553\n9.74\t9.685\t9.838\t9.909\t9.876\n9.906\t9.706\t9.929\t9.822\t9.776\n9.261\t8.994\t9.154\t8.996\t9.208\n9.805\t9.613\t9.693\t9.644\t9.654\n8.806\t8.692\t8.857\t8.739\t8.899\n8.98\t8.627\t8.818\t8.669\t8.773\n8.396\t8.534\t8.574\t8.512\t8.579\n9.193\t9.079\t9.23\t9.038\t9.171\n9.255\t9.153\t9.321\t9.166\t9.102\n9.025\t8.98\t9.242\t9.116\t8.959\n9.142\t9.066\t9.254\t9.183\t9.067\n9.361\t9.204\t9.277\t9.251\t9.2\n";
+searchkey.value="Genotype\tGene1\tGene2\tGene3\tPhenotype\n2\t0.14036\t-1.9418\t-0.42948\t0.25915\n1\t-0.51633\t2.0851\t0.36011\t-1.4461\n2\t1.2073\t-0.66507\t-1.0782\t0.25577\n1\t-1.3816\t0.0015871\t1.6678\t-1.0284\n1\t0.02627\t-0.25511\t1.386\t-0.72776\n2\t1.4749\t-1.0507\t-1.1886\t0.5869\n1\t-0.81364\t0.15985\t1.3432\t-0.88628\n2\t0.66482\t0.37888\t-1.0411\t0.41452\n2\t0.74691\t-0.79568\t0.043531\t0.83479\n1\t-0.13122\t-0.2089\t1.0839\t0.26364\n1\t0.10727\t1.0991\t0.46907\t0.089453\n1\t-1.3152\t-0.96453\t0.1134\t0.76625\n2\t1.3244\t-1.2513\t-0.75496\t0.17869\n1\t-1.0526\t1.0432\t0.41152\t-1.2805\n1\t-0.97163\t0.048348\t1.2317\t-0.57484\n2\t1.6526\t-0.84306\t-0.58025\t1.0336\n2\t1.3678\t0.30984\t-0.8071\t0.2227\n2\t0.68011\t-0.40842\t-0.42178\t0.48112\n2\t1.7573\t-0.81682\t-1.1508\t1.2448\n1\t-0.38513\t0.87495\t0.62368\t-0.3029\n2\t1.6804\t-0.79057\t-0.54125\t0.86227\n1\t-0.8\t1.4548\t0.38404\t-0.61435\n1\t-0.4981\t0.77635\t-0.84664\t0.2084\n1\t-1.1284\t0.6439\t-1.346\t-0.69702\n1\t-1.1604\t-0.24286\t-1.1865\t0.84499\n1\t-0.46941\t0.90822\t0.42266\t-0.60657\n1\t-1.4694\t0.8425\t1.322\t-0.20931\n1\t-1.5602\t1.0644\t0.77609\t-1.0143\n1\t0.73219\t-2.3196\t-0.051471\t0.51013\n1\t-0.33907\t0.31261\t-0.23894\t0.34665\n2\t1.4875\t-1.2278\t-0.3665\t1.1055\n2\t1.7778\t-0.13868\t-0.79405\t-0.17391\n1\t-1.0143\t0.15579\t0.94312\t-0.81445\n1\t-0.79556\t0.34673\t0.80697\t-1.0352\n2\t1.0902\t0.40553\t-0.90835\t0.18326\n1\t-1.4082\t1.0887\t0.19177\t-0.37926\n1\t0.65948\t-0.29631\t1.4025\t-0.6577\n1\t-0.10541\t0.50632\t-0.62135\t-0.69439\n1\t-1.4274\t0.8999\t0.040714\t-0.64084\n1\t-0.049221\t0.37995\t0.34105\t0.14789\n1\t-0.27827\t0.44415\t0.75087\t-0.94544\n1\t-0.86182\t-0.20052\t-0.69887\t0.9523\n1\t-0.64715\t-0.57779\t0.14728\t-1.378\n1\t-1.4341\t0.047062\t0.22559\t-0.29402\n2\t0.63681\t-0.57975\t-1.4907\t0.78349\n1\t-0.51958\t0.99085\t0.80223\t-1.224\n1\t0.37793\t1.4098\t0.53726\t-1.4404\n2\t0.62224\t-0.74639\t-0.43616\t-0.10073\n1\t-0.27451\t0.48363\t0.51358\t-0.2455\n2\t1.7129\t-1.4765\t-0.46897\t1.0381\n1\t-1.2877\t1.2851\t0.094527\t-0.65207\n1\t-1.5119\t1.0398\t0.36671\t-0.099971\n2\t1.7707\t-1.6549\t-1.2189\t0.7862\n2\t2.9819\t-1.2002\t-1.1488\t1.5639\n1\t-1.4328\t1.428\t-0.30167\t-0.39427\n2\t1.3157\t-0.044003\t-1.5064\t1.0888\n2\t1.4134\t-2.0733\t-0.90404\t1.2135\n2\t1.3233\t-0.46672\t-0.97303\t0.41323\n1\t-0.0027834\t-1.4766\t0.23116\t0.74087\n1\t-0.23902\t0.085836\t-0.45144\t0.25977\n1\t-0.7959\t-0.092194\t0.48212\t-1.0995\n1\t-0.87981\t-0.2021\t1.0342\t-0.77157\n1\t0.073991\t-0.16933\t0.68415\t0.059864\n1\t-0.19906\t-0.88838\t1.4616\t-0.77209\n1\t0.33053\t-0.24742\t0.84394\t-0.47337\n1\t-2.4677\t1.9733\t0.15703\t-1.1391\n1\t-1.4296\t0.27178\t1.4961\t-0.57637\n1\t-1.9217\t0.69186\t0.62457\t-0.18303\n1\t-1.2431\t0.98661\t-0.66998\t-0.62435\n1\t-1.3104\t0.56634\t-0.41563\t-0.21244\n1\t-0.79584\t0.073539\t1.5764\t-0.5129\n1\t-1.4595\t-0.42548\t-1.4099\t2.1827\n2\t1.2151\t-1.5028\t-1.3091\t1.6489\n2\t-0.14578\t-0.27147\t-0.853\t-0.42563\n2\t0.74643\t1.0798\t-0.98467\t0.15834\n1\t-0.93086\t-0.3765\t0.79132\t0.43374\n1\t-0.26466\t-0.24432\t0.52009\t0.4509\n1\t-1.1895\t0.026542\t0.26611\t-0.23827\n1\t-0.42519\t1.2643\t0.1902\t-0.81237\n1\t-1.0248\t-0.49955\t0.064074\t0.47088\n2\t2.2907\t-1.4612\t-0.95431\t1.5863\n2\t1.5697\t-0.3165\t-1.4525\t1.136\n1\t-1.0159\t0.053298\t1.6214\t-1.2228\n1\t-0.40383\t1.8453\t0.4486\t-0.97178\n1\t0.5124\t-0.20628\t0.91974\t-0.82012\n2\t1.3073\t-1.7029\t-0.79974\t1.0053\n1\t-0.69588\t0.26406\t-0.53979\t-0.021947\n1\t-0.08423\t0.66182\t2.0539\t-1.9058\n2\t2.1006\t-1.12\t-0.94615\t0.67055\n2\t0.5511\t-0.69758\t-0.43734\t0.77074\n2\t1.3879\t-1.1487\t-1.0375\t1.4641\n1\t0.20633\t0.50759\t0.69341\t-0.58827\n1\t1.6753\t-1.0901\t-1.0288\t1.9808\n1\t-0.94533\t2.6526\t0.93921\t-1.6151\n1\t-1.2071\t-0.68996\t0.029818\t-0.19476\n2\t0.81414\t0.92509\t-0.1681\t-0.28887\n1\t0.18468\t-1.0249\t1.0538\t-0.34692\n1\t-0.96033\t1.0327\t-0.30184\t-0.8787\n2\t0.74032\t-0.15363\t-0.96792\t0.68449\n1\t-0.24615\t1.6257\t1.3952\t-1.0348\n";
+   }
+}
+
+
+function demo1()
+{
+  with(window.document.key_search)
+  {
+
+searchkey.value="Gene1\tGene2\tGene3\tPhenotype\n2\t2\t1\t1\n2\t2\t1\t2\n1\t1\t2\t2\n1\t1\t2\t2\n2\t1\t1\t1\n1\t1\t2\t2\n1\t1\t2\t2\n2\t2\t1\t1\n2\t1\t2\t2\n1\t1\t2\t2\n1\t2\t2\t2\n2\t1\t2\t2\n2\t1\t1\t1\n1\t1\t2\t2\n2\t2\t1\t1\n2\t2\t1\t1\n1\t1\t2\t2\n2\t2\t1\t1\n2\t2\t1\t1\n1\t1\t2\t2\n1\t2\t1\t1\n1\t1\t2\t2\n2\t2\t2\t1\n2\t1\t1\t1\n2\t1\t1\t1\n2\t2\t1\t1\n2\t2\t1\t1\n1\t1\t2\t2\n2\t2\t1\t1\n2\t2\t1\t1\n2\t2\t1\t2\n2\t2\t1\t1\n2\t1\t1\t2\n2\t2\t2\t2\n1\t1\t2\t2\n1\t1\t2\t2\n2\t2\t2\t1\n1\t1\t2\t2\n2\t2\t1\t1\n2\t1\t2\t1\n1\t2\t1\t2\n1\t2\t2\t1\n2\t2\t1\t1\n2\t2\t2\t1\n2\t2\t1\t1\n1\t1\t2\t2\n2\t2\t1\t1\n1\t1\t2\t2\n1\t1\t2\t2\n1\t1\t2\t2\n2\t1\t1\t1\n2\t2\t1\t1\n2\t1\t1\t1\n2\t2\t2\t1\n1\t1\t2\t2\n1\t2\t1\t1\n1\t1\t2\t2\n2\t2\t1\t1\n1\t1\t2\t2\n1\t1\t2\t2\n2\t1\t1\t2\n2\t2\t1\t2\n1\t1\t1\t2\n2\t1\t2\t2\n1\t1\t2\t2\n2\t2\t1\t1\n2\t1\t2\t2\n1\t1\t2\t2\n1\t1\t2\t2\n1\t1\t2\t2\n2\t2\t1\t1\n1\t1\t2\t2\n1\t1\t2\t2\n1\t1\t2\t2\n2\t2\t1\t1\n1\t1\t2\t2\n2\t2\t1\t1\n1\t1\t2\t2\n1\t1\t2\t2\n1\t1\t2\t2\n1\t1\t2\t2\n2\t2\t1\t2\n2\t1\t2\t2\n1\t1\t2\t2\n2\t2\t1\t1\n2\t2\t1\t1\n1\t1\t2\t2\n2\t2\t1\t2\n1\t1\t2\t2\n2\t2\t1\t2\n2\t2\t1\t1\n2\t2\t1\t1\n1\t1\t2\t2\n2\t2\t1\t1\n1\t2\t1\t1\n2\t2\t1\t2\n1\t1\t2\t2\n1\t1\t2\t2\n1\t1\t1\t2\n1\t2\t2\t2";
+   }
+}
+
+function demo2()
+{
+  with(window.document.key_search)
+  {
+    searchkey.value="GenotypeA\tGenotypeB\tGene1\tGene2\tGene3\tGene4\n1\t1\t0.0735451012188\t0.807744827105\t-0.141557122166\t0.871977046116\n2\t1\t0.0783291492541\t0.784023461068\t0.501395957396\t1.20598627055\n2\t1\t0.786243065384\t0.978600201012\t1.10615045137\t0.91427570527\n2\t1\t-0.133165253244\t1.09368397217\t0.943147613583\t1.28625182746\n2\t1\t0.849732696834\t0.701697179341\t1.1597647359\t1.10898527576\n2\t1\t0.117358779641\t1.27641582521\t1.07600246132\t0.837957699405\n1\t2\t0.260845541489\t0.126507267356\t0.134953769296\t1.05166904426\n2\t1\t0.277734881926\t1.07193390309\t0.282304188176\t1.11305323003\n1\t2\t0.23482774261\t1.22992089679\t0.0929753295409\t1.16341704702\n1\t2\t0.948183366714\t0.133267523413\t-0.218162396333\t0.906540379337\n2\t1\t-0.116613369121\t1.14203606435\t0.109901766308\t0.729527128692\n1\t1\t-0.179825551391\t0.10619275827\t0.937787825497\t1.03567603615\n2\t1\t0.293022973091\t1.08721255661\t-0.175473007708\t0.887010836361\n2\t1\t-0.0489346771642\t0.968137836317\t0.107834185199\t0.896061918536\n1\t2\t0.236140871956\t-0.0428030926592\t-0.318492104268\t0.570552965391\n2\t2\t-0.0800211950407\t0.69984329873\t0.188143588172\t1.31042305844\n1\t1\t-0.0036838396465\t0.115049518621\t1.23342471413\t-0.0310668924648\n1\t2\t0.821596343182\t-0.206883091797\t-0.176745465075\t1.00503814188\n2\t1\t0.968136985881\t0.17393492998\t1.10355204542\t1.50730341194\n1\t1\t-0.2529273487\t1.15825296446\t-0.296758267158\t0.334353609539\n2\t2\t0.996924729837\t0.79867304131\t-0.0654588195254\t1.14114632703\n1\t1\t1.11517699739\t1.04475472944\t1.01515337419\t-0.114835981744\n1\t1\t1.13306628335\t0.212806963119\t-0.331850695159\t1.3262481351\n2\t1\t-0.202717212277\t1.16180466017\t0.698481134231\t0.837229654056\n2\t1\t1.09703628172\t0.988374730515\t0.632905281073\t0.871944778559\n1\t1\t0.0877178138353\t0.92193353301\t0.0882061186606\t-0.109998053824\n2\t2\t-0.0465657805556\t1.0562741142\t0.203076906226\t0.947081854544\n1\t1\t0.253626344342\t0.774666759107\t0.160237735682\t0.137119974017\n2\t2\t0.958504778114\t0.696202219462\t0.837104986151\t1.22862239026\n2\t1\t0.0190762231091\t1.07363361357\t0.836517352782\t1.13138357074\n1\t2\t1.04546343625\t1.22248653304\t-0.177641501681\t0.938273372293\n1\t1\t-0.356538939133\t0.926691569307\t-0.0141334158342\t-0.333256032191\n2\t2\t-0.271616290794\t1.02237907773\t-0.0893323176884\t1.13812703435\n1\t1\t0.112310230451\t0.96903715979\t0.735229019751\t0.0718376819618\n2\t2\t-0.0541760888203\t0.910562906664\t0.237421737724\t1.12792106072\n2\t1\t0.140510085427\t1.14598129626\t0.684754216604\t1.37711161908\n1\t2\t0.673132921769\t1.16156481777\t0.828299174842\t1.23484148864\n1\t1\t-0.36576911038\t1.22402806897\t0.985794473424\t0.371258195776\n2\t1\t1.30745593323\t-0.305709792671\t1.18778090128\t0.773246386727\n2\t2\t-0.530650832006\t1.12852174836\t-0.242830565653\t0.83833485032\n1\t1\t-0.291997112416\t-0.0207658889693\t0.172776752193\t0.36694855027\n1\t2\t-0.161225357475\t1.16418585274\t0.00727443800449\t1.1352882361\n2\t2\t1.30343435031\t0.732902323978\t-0.172844997755\t0.874662524376\n2\t2\t0.85539635481\t1.29119106621\t0.016024964511\t1.13160810191\n1\t2\t0.839799562146\t-0.0698184772979\t0.064736024742\t0.888230930115\n1\t2\t0.95789577351\t-0.0042439536723\t0.0555580748795\t1.07993651996\n1\t1\t1.32802494815\t-0.214047314771\t0.329813058688\t0.728172901439\n1\t1\t-0.200890919169\t1.1000313421\t1.04401630691\t0.0521627161216\n2\t2\t0.937448394951\t1.08384634906\t-0.0899239635102\t1.07443211017\n2\t1\t-0.0666111295973\t0.607978461697\t0.178977027858\t0.996958995079\n2\t1\t0.98988279173\t0.936124382141\t1.16162098\t0.953396718798\n1\t1\t0.783923131778\t-0.185782423384\t0.234091790401\t1.05701020406\n1\t1\t0.761503655241\t1.10820714005\t0.784532435857\t-0.125970126396\n2\t1\t-0.0961115621732\t0.992263342859\t0.660910916217\t0.963055169574\n2\t2\t-0.154764213109\t0.730891518005\t-0.109545565909\t1.12272967655\n2\t2\t0.0479283751395\t0.928564948748\t0.0947967021058\t0.98105799191\n2\t2\t1.39168552274\t0.128331277089\t0.10146975109\t1.24231428304\n1\t1\t0.976982771784\t-0.146928630221\t-0.0608841220423\t0.972841874016\n2\t1\t1.15485099166\t0.935197552788\t0.965011443377\t1.34264634759\n1\t2\t-0.166427006522\t0.213464027262\t-0.031343375005\t0.8119490745\n2\t1\t0.602325327176\t1.47360525321\t1.40368030116\t0.887287145417\n1\t2\t1.12050355207\t1.18852964108\t0.0704081979976\t1.19584630693\n2\t1\t0.702485774332\t1.15988608636\t0.294782678413\t0.751491248655\n1\t2\t0.155516690813\t0.251086517248\t0.975388704705\t0.688269967741\n1\t2\t0.038035346805\t0.682904829816\t0.0951645619842\t0.665389726903\n1\t1\t0.339450864189\t0.116879724658\t-0.170951058396\t-0.370117675216\n2\t2\t-0.108372250446\t0.696218715139\t-0.00428297700477\t0.961335352653\n2\t2\t0.0146712646232\t1.12798531635\t0.778687243129\t1.27150673153\n1\t2\t0.704617012215\t1.08526662881\t0.799187464816\t1.13063944956\n1\t1\t1.10224639633\t1.09684843311\t1.13580106237\t0.186395861041\n1\t1\t1.13687210336\t0.592984795387\t0.20048850526\t-0.0553656796539\n1\t2\t0.0632700472019\t0.864610771614\t-0.242802029698\t0.848811159682\n2\t1\t0.0451786925492\t1.33573290418\t0.92973441898\t-0.344011193096\n1\t2\t1.26061879295\t1.09499325896\t0.0222202420765\t0.847629840625\n1\t2\t0.91681254794\t0.290800393334\t-0.0719474399104\t0.926496648214\n2\t1\t1.2172426262\t0.951648627857\t1.25202262128\t0.233889527648\n1\t2\t1.05048646769\t0.172566561404\t0.0550162349302\t0.750079764855\n1\t2\t0.675366500637\t-0.0673050997098\t0.1645804156\t0.781063579107\n2\t1\t0.204088201674\t0.886512802356\t1.05795947541\t0.185790058971\n2\t1\t-0.100901351663\t0.714436170991\t-0.505529978858\t0.647306701065\n1\t2\t0.907207625417\t1.16174653049\t-0.155199134127\t0.747382222584\n1\t2\t0.0672106257479\t0.603637849323\t-0.140625204522\t1.08080017243\n2\t1\t1.2385313097\t1.0695347389\t-0.176990709153\t0.848256839162\n1\t2\t0.186923583294\t0.119157644078\t0.0349289573077\t0.744803259527\n1\t2\t1.09352177593\t0.194715059877\t0.0236391004662\t0.499673191061\n2\t1\t-0.376369481804\t0.985546924317\t0.0945527339598\t0.948918281956\n1\t1\t1.18474855816\t-0.115831486698\t0.283152200427\t0.970403352935\n2\t2\t1.15179008534\t1.11293520284\t0.221811798026\t0.999871011204\n1\t2\t-0.270193067228\t1.1546656712\t-0.244378116913\t0.671654326382\n2\t2\t0.439331185377\t1.12197569445\t0.258362973013\t1.11146143747\n2\t2\t1.01095806207\t0.745930460781\t-0.0409015639874\t1.14791250376\n2\t1\t-0.26402775558\t1.0189980863\t0.0142629520115\t0.959203836932\n1\t1\t1.1622683144\t-0.0120889455187\t1.07714267283\t-0.177584275215\n1\t1\t0.942340790264\t0.254818931717\t0.0587741977709\t0.980453538135\n2\t2\t0.106324819492\t0.79161883369\t-0.16526611256\t0.916230483749\n2\t1\t1.19278065887\t0.913551161988\t-0.0956615348665\t1.05953140511\n1\t1\t0.99020996204\t-0.0516709802571\t0.785783698942\t1.47690006823\n2\t1\t1.1566705292\t1.05878794929\t0.0968404106402\t0.827720917511\n1\t2\t0.05207115921\t-0.252341077617\t-0.0848699551554\t1.19139462554\n2\t2\t0.991086851115\t-0.301180892331\t-0.00253197995383\t1.46608138294\n";   
+  //W\tL\tN\tM\n
+  }
+}
+
+function demo3()
+{
+  with(window.document.key_search)
+  {
+
+searchkey.value="A1\tA2\tA3\tA4\tA5\tA6\tA7\tA8\tA9\tA10\tA11\tA12\tA13\tA14\tA15\tA16\n1\t1\t2\t1\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t2\t1\t1\t1\t1\t2\t1\t4\t4\t4\t2\t1\t1\t2\t1\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t1\t2\t3\t1\n1\t2\t2\t2\t1\t1\t2\t3\t3\t3\t4\t3\t2\t2\t3\t1\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n2\t1\t2\t2\t1\t1\t1\t3\t3\t2\t4\t2\t1\t3\t4\t1\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t1\t1\t3\t4\t1\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n2\t2\t2\t2\t1\t1\t2\t3\t3\t1\t4\t1\t1\t3\t1\t1\n1\t1\t2\t2\t1\t1\t1\t3\t1\t1\t1\t1\t1\t3\t1\t1\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t2\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t2\t1\t1\t3\t1\t1\t1\t1\t1\t3\t1\t1\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t4\t3\t1\t2\t3\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t2\t2\t2\t1\t1\t2\t3\t3\t3\t3\t4\t3\t1\t2\t1\n1\t1\t2\t2\t1\t1\t1\t3\t3\t1\t3\t1\t1\t3\t1\t1\n1\t2\t2\t2\t1\t1\t2\t3\t3\t3\t4\t2\t1\t3\t4\t1\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t2\t1\t1\t3\t1\t1\t1\t1\t1\t3\t1\t1\n1\t1\t2\t1\t1\t1\t1\t3\t3\t3\t3\t3\t1\t2\t3\t1\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t1\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t3\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n2\t1\t2\t2\t1\t1\t1\t3\t3\t2\t4\t2\t1\t3\t4\t1\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t3\t1\t2\t3\n1\t1\t2\t2\t1\t1\t1\t3\t3\t2\t3\t2\t1\t3\t4\t1\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t1\t2\t2\n2\t1\t2\t2\t1\t1\t1\t3\t3\t2\t4\t2\t1\t3\t4\t1\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t2\t3\t3\t3\t3\t3\t2\t2\t3\t1\n1\t1\t2\t2\t2\t1\t1\t3\t1\t1\t1\t1\t1\t3\t1\t1\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t1\t2\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t2\t1\t1\t3\t1\t1\t1\t1\t1\t3\t1\t1\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t1\t2\t3\t1\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t1\t2\t3\t1\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t2\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t3\t4\t2\n1\t1\t2\t2\t2\t1\t1\t3\t1\t1\t1\t1\t1\t3\t1\t1\n1\t1\t2\t2\t2\t1\t1\t3\t1\t1\t1\t1\t1\t3\t1\t1\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t2\t3\t2\t1\t3\t4\t1\n1\t1\t2\t2\t2\t1\t1\t3\t1\t1\t1\t1\t1\t3\t1\t1\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t2\t2\t2\t2\t2\t2\t1\t3\t4\t1\n2\t1\t2\t2\t1\t1\t1\t3\t3\t1\t4\t1\t1\t3\t1\t1\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t4\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t2\t1\t1\t3\t1\t1\t1\t3\t2\t2\t1\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t2\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t2\t3\t3\t3\t3\t3\t2\t2\t3\t1\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t2\t2\t3\t3\t1\t3\t1\t1\t3\t1\t1\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t1\t2\t3\t1\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t2\t2\t2\t1\t1\t2\t3\t3\t3\t3\t2\t1\t3\t4\t1\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t1\t1\t3\t4\t1\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t2\t2\t2\t2\t1\t2\t3\t1\t1\t1\t1\t1\t3\t1\t1\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t3\t3\t3\t3\t3\t2\t2\t3\t2\n1\t1\t2\t2\t1\t1\t1\t2\t2\t2\t2\t2\t1\t3\t4\t1\n";
+   }
+}
+
+
+function demo8nodes()
+{
+  with(window.document.key_search)
+  {
+
+searchkey.value="Geno1\tGeno2\tTrait1\tTrait2\tTrait3\tTrait4\tTrait5\tTrait6\n2\t2\t0.46259\t1.2692\t-1.3164\t-0.44096\t0.5929\t-0.75422\n1\t1\t-0.10011\t-0.88834\t1.6407\t0.99972\t0.31288\t0.65602\n1\t1\t-1.0533\t-0.55296\t1.2715\t1.3686\t-0.19153\t0.37361\n1\t2\t0.042371\t0.13573\t-0.72659\t-0.66133\t0.43157\t-1.6715\n1\t2\t-0.68686\t-1.6152\t-0.95019\t-1.2239\t0.12319\t-0.79155\n1\t1\t-0.4558\t0.090877\t0.94224\t1.2354\t-0.36356\t0.34937\n1\t1\t0.237\t-0.49002\t1.8939\t1.4399\t0.033059\t1.3229\n1\t2\t0.070265\t0.22547\t-1.4903\t-0.069341\t-0.16148\t-0.01449\n1\t1\t-0.69146\t-0.43461\t1.1501\t0.21205\t-0.18087\t0.32746\n1\t1\t0.31535\t-0.9858\t0.57816\t0.35924\t0.12866\t1.0553\n2\t1\t1.2718\t0.39314\t0.6669\t0.90002\t-0.30206\t1.3376\n1\t1\t1.1871\t-0.45611\t0.87227\t0.31014\t-0.092846\t0.81278\n2\t1\t-1.0168\t-0.44286\t1.6933\t0.72968\t0.038808\t0.81906\n2\t2\t-0.25313\t0.52468\t0.02823\t-0.20984\t-0.075809\t-1.3591\n1\t2\t-0.58108\t-0.3967\t-0.11925\t-0.61288\t0.46778\t0.090941\n1\t2\t-0.88043\t-0.28187\t-1.1645\t-1.2543\t-0.28951\t-1.039\n1\t2\t0.54121\t0.24395\t-1.0043\t-1.4483\t-0.19839\t-2.5407\n2\t1\t0.47375\t1.1319\t0.68553\t1.035\t0.44043\t1.3011\n2\t1\t0.57785\t0.69093\t1.5941\t1.6735\t0.19981\t0.50708\n1\t2\t-0.43989\t0.0024131\t-1.5405\t-1.2304\t-0.15382\t-1.1058\n2\t1\t0.38035\t-0.063535\t1.1606\t1.3124\t-0.38043\t0.6277\n1\t2\t0.70114\t-0.41044\t-0.39767\t-1.5424\t0.27477\t-0.76183\n1\t1\t-0.9406\t-0.20526\t1.3302\t1.097\t0.16006\t1.2988\n1\t2\t0.52122\t0.064793\t-0.031492\t0.21696\t-0.41979\t-0.79123\n1\t2\t-0.53387\t-0.71043\t-0.52344\t-1.5584\t-0.09538\t-1.5781\n1\t1\t0.49563\t-0.58126\t0.7747\t1.274\t0.19196\t0.10624\n2\t2\t1.1499\t1.879\t0.43595\t0.73474\t0.045381\t-0.88645\n1\t2\t0.40705\t-0.37647\t-0.19815\t-1.5366\t0.37167\t-0.10553\n2\t2\t0.62526\t0.043371\t-0.64449\t-0.44076\t-0.4318\t-0.91807\n1\t1\t-0.61788\t-0.62414\t0.3169\t0.85091\t-0.10135\t0.79065\n1\t1\t0.18491\t-1.5226\t1.1149\t0.75046\t0.25948\t0.42431\n2\t2\t0.86063\t0.92883\t-1.1584\t-0.099858\t-0.55095\t-0.064129\n1\t2\t-0.28946\t0.0057533\t-0.95703\t-0.44018\t0.084268\t-0.23718\n1\t1\t-0.073096\t0.16452\t1.4444\t1.1452\t0.46025\t0.30452\n1\t1\t0.15637\t-0.73137\t0.585\t-0.046911\t0.43881\t1.2888\n1\t2\t0.081142\t-0.63691\t-0.14883\t0.66593\t-0.13479\t-0.22207\n1\t1\t0.10876\t-0.23383\t1.8314\t1.3282\t0.4362\t0.90139\n1\t2\t-1.0582\t-0.97152\t-0.57118\t-1.2617\t0.17115\t-0.060679\n2\t2\t-0.47421\t-0.56819\t-0.38775\t0.035215\t0.51982\t-1.6309\n2\t2\t-0.10242\t0.8127\t0.41773\t-1.1308\t-0.30719\t-0.80758\n1\t1\t-0.083462\t-0.4565\t1.1556\t0.3299\t0.087362\t0.31349\n1\t2\t-0.98158\t0.01727\t-1.3281\t-1.4474\t0.54555\t-0.10096\n1\t1\t-0.80604\t-0.19415\t1.4986\t1.3386\t-0.16367\t0.68271\n1\t1\t0.80082\t-0.57853\t1.0716\t0.94015\t-0.54114\t0.032172\n2\t2\t2.0456\t0.97954\t-0.45536\t-0.14332\t-0.25819\t-1.0833\n1\t1\t-0.30148\t0.20623\t0.64194\t0.76414\t-0.59067\t0.64326\n1\t1\t-0.55625\t-0.26957\t1.8447\t1.6568\t-0.38077\t0.58831\n1\t2\t0.11898\t0.80706\t-0.025844\t-0.57984\t-0.23395\t-1.1554\n1\t2\t-0.095497\t-1.0637\t-0.92583\t-0.57928\t0.23695\t-0.42992\n2\t2\t0.066154\t0.73037\t-0.73622\t-0.57047\t0.39169\t0.40928\n1\t1\t0.81522\t0.11381\t0.68971\t0.29219\t0.037792\t0.81502\n1\t1\t-0.65356\t-0.20182\t0.92089\t0.92298\t-0.5417\t0.49215\n1\t1\t-0.90826\t-0.10979\t1.3847\t0.75954\t-0.20255\t0.32975\n1\t2\t-0.25671\t-1.1903\t-1.4241\t-1.6058\t-0.062549\t-1.3981\n2\t2\t-1.8038\t-1.4801\t-0.94121\t-1.6244\t0.4817\t-0.0029469\n1\t2\t0.12651\t0.028719\t-1.5818\t-1.0266\t0.19779\t-0.36357\n1\t1\t-1.0658\t-0.58443\t0.68956\t0.35467\t0.11177\t1.5243\n1\t2\t0.14729\t-0.15111\t-0.027639\t-0.2899\t0.11533\t-0.60305\n2\t2\t-0.76889\t0.87161\t-0.83556\t-1.1777\t-0.21878\t-0.98527\n2\t2\t0.12252\t0.49068\t-0.2557\t-1.5816\t0.25332\t-0.78715\n1\t1\t-0.40287\t0.26456\t0.62208\t0.60909\t0.36074\t0.092703\n2\t1\t-0.78301\t1.4641\t1.3162\t1.9448\t-0.10841\t0.9618\n1\t2\t-0.25018\t-0.32797\t-1.113\t-1.6123\t0.6272\t-1.2718\n2\t1\t0.15804\t-0.18147\t2.4571\t0.59504\t-0.34056\t0.8691\n2\t1\t-0.582\t0.25738\t1.4075\t0.92251\t-0.40889\t0.66381\n1\t1\t-0.26827\t0.58632\t0.51883\t1.5745\t-0.13818\t1.0526\n1\t2\t0.13453\t0.18218\t-0.51676\t-0.54166\t-0.36636\t-1.206\n2\t1\t1.1502\t0.36164\t1.9983\t1.0809\t0.11272\t0.67683\n1\t2\t0.27812\t0.46559\t-1.6109\t-0.91039\t0.3803\t-0.71802\n2\t1\t0.15292\t0.61921\t0.71009\t1.3063\t-0.35819\t0.8661\n1\t2\t0.19902\t0.48986\t-1.4026\t-0.8495\t0.47158\t0.0622\n2\t1\t0.4838\t1.1096\t1.4392\t1.1438\t0.34739\t0.084004\n1\t1\t-0.63609\t-0.35105\t0.63581\t1.1939\t-0.062938\t0.91353\n1\t2\t0.64203\t-0.5095\t-1.7792\t-0.88803\t0.43482\t-0.66314\n1\t1\t-0.18434\t-0.48157\t0.69942\t0.56942\t-0.019967\t0.50506\n1\t1\t0.10168\t-1.0928\t1.2144\t0.28313\t0.22159\t0.54058\n1\t1\t-0.18578\t-0.45336\t1.5468\t0.99679\t0.11821\t1.0476\n1\t2\t-0.60607\t-1.1275\t-0.90963\t-0.69014\t-0.33163\t-1.2734\n1\t1\t-0.35353\t-0.42708\t0.78989\t0.14094\t-0.056632\t0.80598\n1\t1\t-0.020221\t-1.1235\t1.9782\t-0.041281\t0.19857\t1.2488\n1\t1\t1.2346\t-0.37121\t1.3325\t1.1237\t-0.027458\t1.0044\n2\t2\t-0.54489\t1.6812\t-0.59836\t-0.012441\t0.41243\t-0.58835\n2\t1\t-0.029577\t2.1707\t1.3285\t1.2109\t0.29684\t0.90646\n2\t2\t0.70774\t1.0606\t-1.3996\t-0.020914\t-0.60955\t-1.2187\n2\t1\t0.07926\t0.52862\t1.3994\t0.54549\t0.55303\t0.16155\n1\t1\t0.041856\t-0.92023\t0.87269\t-0.66601\t-0.15945\t0.1004\n1\t2\t0.17665\t0.31945\t-1.7756\t-0.60442\t0.020525\t-1.0625\n1\t1\t-0.090238\t-0.65111\t0.56993\t-0.4117\t-0.19486\t-0.18849\n1\t2\t0.059166\t-0.47194\t-0.69068\t-0.41022\t0.25867\t-0.057175\n1\t2\t0.10473\t0.66887\t0.082035\t-0.55975\t-0.28439\t-1.468\n1\t1\t-0.20937\t-0.36621\t0.09609\t0.28164\t0.24673\t-0.11107\n1\t2\t-1.2678\t0.22369\t-0.42201\t-0.70103\t0.075915\t-1.3347\n1\t2\t-0.35467\t0.11166\t-0.42144\t-0.095223\t-0.29936\t-0.68322\n2\t2\t0.84875\t1.24\t-0.81217\t0.084034\t-0.32224\t-1.6241\n2\t1\t-0.45939\t1.3208\t0.97993\t1.2991\t-0.015791\t1.487\n1\t2\t-0.42254\t-0.57928\t-0.58529\t-2.2375\t0.51999\t-0.79909\n2\t1\t0.32092\t-0.13796\t0.67098\t0.24639\t-0.36066\t-0.032948\n1\t2\t-1.2408\t-0.94836\t0.026276\t-0.37981\t-0.02237\t-0.38777\n2\t2\t0.20959\t2.1466\t-1.7027\t-1.3169\t-0.16515\t-1.046\n2\t2\t-0.10482\t1.3773\t-1.2998\t-0.014223\t0.34065\t-0.35362\n1\t2\t-0.6188\t-1.2477\t-0.62084\t0.27682\t0.1674\t-0.8918\n1\t1\t-0.97246\t-0.73017\t1.3843\t1.5549\t0.1067\t0.85754\n1\t1\t0.74567\t-0.032694\t1.1153\t0.97318\t-0.0033905\t0.85059\n2\t2\t0.29324\t-0.090608\t-0.4945\t-1.0484\t-0.14987\t-1.0141\n2\t1\t-0.86818\t0.44948\t1.8531\t0.51896\t-0.021141\t1.8486\n1\t2\t0.362\t-0.29749\t-0.66525\t0.21709\t-0.15594\t-1.4087\n1\t2\t-0.17675\t0.36465\t-0.45423\t-1.262\t0.22968\t-1.246\n1\t2\t-0.34633\t-0.16067\t-1.2216\t-1.3019\t-0.040891\t-1.2935\n1\t2\t0.44608\t-0.57732\t0.25606\t-1.1664\t0.54705\t-0.19859\n1\t2\t0.45398\t-0.55214\t-0.33433\t-0.085418\t-0.10094\t-0.48509\n1\t2\t0.12407\t0.022419\t-1.0312\t-0.47727\t0.20924\t-1.2961\n1\t1\t-0.76644\t-1.1794\t1.2345\t0.84756\t0.1532\t0.77648\n1\t2\t-0.10329\t-0.53768\t-0.67677\t-0.58708\t-0.014634\t-0.036347\n1\t1\t0.2378\t0.15372\t0.49652\t0.29193\t0.19047\t1.152\n1\t2\t0.024605\t-0.38937\t-0.89907\t-0.42106\t0.16921\t-0.80893\n1\t2\t0.28812\t0.26265\t-0.94234\t-0.88527\t-0.49803\t0.48254\n1\t1\t0.85086\t0.11783\t1.5014\t1.2382\t0.24441\t1.3649\n2\t2\t0.86172\t0.14894\t-0.4846\t-1.3488\t-0.41844\t-1.1372\n1\t2\t0.67971\t-0.27488\t-0.50687\t-0.79153\t-0.093399\t-1.391\n1\t1\t-0.91977\t-0.66099\t0.5801\t0.46587\t-0.2263\t1.43\n1\t2\t0.88213\t-0.48674\t-0.42406\t-1.2762\t0.28981\t-1.0813\n2\t1\t-0.36583\t0.51518\t1.4491\t1.4995\t-0.073755\t1.1218\n1\t1\t-0.54006\t-0.59443\t0.81263\t0.65809\t-0.15621\t1.2508\n2\t2\t1.2125\t-0.012648\t-0.92657\t-0.81972\t-0.1536\t-1.0176\n1\t2\t0.42493\t0.34558\t-1.7672\t-1.3503\t-0.045928\t0.37449\n1\t1\t0.17097\t-0.86593\t-0.13424\t1.0257\t0.058014\t0.91044\n2\t1\t-1.393\t0.5338\t1.8514\t2.291\t0.15305\t0.30028\n1\t1\t-0.58552\t-1.5337\t1.5133\t0.9976\t0.64638\t1.4428\n1\t2\t0.046272\t-0.56387\t-0.86063\t-1.0462\t0.014457\t-1.3038\n1\t2\t0.34933\t-0.16796\t-0.27854\t-0.27327\t-0.0040928\t-0.17912\n1\t1\t-1.0672\t0.3979\t1.208\t0.50111\t-0.013978\t0.015097\n1\t2\t0.31052\t-0.46723\t-1.1237\t0.59267\t0.30978\t-1.0169\n1\t2\t-0.55337\t-0.42776\t-0.12612\t-0.41838\t-0.56558\t-0.58189\n2\t2\t0.3925\t0.15644\t-0.72963\t-0.66601\t-0.10837\t-0.27787\n1\t2\t-0.48513\t-1.4119\t-0.16889\t-0.19646\t-0.068098\t-0.084247\n2\t2\t0.16692\t1.5447\t-1.3064\t-1.3338\t-0.25668\t-0.48832\n1\t2\t-0.36092\t0.31518\t-0.44815\t-1.4019\t-0.47505\t-0.37187\n1\t1\t-1.8192\t-0.57745\t1.1304\t0.262\t-0.3595\t0.58577\n1\t1\t-0.065383\t0.07156\t1.4931\t2.3215\t0.85149\t1.4585\n2\t1\t-1.119\t0.70896\t1.0498\t0.74334\t0.75838\t1.6107\n2\t2\t-0.17682\t-0.21029\t-0.74465\t-0.83806\t0.10827\t-1.2829\n1\t2\t0.69834\t-0.082402\t0.64008\t-0.83119\t-0.26766\t0.36961\n2\t2\t-0.28266\t1.1929\t-0.15174\t0.098554\t-0.33989\t-0.6376\n2\t2\t1.5369\t1.8434\t0.0030761\t-0.59703\t0.14497\t-1.5165\n1\t2\t0.35023\t-0.28475\t-0.93594\t-1.0937\t-0.46614\t-2.188\n2\t1\t0.62308\t1.0873\t-0.0037182\t0.86847\t-0.48699\t-0.10105\n1\t1\t-1.0408\t-0.99866\t2.0799\t1.1634\t0.092516\t0.30401\n1\t1\t-0.87125\t-0.88987\t1.0278\t1.0157\t-0.23725\t1.2377\n1\t2\t-0.020591\t-0.03398\t-0.024834\t-1.3588\t-0.045961\t-0.89693\n1\t1\t0.9213\t-0.57037\t1.044\t1.2994\t0.046517\t0.66563\n1\t2\t-0.87288\t-0.96382\t-0.704\t-1.2184\t0.046903\t-0.30008\n1\t2\t0.77586\t-0.34168\t-0.09867\t-0.37744\t-0.24309\t-0.13441\n2\t1\t0.19521\t0.67595\t1.4533\t1.5115\t0.19553\t0.79596\n2\t1\t-1.3273\t1.0891\t1.2544\t0.98928\t0.045725\t0.54963\n2\t2\t0.59176\t0.65915\t-0.84578\t-0.080229\t-0.26961\t0.24045\n1\t2\t-0.66958\t-1.042\t-1.2138\t-0.7612\t-0.22775\t-0.40062\n1\t2\t1.1154\t-0.57069\t-0.6592\t-2.1961\t-0.013175\t0.46007\n1\t2\t-0.5254\t0.0031225\t-0.77758\t0.8169\t0.13224\t-0.65572\n2\t1\t0.24551\t1.5078\t0.10719\t1.1454\t0.70578\t0.59051\n1\t2\t0.29875\t-0.11455\t-1.0497\t-0.77881\t0.080708\t-0.48337\n1\t1\t-0.1047\t0.011628\t1.2504\t0.41776\t-0.20102\t1.2252\n1\t2\t0.44808\t-0.8165\t-0.080134\t-0.49618\t0.051011\t-0.71722\n2\t1\t2.0365\t1.5592\t1.3257\t1.2472\t-0.47899\t0.10943\n1\t1\t-0.16507\t-0.66011\t0.98739\t0.58519\t0.245\t-0.43277\n1\t2\t-0.028366\t-0.16961\t-1.3266\t0.14248\t-0.24634\t-1.1154\n2\t1\t0.92842\t1.8842\t1.3169\t1.0358\t-0.20988\t0.88021\n2\t2\t0.33158\t0.32463\t-0.50924\t0.40233\t0.54391\t-0.24309\n1\t2\t1.2555\t0.1928\t-0.487\t0.048779\t-0.23483\t-1.477\n2\t1\t0.75021\t0.85943\t-0.2323\t0.10748\t-0.68906\t0.84276\n2\t2\t0.6297\t1.7397\t-1.6136\t-0.43268\t-0.21442\t-0.77462\n2\t1\t0.53168\t1.0807\t1.0853\t0.62304\t0.44036\t0.48087\n1\t2\t-0.31256\t-0.69771\t-0.88556\t-1.333\t0.038614\t-1.5744\n1\t2\t-0.039695\t-0.52447\t0.91401\t-0.93272\t0.53434\t-0.080746\n2\t1\t-0.16596\t0.56821\t0.76008\t0.45442\t0.10286\t0.6539\n1\t2\t-0.4331\t-0.89669\t-1.3097\t-1.2157\t0.1065\t-0.8512\n1\t2\t-0.34708\t-0.51457\t-1.012\t-0.39437\t-0.55374\t-1.144\n2\t2\t0.024082\t0.7128\t-1.3702\t-1.4492\t-0.10228\t-0.59071\n1\t2\t-0.0037109\t-0.68845\t-0.649\t-0.91581\t0.066805\t-0.98583\n2\t1\t0.68706\t0.067424\t0.87139\t0.7938\t-0.099645\t1.529\n2\t2\t-0.31183\t0.57814\t-0.80815\t-0.66724\t-0.31919\t-0.61319\n1\t2\t-0.11153\t-0.6246\t-0.27979\t-0.18363\t0.83639\t0.014919\n2\t2\t0.20406\t1.5838\t-0.96334\t-1.1228\t-0.17808\t-1.2123\n2\t2\t-0.1134\t0.63358\t-0.53321\t-0.84276\t-0.27657\t-0.36992\n1\t2\t0.25517\t0.67006\t-0.1349\t0.18275\t0.40982\t-0.62487\n1\t1\t-1.2684\t0.31042\t0.91155\t0.66143\t0.2483\t-0.12434\n1\t1\t-0.97542\t-0.85419\t0.7663\t0.16362\t-0.18737\t0.67266\n1\t2\t-0.043882\t-0.62746\t-0.82816\t-0.40626\t-0.051048\t-0.61297\n1\t1\t0.59605\t-0.45852\t1.2962\t0.78156\t-0.48154\t0.17778\n2\t2\t-0.06266\t1.1144\t-0.80524\t-0.3189\t-0.16038\t-0.96372\n1\t2\t-1.1821\t1.0798\t-1.3407\t-0.52643\t0.12458\t-0.7871\n2\t2\t0.59446\t0.89186\t-0.97856\t-0.64658\t0.2712\t-1.5538\n1\t2\t0.15067\t0.41827\t-1.0487\t-1.0551\t0.19143\t-1.4537\n1\t2\t-1.073\t0.022587\t-1.7088\t-1.3777\t0.1964\t-0.84025\n2\t1\t0.20928\t1.8026\t1.2073\t2.78\t0.15131\t0.3448\n1\t2\t-1.1317\t-0.6359\t-0.70457\t-1.676\t-0.22886\t-0.58769\n1\t1\t-0.039428\t-0.58746\t0.56\t0.7896\t-0.052581\t0.99511\n1\t2\t0.55023\t-0.20403\t0.138\t-0.70518\t0.66927\t-0.28861\n2\t2\t0.57423\t1.1886\t0.092876\t0.025677\t-0.41099\t-1.2858\n2\t2\t-0.14179\t1.5827\t-0.94328\t0.7703\t-0.43967\t-0.50448\n2\t2\t0.14666\t1.0492\t-0.0030259\t-0.62418\t-0.087515\t-0.048386\n";
+   }
+}
+
+function demochl()
+{
+  with(window.document.key_search)
+  {
+
+searchkey.value="Ctrq3\tMAS\tNeutrophil\tLoad\tWeight\n2\t0.969230769\t3\t3.252367514\t1\n2\t0.925170068\t1.6\t2.46322088\t1.033472803\n1\t0.427272727\t33.8\t4.206610024\t0.831372549\n2\t0.877835951\t8.3\t3.764250875\t0.967153285\n2\t0.914862915\t4.4\t3.691700208\t1.046025105\n2\t0.560334528\t4.9\t2.604550033\t0.98046875\n1\t0.383073497\t13.1\t4.273556814\t0.812316716\n1\t0.101010101\t18.6\t5.089640217\t0.771929825\n1\t0.106719368\t18.9\t4.915125346\t0.80994152\n2\t0.894736842\t2.5\t2.691700208\t0.995515695\n1\t0.067226891\t19.8\t4.878194228\t0.846153846\n2\t0.921022067\t2.9\t4.127428778\t1.03875969\n2\t0.938701923\t0.7\t4.366310867\t0.984732824\n1\t0.658008658\t15.7\t4.531121115\t0.884210526\n2\t0.9\t4.8\t2.604550033\t0.913194444\n2\t0.790923825\t10.4\t2.390670213\t0.892857143\n1\t0.295539033\t8.6\t4.24137213\t0.85840708\n2\t0.317757009\t12.2\t4.449648073\t0.889830508\n1\t0.032418953\t20.2\t5.053428044\t0.811320755\n1\t0.603960396\t23.4\t4.283775979\t0.805460751\n2\t0.939351199\t3.6\t2.349277527\t0.952380952\n1\t0.978448276\t0.4\t3.495405563\t0.8875\n1\t0.1\t23.2\t4.675613388\t0.766101695\n1\t0.036363636\t32.6\t4.938109253\t0.828125\n1\t0.660247593\t9.2\t3.826398782\t0.921052632\n1\t0.078651685\t35.8\t4.513630383\t0.852112676\n1\t0.186915888\t20.7\t5.048247532\t0.779761905\n1\t0.071578947\t35.6\t4.574586809\t0.797356828\n1\t0.239520958\t15.4\t4.331548761\t0.941176471\n1\t0.205741627\t24.5\t5.058547488\t0.774193548\n1\t0.062300319\t13.4\t4.594790195\t0.832236842\n2\t0.599675851\t5\t4.18178644\t0.969348659\n1\t0.324246772\t13.5\t4.252367514\t0.858585859\n1\t0.87628866\t14.2\t2.929061124\t0.869863014\n1\t0.146103896\t15.6\t4.579726449\t0.9\n1\t0.257383966\t22.5\t5.210214148\t0.75\n1\t0.033333333\t31.1\t4.632578756\t0.718644068\n1\t0.29739777\t36.1\t3.880756445\t0.798353909\n2\t0.872979215\t4.2\t4.097465554\t0.856756757\n2\t0.909221902\t4.3\t3.650307523\t0.976\n1\t0.10041841\t28.3\t4.46322088\t0.757462687";
+   }
+}
+
+function demospnl()
+{
+  with(window.document.key_search)
+  {
+
+searchkey.value="rs3664317\tOas1a\tParp9\tDhx58\tCd1d1\tIrf7\tOas3\tPml\tMx1\tIfit1\tTrim25\tOas1g\tPglyrp3\tIfih1\n1\t8.34\t9.812\t8.774\t9.79\t9.663\t8.27\t11.036\t7.284\t8.286\t10.395\t8.521\t6.186\t8.83\n1\t8.368\t9.738\t8.566\t9.144\t9.484\t8.818\t11.03\t6.977\t8.294\t10.076\t8.529\t5.968\t8.828\n1\t8.178\t9.57\t8.726\t9.575\t10.106\t8.99\t10.878\t7.205\t8.676\t10.036\t8.61\t5.976\t9.024\n1\t8.116\t9.901\t8.904\t9.959\t9.793\t8.336\t11.105\t7.598\t8.316\t10.292\t8.401\t5.814\t8.836\n2\t8.099\t9.68\t8.876\t10.116\t9.771\t8.379\t11.028\t7.438\t8.541\t10.215\t8.32\t5.917\t9.073\n1\t8.262\t9.59\t8.24\t10.088\t8.938\t7.832\t10.486\t6.752\t7.825\t9.908\t8.196\t6.15\t8.446\n1\t7.915\t9.415\t8.308\t9.707\t9.12\t8.702\t11.102\t7.208\t8.243\t10.034\t7.897\t6.06\t8.892\n2\t8.565\t10.002\t8.96\t9.779\t10.322\t9.24\t11.278\t7.644\t8.893\t10.42\t8.773\t5.914\t9.407\n1\t8.189\t9.774\t8.541\t9.939\t9.134\t7.819\t10.766\t7.122\t8.352\t10.113\t8.492\t6.269\t9.055\n1\t8.476\t9.954\t8.908\t9.476\t9.92\t8.764\t11.134\t7.859\t8.788\t10.17\t8.862\t6.226\t9.17\n2\t8.119\t9.946\t8.876\t9.578\t10.02\t8.734\t11.244\t7.85\t8.838\t10.557\t8.56\t5.98\t9.353\n2\t8.305\t9.713\t8.972\t9.789\t9.839\t8.804\t10.948\t7.682\t8.896\t10.181\t8.854\t5.979\t9.567\n2\t8.654\t10\t9.306\t9.439\t10.457\t9.223\t10.922\t7.082\t8.942\t10.131\t9.162\t6.01\t9.74\n1\t8.105\t9.748\t8.725\t10.119\t9.782\t8.575\t11.113\t7.63\t8.674\t10.355\t8.59\t6.279\t8.908\n1\t8.247\t9.715\t8.829\t9.646\t9.953\t9.668\t11.112\t7.384\t9.221\t10.19\t8.64\t6\t9.552\n1\t8.511\t9.994\t9.014\t9.89\t10.266\t8.444\t10.599\t7.331\t9.153\t10.012\t8.837\t6.148\t9.023\n2\t8.947\t10.28\t9.483\t9.398\t11.23\t9.86\t11.324\t8.006\t9.772\t10.524\t9.587\t5.865\t10.067\n1\t8.526\t9.685\t8.921\t9.7\t10.126\t9.373\t11.121\t7.497\t9.003\t10.357\t8.156\t6.334\t9.678\n2\t8.06\t9.745\t9.092\t9.278\t10.231\t8.976\t10.998\t7.578\t9.145\t10.283\t8.611\t6.168\t9.413\n2\t7.93\t9.728\t8.694\t9.512\t9.826\t9.016\t11.276\t7.604\t8.767\t10.378\t8.577\t5.963\t9.264\n2\t8.511\t9.686\t9.014\t8.982\t10.508\t10.108\t11.304\t7.441\t9.133\t10.341\t9.04\t6.2\t9.974\n2\t8.645\t9.997\t8.97\t9.443\t10.393\t9.302\t11.409\t7.785\t8.894\t10.552\t9.051\t5.997\t9.412\n2\t8.293\t9.802\t9.001\t9.524\t10.156\t9.263\t11.212\t7.772\t8.581\t10.433\t8.514\t6.093\t9.177\n1\t7.781\t9.712\t8.97\t9.375\t10.12\t9.484\t11.317\t7.347\t8.972\t10.393\t8.352\t6.193\t9.587\n2\t8.465\t9.88\t8.913\t9.816\t9.965\t8.852\t11.138\t7.537\t8.625\t10.426\t8.617\t6.044\t9.556\n2\t8.657\t10.026\t9.189\t9.691\t10.302\t9.268\t11.194\t7.634\t9.143\t10.378\t9.05\t6.067\t9.679\n2\t7.634\t9.606\t8.36\t9.465\t8.41\t8.605\t11.183\t6.942\t8.174\t9.952\t7.478\t6.09\t9.535\n1\t7.669\t9.494\t8.779\t9.552\t9.362\t8.52\t11.024\t7.131\t8.378\t10.391\t8.114\t6.07\t8.851\n2\t8.618\t10.212\t9.433\t9.672\t10.442\t9.21\t11.328\t8.045\t9.322\t10.5\t9.128\t5.994\t9.656\n2\t8.731\t10.27\t9.342\t9.43\t10.697\t10.117\t11.286\t7.749\t9.734\t10.464\t9.322\t6.156\t9.876\n1\t7.554\t9.524\t8.759\t9.93\t9.52\t8.279\t10.82\t7.32\t8.316\t10.31\t8.186\t6.068\t9.046\n1\t8.262\t9.677\t8.75\t9.444\t10.052\t8.634\t10.888\t7.32\t8.562\t9.893\t8.644\t6.212\t8.918\n1\t7.823\t9.628\t8.66\t9.529\t9.578\t8.736\t11.206\t7.171\t8.408\t10.062\t8.111\t5.838\t9.033\n1\t8.28\t9.572\t8.784\t9.428\t9.862\t9.424\t11.27\t7.288\t8.505\t10.174\t8.642\t6.022\t9.313\n2\t9.09\t10.053\t9.599\t9.469\t11.004\t9.882\t11.436\t8.521\t9.814\t10.562\t9.704\t6.044\t10.061\n1\t8.446\t9.989\t9.297\t9.688\t10.577\t9.129\t11.102\t7.718\t9.484\t10.231\t9.072\t6.17\t9.21\n1\t8.668\t9.858\t9.195\t9.385\t10.695\t9.249\t11.028\t7.765\t9.367\t10.319\t9.179\t6.136\t9.563\n2\t8.574\t10.059\t9.281\t9.233\t10.508\t9.247\t11.145\t8.138\t9.505\t10.402\t9.192\t5.992\t9.848\n2\t8.523\t10.052\t9.131\t9.507\t10.418\t9.413\t11.187\t7.641\t9.304\t10.465\t9.063\t6.095\t9.733\n1\t7.987\t9.748\t8.766\t9.578\t9.781\t8.482\t11.279\t7.52\t8.364\t10.141\t8.207\t6.192\t9.133\n2\t8.466\t9.429\t8.946\t9.395\t9.715\t9.071\t11.388\t7.592\t8.078\t10.32\t8.326\t6.108\t9.021\n1\t7.668\t9.694\t8.493\t10.112\t9.561\t8.394\t10.922\t7.26\t8.19\t10.27\t7.916\t5.892\t8.974\n2\t8.379\t10.037\t9.155\t9.683\t10.281\t9.2\t10.913\t7.173\t9.404\t10.381\t9.097\t6.099\t9.714\n2\t7.805\t9.654\t8.454\t9.198\t10.065\t9.468\t11.217\t6.917\t8.43\t10.459\t8.11\t6.068\t9.068\n1\t7.981\t9.8\t8.553\t9.946\t9.862\t8.901\t11.085\t7.214\t8.393\t10.373\t8.19\t6.05\t9.015\n1\t7.746\t9.688\t8.578\t9.901\t9.358\t7.866\t10.928\t7.354\t7.929\t10.233\t8.066\t5.754\t8.883\n1\t7.997\t9.859\t8.795\t9.867\t9.817\t8.734\t11.109\t7.416\t8.67\t10.247\t8.176\t6.143\t9.081\n1\t8.674\t9.689\t9.06\t9.81\t10.544\t8.995\t11.189\t7.781\t9.219\t10.07\t8.98\t5.992\t9.143\n1\t8.088\t9.49\t8.676\t9.456\t10.184\t8.737\t10.998\t7.222\t8.538\t10.192\t8.441\t6.147\t8.55\n1\t8.001\t9.801\t8.669\t9.977\t9.383\t8.274\t11.055\t7.231\t7.913\t10.272\t8.277\t5.931\t9.009\n2\t8.218\t9.458\t8.781\t9.214\t9.66\t8.87\t10.738\t7.241\t8.289\t10.029\t8.612\t6.125\t9.38\n1\t7.684\t9.56\t8.75\t10.077\t9.686\t8.27\t11.102\t7.206\t8.13\t10.212\t8.07\t6.018\t8.984\n2\t8.326\t9.696\t8.88\t9.714\t10.014\t9.08\t11.055\t7.256\t8.494\t10.054\t8.63\t6.177\t9.162\n2\t8.906\t10.106\t9.412\t9.704\t11.06\t9.854\t11.335\t7.799\t10.103\t10.471\t9.25\t6.033\t9.97\n1\t8.073\t9.793\t8.626\t9.879\t9.262\t8.408\t10.844\t7.108\t8.368\t9.959\t8.261\t6.052\t8.916\n2\t8.527\t10.026\t9.143\t9.244\t10.597\t9.566\t11.108\t7.778\t9.748\t10.351\t9.153\t6.055\t9.698\n2\t8.614\t10.05\t9.202\t9.508\t10.66\t9.63\t11.156\t7.758\t9.789\t10.324\t9.068\t6.15\t9.948\n2\t8.522\t10.158\t8.992\t9.684\t9.992\t8.55\t11.125\t7.914\t8.976\t10.311\t8.574\t5.889\t9.566\n1\t8.086\t9.6\t8.522\t9.544\t9.641\t8.514\t10.99\t7.386\t8.506\t10.194\t8.234\t6.02\t8.736\n1\t7.873\t9.596\t8.452\t9.422\t9.278\t8.509\t10.958\t7.057\t8.081\t9.981\t7.969\t6.136\t8.958\n2\t8.371\t9.99\t8.949\t9.931\t10.195\t8.935\t10.83\t7.694\t9.183\t10.493\t9.124\t6.128\t9.396\n2\t8.476\t9.982\t9.115\t9.639\t10.465\t9.833\t11.105\t8.058\t9.9\t10.351\t9.182\t6.05\t9.884\n1\t8.512\t9.995\t8.846\t9.951\t9.561\t8.558\t10.769\t7.584\t8.901\t10.139\t8.769\t5.959\t9.203\n1\t8.358\t9.858\t8.99\t9.981\t10.123\t9.368\t10.989\t7.463\t9.327\t9.93\t8.54\t6.02\t9.543\n1\t8.23\t9.614\t8.806\t9.919\t9.939\t9.108\t11.184\t7.766\t8.793\t10.174\t8.605\t5.972\t9.068\n2\t8.238\t9.802\t8.926\t9.595\t10.062\t8.77\t11.202\t7.712\t9.131\t10.34\t8.57\t6.05\t9.464\n1\t8.533\t10.108\t9.083\t10.214\t10.514\t8.463\t11.008\t7.356\t9.344\t10.196\t8.736\t6.262\t9.257\n1\t7.866\t9.444\t8.223\t9.865\t8.95\t8.539\t10.935\t6.754\t7.748\t10.177\t7.826\t6.29\t8.716\n2\t8.888\t10.031\t9.158\t9.407\t10.8\t9.547\t11.238\t7.659\t9.602\t10.398\t9.337\t6.028\t9.529\n1\t8.026\t9.682\t8.398\t9.824\t9.202\t8.041\t10.703\t7.322\t8.352\t10.209\t8.196\t6.009\t9.001\n2\t8.974\t10.071\t9.451\t9.348\t11.061\t9.686\t11.255\t8.077\t10.101\t10.323\t9.557\t6.006\t10.072\n1\t8.181\t9.432\t9.045\t9.544\t10.651\t9.18\t10.832\t7.419\t8.742\t9.818\t8.546\t6.33\t9.201\n1\t8.137\t9.676\t9.024\t9.37\t10.206\t9.944\t10.985\t7.226\t8.9\t10.362\t8.918\t6.352\t9.367\n";
+}
+}
+
+function demoksl()
+{
+  with(window.document.key_search)
+  {
+
+searchkey.value="FEV\tKol\tHyp\tlogBMI\tSmok\tAlc\tWork\tSex\tYear\n116.00\t745.00\t1.00\t3.360375\t1\t2\t2\t2\t2\n252.00\t680.00\t1.00\t3.477232\t2\t2\t2\t1\t2\n205.00\t669.00\t1.00\t3.285038\t2\t1\t2\t2\t2\n66.00\t636.00\t1.00\t3.11795\t2\t1\t2\t2\t2\n255.00\t669.00\t1.00\t3.21326\t2\t1\t2\t1\t2\n135.00\t555.00\t0.00\t3.474138\t2\t1\t2\t2\t2\n314.00\t475.00\t1.00\t3.086943\t1\t1\t2\t1\t2\n104.00\t825.00\t0.00\t3.194173\t2\t1\t2\t2\t2\n173.00\t634.00\t1.00\t3.293983\t1\t2\t2\t2\t2\n235.00\t657.00\t0.00\t3.175968\t2\t2\t2\t1\t2\n111.00\t619.00\t0.00\t2.939162\t2\t2\t1\t2\t2\n165.00\t668.00\t1.00\t3.222868\t2\t1\t2\t1\t2\n119.00\t620.00\t0.00\t3.141563\t2\t2\t2\t2\t2\n240.00\t588.00\t1.00\t3.357942\t1\t1\t2\t1\t2\n84.00\t791.00\t1.00\t3.039749\t1\t2\t2\t2\t2\n161.00\t654.00\t0.00\t3.269569\t1\t2\t2\t2\t2\n155.00\t656.00\t0.00\t3.083285\t1\t1\t2\t2\t2\n268.00\t617.00\t1.00\t3.399195\t1\t2\t2\t1\t2\n239.00\t850.00\t0.00\t3.170106\t2\t2\t2\t1\t2\n213.00\t797.00\t1.00\t2.958549\t1\t1\t1\t1\t2\n160.00\t628.00\t1.00\t3.670206\t1\t1\t2\t2\t2\n244.00\t447.00\t0.00\t3.365916\t2\t2\t2\t1\t2\n159.00\t732.00\t0.00\t3.067588\t1\t2\t2\t2\t2\n63.00\t661.00\t0.00\t2.986692\t1\t2\t2\t2\t2\n205.00\t987.00\t0.00\t3.189653\t1\t2\t2\t1\t2\n155.00\t499.00\t0.00\t3.241029\t1\t1\t2\t2\t2\n250.00\t714.00\t0.00\t3.165897\t2\t1\t2\t2\t2\n225.00\t1046.00\t1.00\t3.239854\t2\t2\t2\t2\t2\n266.00\t600.00\t0.00\t3.131573\t2\t2\t2\t1\t2\n220.00\t648.00\t0.00\t3.165897\t1\t1\t2\t2\t2\n89.00\t679.00\t1.00\t3.058707\t2\t2\t2\t1\t2\n118.00\t521.00\t1.00\t3.162094\t2\t2\t2\t1\t2\n224.00\t643.00\t0.00\t3.194173\t2\t1\t2\t1\t2\n225.00\t693.00\t1.00\t3.165897\t2\t2\t2\t1\t2\n176.00\t335.00\t0.00\t3.175968\t2\t2\t2\t1\t2\n267.00\t857.00\t1.00\t3.239071\t1\t2\t2\t2\t2\n153.00\t615.00\t1.00\t3.120601\t2\t2\t2\t2\t2\n205.00\t844.00\t1.00\t3.412137\t1\t1\t2\t2\t2\n295.00\t451.00\t1.00\t3.161247\t1\t2\t2\t1\t2\n293.00\t573.00\t0.00\t3.109507\t2\t2\t2\t1\t2\n281.00\t663.00\t0.00\t3.244544\t2\t2\t2\t1\t2\n156.00\t643.00\t0.00\t3.042616\t2\t2\t2\t2\t2\n207.00\t589.00\t1.00\t3.323956\t2\t2\t2\t1\t2\n221.00\t865.00\t0.00\t3.117065\t2\t1\t2\t2\t2\n218.00\t774.00\t1.00\t3.145445\t1\t2\t2\t2\t2\n211.00\t891.00\t1.00\t3.262318\t1\t2\t2\t2\t2\n182.00\t599.00\t1.00\t3.121483\t1\t2\t2\t2\t2\n221.00\t627.00\t1.00\t3.215269\t2\t1\t2\t1\t2\n219.00\t896.00\t1.00\t3.313458\t1\t2\t2\t1\t2\n168.00\t738.00\t1.00\t3.039749\t2\t2\t2\t2\t2\n161.00\t612.00\t1.00\t3.440418\t2\t2\t2\t1\t2\n130.00\t580.00\t1.00\t3.261169\t2\t1\t2\t2\t2\n170.00\t687.00\t0.00\t3.16674\t2\t1\t2\t2\t2\n188.00\t735.00\t1.00\t2.892592\t2\t2\t2\t2\t2\n114.00\t612.00\t0.00\t3.610377\t2\t1\t2\t2\t2\n208.00\t633.00\t0.00\t3.260402\t2\t2\t2\t2\t2\n233.00\t658.00\t0.00\t3.192121\t1\t1\t2\t1\t2\n176.00\t837.00\t1.00\t3.279406\t1\t1\t2\t2\t2\n290.00\t478.00\t0.00\t3.115735\t2\t1\t1\t1\t2\n144.00\t894.00\t1.00\t3.164208\t1\t1\t2\t2\t2\n198.00\t560.00\t0.00\t2.862772\t2\t2\t2\t1\t2\n180.00\t694.00\t0.00\t3.233173\t2\t2\t1\t1\t2\n144.00\t540.00\t0.00\t3.226844\t2\t2\t2\t2\t2\n66.00\t669.00\t0.00\t3.063858\t2\t2\t1\t1\t2\n150.00\t560.00\t0.00\t3.680343\t2\t1\t2\t2\t2\n231.00\t668.00\t0.00\t3.077773\t2\t2\t2\t1\t2\n83.00\t638.00\t0.00\t3.17346\t2\t2\t2\t1\t2\n201.00\t665.00\t0.00\t3.317453\t1\t1\t2\t2\t2\n129.00\t456.00\t0.00\t2.939691\t2\t2\t2\t1\t2\n198.00\t643.00\t1.00\t3.053529\t2\t2\t2\t2\t2\n173.00\t571.00\t1.00\t3.081451\t1\t1\t2\t2\t2\n201.00\t774.00\t0.00\t3.196221\t2\t2\t2\t2\t2\n255.00\t560.00\t1.00\t3.483085\t2\t2\t2\t1\t2\n249.00\t531.00\t1.00\t3.313095\t2\t1\t2\t1\t2\n216.00\t788.00\t0.00\t3.439777\t1\t1\t2\t2\t2\n217.00\t656.00\t0.00\t3.439456\t2\t2\t2\t1\t2\n134.00\t607.00\t1.00\t3.218876\t2\t1\t2\t2\t2\n192.00\t690.00\t0.00\t3.429461\t1\t2\t2\t1\t2\n231.00\t657.00\t1.00\t3.410157\t2\t1\t2\t1\t2\n185.00\t429.00\t0.00\t3.201526\t2\t1\t2\t1\t2\n184.00\t771.00\t0.00\t3.132882\t2\t2\t2\t2\t2\n287.00\t547.00\t0.00\t3.193763\t2\t1\t2\t1\t2\n206.00\t541.00\t1.00\t3.137666\t2\t1\t2\t2\t2\n252.00\t484.00\t0.00\t3.189653\t2\t2\t1\t1\t2\n282.00\t658.00\t1.00\t3.139833\t1\t2\t2\t1\t2\n203.00\t586.00\t1.00\t3.537475\t1\t1\t2\t2\t2\n177.00\t478.00\t0.00\t2.832036\t2\t2\t2\t1\t2\n156.00\t686.00\t1.00\t3.52371\t2\t2\t2\t2\t2\n165.00\t788.00\t0.00\t3.181797\t2\t2\t2\t2\t2\n212.00\t556.00\t0.00\t3.116622\t2\t2\t2\t1\t2\n167.00\t675.00\t1.00\t3.209633\t2\t2\t2\t2\t2\n284.00\t553.00\t1.00\t3.171784\t2\t2\t1\t1\t2\n101.00\t595.00\t1.00\t3.654029\t1\t1\t2\t2\t2\n262.00\t650.00\t0.00\t3.225255\t2\t2\t2\t1\t2\n81.00\t584.00\t1.00\t2.922624\t2\t1\t2\t2\t2\n304.00\t758.00\t0.00\t3.405189\t1\t1\t2\t1\t2\n227.00\t699.00\t1.00\t3.847378\t1\t1\t2\t2\t2\n185.00\t612.00\t0.00\t3.145445\t1\t1\t2\t2\t2\n203.00\t711.00\t1.00\t3.089678\t2\t2\t2\t1\t2\n144.00\t541.00\t1.00\t3.437208\t2\t1\t2\t1\t2\n297.00\t968.00\t0.00\t3.085116\t2\t2\t2\t1\t2\n170.00\t867.00\t0.00\t3.218876\t2\t1\t2\t2\t2\n281.00\t593.00\t0.00\t3.285787\t2\t2\t2\t1\t2\n228.00\t531.00\t1.00\t3.262701\t2\t2\t2\t1\t2\n203.00\t823.00\t1.00\t3.303952\t1\t2\t2\t2\t2\n161.00\t618.00\t0.00\t3.141995\t1\t1\t2\t2\t2\n170.00\t468.00\t1.00\t3.145875\t1\t1\t2\t2\t2\n194.00\t753.00\t0.00\t3.300271\t2\t2\t2\t1\t2\n230.00\t612.00\t0.00\t3.331847\t2\t2\t2\t1\t2\n161.00\t1028.00\t0.00\t3.042616\t2\t2\t2\t2\t2\n176.00\t446.00\t0.00\t3.345332\t2\t2\t2\t1\t2\n170.00\t675.00\t0.00\t3.24688\t2\t2\t1\t2\t2\n143.00\t667.00\t1.00\t3.170945\t2\t1\t2\t2\t2\n194.00\t591.00\t0.00\t3.058707\t2\t1\t2\t1\t2\n185.00\t851.00\t1.00\t3.464485\t1\t2\t2\t2\t2\n294.00\t615.00\t0.00\t3.286534\t2\t2\t1\t1\t2\n236.00\t605.00\t1.00\t3.280159\t2\t2\t2\t1\t2\n63.00\t703.00\t0.00\t3.100543\t2\t2\t2\t1\t2\n165.00\t634.00\t0.00\t3.022861\t2\t2\t2\t1\t2\n136.00\t593.00\t1.00\t3.009635\t2\t2\t2\t1\t2\n177.00\t716.00\t1.00\t3.531348\t1\t1\t2\t2\t2\n99.00\t483.00\t0.00\t3.19663\t2\t2\t2\t1\t2\n160.00\t657.00\t1.00\t3.49256\t2\t2\t2\t2\t2\n201.00\t539.00\t0.00\t3.123246\t1\t1\t2\t1\t2\n134.00\t532.00\t0.00\t3.041184\t2\t2\t2\t2\t2\n300.00\t802.00\t1.00\t3.464485\t2\t1\t2\t1\t2\n224.00\t937.00\t1.00\t3.023834\t1\t2\t2\t2\t2\n144.00\t701.00\t1.00\t3.225255\t2\t2\t2\t1\t2\n87.00\t625.00\t0.00\t3.439777\t1\t1\t2\t2\t2\n171.00\t687.00\t0.00\t3.200304\t2\t2\t2\t1\t2\n116.00\t508.00\t0.00\t2.879198\t2\t2\t2\t2\t2\n315.00\t612.00\t1.00\t3.256172\t2\t2\t1\t1\t2\n221.00\t583.00\t1.00\t3.017983\t1\t1\t2\t2\t2\n143.00\t727.00\t1.00\t3.222868\t2\t2\t2\t1\t2\n105.00\t754.00\t0.00\t2.901422\t2\t1\t2\t2\t2\n160.00\t500.00\t0.00\t3.054001\t2\t2\t2\t1\t2\n181.00\t659.00\t1.00\t3.100543\t1\t1\t2\t2\t2\n96.00\t666.00\t0.00\t3.022861\t2\t1\t2\t2\t2\n321.00\t446.00\t0.00\t3.21165\t2\t2\t2\t1\t2\n218.00\t826.00\t1.00\t3.033028\t2\t2\t2\t1\t2\n133.00\t759.00\t1.00\t3.516607\t1\t2\t2\t2\t2\n163.00\t717.00\t1.00\t3.097837\t2\t2\t2\t2\t2\n206.00\t628.00\t1.00\t3.380314\t2\t2\t2\t1\t2\n171.00\t669.00\t1.00\t3.162094\t2\t2\t2\t2\t2\n269.00\t600.00\t1.00\t3.335058\t2\t2\t1\t1\t2\n109.00\t728.00\t1.00\t3.435599\t2\t1\t2\t1\t2\n137.00\t481.00\t1.00\t3.52783\t2\t2\t2\t2\t2\n181.00\t516.00\t1.00\t3.160823\t1\t1\t2\t2\t2\n234.00\t692.00\t0.00\t3.357942\t2\t1\t1\t1\t2\n167.00\t578.00\t1.00\t3.295466\t1\t1\t2\t2\t2\n112.00\t679.00\t0.00\t3.488598\t1\t2\t2\t1\t2\n99.00\t751.00\t1.00\t3.338967\t1\t2\t2\t2\t2\n240.00\t954.00\t1.00\t3.209633\t2\t2\t2\t1\t2\n153.00\t604.00\t1.00\t3.302481\t1\t1\t2\t2\t2\n269.00\t601.00\t1.00\t3.116622\t2\t2\t2\t1\t2\n169.00\t521.00\t1.00\t3.222071\t2\t2\t2\t1\t2\n209.00\t488.00\t1.00\t3.214868\t2\t1\t2\t1\t2\n230.00\t724.00\t1.00\t3.14329\t2\t2\t2\t1\t2\n212.00\t705.00\t0.00\t3.141563\t1\t1\t2\t2\t2\n221.00\t560.00\t0.00\t3.221273\t2\t2\t2\t1\t2\n278.00\t760.00\t1.00\t3.163786\t1\t2\t1\t2\t2\n252.00\t675.00\t0.00\t3.163786\t2\t2\t2\t1\t2\n183.00\t1063.00\t1.00\t3.230014\t1\t1\t2\t2\t2\n146.00\t841.00\t1.00\t3.439135\t2\t2\t2\t2\t2\n296.00\t926.00\t1.00\t3.242202\t2\t1\t2\t1\t2\n185.00\t766.00\t0.00\t3.078233\t2\t2\t2\t2\t2\n188.00\t730.00\t1.00\t3.137666\t2\t1\t2\t2\t2\n209.00\t599.00\t0.00\t3.215269\t1\t2\t2\t1\t2\n254.00\t563.00\t0.00\t3.379974\t1\t1\t2\t2\t2\n293.00\t679.00\t1.00\t3.323596\t1\t2\t2\t1\t2\n75.00\t540.00\t1.00\t3.249599\t2\t1\t2\t2\t2\n219.00\t792.00\t1.00\t3.189653\t1\t2\t2\t1\t2\n170.00\t746.00\t0.00\t3.105035\t2\t2\t2\t2\t2\n252.00\t689.00\t1.00\t3.357942\t2\t2\t2\t1\t2\n221.00\t648.00\t0.00\t3.113515\t2\t2\t2\t2\t2\n303.00\t614.00\t1.00\t3.120601\t2\t2\t2\t1\t2\n166.00\t670.00\t1.00\t3.439777\t1\t1\t2\t2\t2\n105.00\t610.00\t0.00\t3.302113\t2\t1\t2\t1\t2\n218.00\t711.00\t1.00\t3.048325\t1\t2\t1\t1\t2\n173.00\t639.00\t1.00\t3.197039\t2\t1\t2\t2\t2\n206.00\t543.00\t0.00\t3.17346\t2\t2\t2\t1\t2\n102.00\t473.00\t0.00\t3.031099\t2\t2\t2\t2\t2\n319.00\t668.00\t0.00\t3.380995\t2\t1\t2\t1\t2\n221.00\t680.00\t1.00\t3.249599\t2\t1\t2\t2\t2\n141.00\t555.00\t0.00\t2.981633\t1\t2\t2\t2\t2\n167.00\t704.00\t1.00\t3.15359\t2\t2\t2\t2\t2\n152.00\t682.00\t1.00\t3.217275\t2\t2\t2\t1\t2\n72.00\t622.00\t1.00\t3.016515\t2\t2\t2\t1\t2\n161.00\t585.00\t1.00\t3.13201\t2\t2\t2\t1\t2\n52.00\t529.00\t1.00\t3.440739\t2\t1\t2\t2\t2\n197.00\t757.00\t1.00\t3.454422\t2\t2\t2\t1\t2\n167.00\t748.00\t0.00\t3.092859\t1\t2\t2\t2\t2\n287.00\t590.00\t1.00\t3.062924\t1\t2\t2\t1\t2\n183.00\t662.00\t0.00\t3.417071\t2\t2\t2\t1\t2\n263.00\t588.00\t1.00\t3.390136\t2\t2\t1\t1\t2\n243.00\t731.00\t0.00\t3.169686\t1\t1\t2\t2\t2\n366.00\t657.00\t0.00\t3.280159\t1\t2\t2\t1\t2\n171.00\t726.00\t0.00\t3.339322\t2\t1\t2\t2\t2\n114.00\t520.00\t1.00\t3.317091\t2\t2\t2\t1\t2\n156.00\t979.00\t0.00\t3.049273\t2\t2\t2\t2\t2\n140.00\t964.00\t1.00\t3.492256\t1\t2\t2\t2\t2\n215.00\t784.00\t1.00\t3.358986\t1\t1\t2\t2\t2\n296.00\t655.00\t1.00\t3.207613\t2\t1\t1\t1\t2\n291.00\t677.00\t0.00\t3.166319\t1\t1\t2\t1\t2\n152.00\t763.00\t0.00\t3.005683\t2\t2\t2\t2\t2\n141.00\t844.00\t0.00\t3.080992\t1\t2\t2\t2\t2\n257.00\t523.00\t0.00\t3.12016\t2\t1\t2\t1\t2\n153.00\t768.00\t0.00\t2.963209\t2\t2\t2\t2\t2\n221.00\t732.00\t0.00\t3.428164\t2\t2\t2\t1\t2\n167.00\t706.00\t1.00\t3.511545\t2\t1\t2\t2\t2\n179.00\t602.00\t0.00\t3.268047\t2\t1\t2\t1\t2\n72.00\t818.00\t1.00\t3.080073\t2\t2\t2\t2\t2\n57.00\t461.00\t1.00\t3.280159\t1\t1\t2\t2\t2\n189.00\t591.00\t1.00\t3.355851\t2\t2\t2\t1\t2\n182.00\t674.00\t1.00\t3.128075\t2\t2\t2\t2\t2\n252.00\t569.00\t1.00\t3.228826\t2\t2\t1\t1\t2\n127.00\t776.00\t1.00\t3.376563\t2\t2\t2\t2\t2\n207.00\t823.00\t1.00\t3.187179\t2\t2\t2\t2\t2\n170.00\t655.00\t0.00\t3.158276\t2\t2\t2\t2\t2\n99.00\t789.00\t1.00\t3.204777\t2\t1\t2\t2\t2\n306.00\t634.00\t1.00\t3.264614\t1\t2\t1\t1\t2\n294.00\t598.00\t0.00\t3.186766\t2\t2\t2\t1\t2\n66.00\t484.00\t0.00\t2.981126\t2\t2\t2\t1\t2\n200.00\t776.00\t0.00\t2.91398\t1\t1\t2\t2\t2\n197.00\t605.00\t0.00\t3.305054\t2\t1\t2\t1\t2\n180.00\t696.00\t1.00\t3.293983\t1\t1\t2\t2\t2\n176.00\t643.00\t1.00\t3.290638\t2\t2\t2\t1\t2\n177.00\t827.00\t1.00\t3.128075\t2\t2\t2\t2\t2\n105.00\t682.00\t0.00\t2.971952\t2\t1\t2\t2\t2\n102.00\t718.00\t1.00\t3.212455\t2\t1\t2\t2\t2\n306.00\t551.00\t0.00\t3.093766\t2\t2\t2\t1\t2\n258.00\t477.00\t1.00\t3.248823\t2\t1\t2\t1\t2\n108.00\t574.00\t0.00\t3.237109\t2\t2\t2\t2\t2\n218.00\t653.00\t0.00\t3.2312\t2\t2\t2\t1\t2\n140.00\t697.00\t0.00\t3.328268\t2\t2\t2\t2\t2\n165.00\t748.00\t1.00\t3.278276\t2\t2\t2\t1\t2\n101.00\t660.00\t0.00\t2.918851\t2\t1\t2\t2\t2\n237.00\t629.00\t0.00\t3.192121\t2\t2\t2\t1\t2\n132.00\t770.00\t1.00\t3.454106\t2\t1\t2\t2\t2\n306.00\t516.00\t0.00\t3.224858\t2\t2\t1\t1\t2\n146.00\t776.00\t0.00\t3.009142\t1\t2\t2\t2\t2\n38.00\t544.00\t1.00\t2.995732\t2\t1\t2\t2\t2\n141.00\t288.00\t1.00\t3.145875\t1\t2\t2\t2\t2\n195.00\t818.00\t1.00\t3.224858\t1\t1\t2\t2\t2\n174.00\t543.00\t0.00\t3.14329\t2\t2\t2\t1\t2\n180.00\t587.00\t1.00\t3.083285\t1\t1\t2\t2\t2\n138.00\t635.00\t0.00\t3.123246\t1\t2\t2\t2\t2\n207.00\t591.00\t0.00\t3.145875\t1\t2\t2\t2\t2\n156.00\t944.00\t0.00\t3.319264\t2\t2\t2\t2\t2\n251.00\t752.00\t1.00\t3.492865\t2\t2\t2\t1\t2\n99.00\t951.00\t1.00\t3.440739\t1\t2\t2\t2\t2\n263.00\t486.00\t1.00\t3.346741\t2\t2\t1\t1\t2\n153.00\t613.00\t1.00\t3.335414\t2\t2\t2\t1\t2\n156.00\t660.00\t1.00\t3.296207\t1\t1\t2\t2\t2\n263.00\t788.00\t1.00\t3.243373\t2\t2\t2\t1\t2\n162.00\t665.00\t1.00\t3.080992\t1\t2\t2\t2\t2\n183.00\t645.00\t1.00\t3.287655\t2\t1\t2\t1\t2\n171.00\t490.00\t1.00\t3.326833\t2\t1\t2\t2\t2\n192.00\t852.00\t1.00\t3.352707\t1\t2\t2\t2\t2\n240.00\t600.00\t0.00\t3.319264\t2\t2\t2\t1\t2\n177.00\t692.00\t0.00\t3.393165\t2\t2\t2\t1\t2\n207.00\t824.00\t0.00\t3.273364\t2\t2\t1\t2\t2\n218.00\t403.00\t1.00\t3.208421\t2\t1\t2\t1\t2\n168.00\t729.00\t0.00\t3.058707\t2\t2\t2\t2\t2\n153.00\t638.00\t1.00\t2.981633\t2\t2\t2\t1\t2\n177.00\t646.00\t1.00\t2.93492\t2\t2\t2\t2\t2\n198.00\t619.00\t0.00\t3.227637\t1\t2\t2\t2\t2\n216.00\t783.00\t0.00\t3.228826\t2\t2\t2\t1\t2\n177.00\t702.00\t1.00\t3.055415\t1\t1\t2\t2\t2\n294.00\t756.00\t1.00\t3.216072\t2\t2\t2\t1\t2\n189.00\t730.00\t0.00\t3.108168\t1\t1\t2\t2\t2\n272.00\t571.00\t0.00\t3.312002\t1\t2\t2\t1\t2\n200.00\t677.00\t1.00\t3.243764\t2\t2\t1\t2\t2\n189.00\t621.00\t1.00\t3.321432\t1\t2\t1\t1\t2\n144.00\t929.00\t1.00\t3.197039\t1\t2\t2\t2\t2\n245.00\t749.00\t1.00\t3.229222\t1\t1\t2\t1\t2\n195.00\t619.00\t0.00\t3.276767\t2\t2\t2\t1\t2\n117.00\t573.00\t1.00\t3.158276\t2\t2\t2\t2\t2\n107.00\t743.00\t1.00\t3.390136\t2\t2\t2\t1\t2\n125.00\t762.00\t0.00\t3.193763\t2\t2\t2\t1\t2\n243.00\t532.00\t0.00\t3.183456\t1\t2\t2\t2\t2\n114.00\t492.00\t1.00\t3.117507\t2\t2\t2\t1\t2\n123.00\t728.00\t1.00\t2.978077\t1\t2\t2\t2\t2\n189.00\t801.00\t1.00\t3.650139\t2\t2\t2\t2\t2\n255.00\t658.00\t0.00\t3.209229\t2\t2\t2\t1\t2\n234.00\t617.00\t0.00\t2.911263\t2\t2\t2\t1\t2\n225.00\t613.00\t0.00\t2.977059\t2\t1\t2\t2\t2\n255.00\t638.00\t0.00\t3.244544\t2\t2\t2\t1\t2\n132.00\t558.00\t1.00\t3.150169\t2\t1\t2\t2\t2\n186.00\t715.00\t1.00\t3.302481\t1\t1\t2\t2\t2\n136.00\t850.00\t1.00\t3.188004\t2\t2\t2\t2\t2\n198.00\t500.00\t0.00\t3.126322\t2\t1\t2\t1\t2\n191.00\t496.00\t1.00\t3.244933\t1\t2\t2\t1\t2\n165.00\t572.00\t1.00\t3.355851\t2\t2\t2\t2\t2\n114.00\t693.00\t1.00\t3.441379\t2\t1\t2\t2\t2\n240.00\t712.00\t1.00\t3.261169\t2\t2\t2\t1\t2\n141.00\t740.00\t1.00\t3.093766\t1\t1\t2\t2\t2\n222.00\t408.00\t1.00\t3.237109\t1\t2\t2\t1\t2\n120.00\t513.00\t0.00\t3.129389\t2\t1\t2\t2\t2\n279.00\t666.00\t1.00\t3.219276\t2\t2\t2\t1\t2\n180.00\t667.00\t1.00\t3.199081\t2\t1\t2\t2\t2\n81.00\t587.00\t0.00\t3.287282\t2\t2\t2\t1\t2\n138.00\t720.00\t1.00\t3.269569\t1\t1\t2\t2\t2\n104.00\t745.00\t1.00\t3.25925\t2\t2\t2\t1\t2\n183.00\t644.00\t0.00\t2.987196\t2\t2\t2\t2\t2\n195.00\t555.00\t0.00\t2.80699\t2\t2\t2\t1\t2\n144.00\t563.00\t0.00\t3.39182\t1\t2\t2\t2\t2\n144.00\t748.00\t0.00\t3.313458\t2\t2\t1\t1\t2\n219.00\t809.00\t0.00\t3.092859\t2\t2\t2\t2\t2\n198.00\t585.00\t1.00\t3.200304\t2\t2\t2\t1\t2\n192.00\t470.00\t1.00\t3.185939\t2\t2\t1\t1\t2\n150.00\t697.00\t1.00\t3.273364\t1\t1\t2\t2\t2\n117.00\t769.00\t1.00\t3.201526\t2\t2\t2\t1\t2\n102.00\t788.00\t1.00\t3.187179\t2\t2\t2\t2\t2\n66.00\t571.00\t0.00\t3.121483\t2\t2\t1\t1\t2\n197.00\t709.00\t0.00\t3.084201\t2\t2\t2\t1\t2\n153.00\t667.00\t0.00\t3.120601\t2\t1\t2\t2\t2\n264.00\t663.00\t0.00\t3.599775\t2\t2\t2\t1\t2\n210.00\t675.00\t1.00\t3.333275\t2\t2\t2\t1\t2\n204.00\t636.00\t1.00\t2.965273\t1\t1\t2\t2\t2\n282.00\t813.00\t1.00\t3.489513\t1\t2\t2\t1\t2\n180.00\t750.00\t1.00\t3.119718\t2\t1\t2\t2\t2\n192.00\t574.00\t1.00\t3.375538\t2\t2\t1\t2\t2\n258.00\t659.00\t1.00\t3.113515\t2\t1\t2\t1\t2\n207.00\t646.00\t0.00\t3.023834\t2\t1\t2\t2\t2\n153.00\t814.00\t0.00\t3.11396\t2\t1\t2\t2\t2\n249.00\t558.00\t0.00\t2.981126\t2\t2\t2\t1\t2\n175.00\t572.00\t0.00\t3.330059\t2\t2\t2\t2\t2\n223.00\t640.00\t0.00\t3.136798\t1\t2\t2\t1\t2\n150.00\t560.00\t1.00\t3.356549\t2\t2\t2\t1\t2\n204.00\t659.00\t0.00\t3.04357\t2\t2\t2\t1\t2\n191.00\t614.00\t1.00\t3.097837\t1\t1\t2\t2\t2\n213.00\t713.00\t1.00\t3.117507\t2\t2\t1\t1\t2\n128.00\t620.00\t1.00\t3.044999\t2\t1\t2\t1\t2\n249.00\t692.00\t1.00\t3.564449\t2\t2\t2\t2\t2\n114.00\t615.00\t1.00\t3.357942\t2\t2\t2\t1\t2\n194.00\t712.00\t1.00\t3.093766\t2\t2\t2\t2\t2\n173.00\t640.00\t1.00\t3.095578\t1\t1\t2\t2\t2\n168.00\t693.00\t1.00\t3.304686\t1\t2\t2\t2\t2\n96.00\t793.00\t1.00\t2.910719\t2\t1\t2\t2\t2\n255.00\t610.00\t1.00\t3.40253\t2\t2\t2\t1\t2\n177.00\t585.00\t1.00\t3.54472\t2\t2\t2\t2\t2\n282.00\t701.00\t1.00\t3.259634\t2\t1\t2\t1\t2\n177.00\t494.00\t0.00\t2.986187\t1\t2\t2\t2\t2\n228.00\t809.00\t0.00\t3.242983\t1\t2\t1\t1\t2\n258.00\t692.00\t1.00\t2.941276\t1\t2\t2\t1\t2\n186.00\t726.00\t0.00\t3.204777\t1\t1\t2\t2\t2\n237.00\t632.00\t0.00\t3.179303\t2\t2\t2\t1\t2\n168.00\t661.00\t1.00\t3.323956\t2\t2\t2\t1\t2\n120.00\t803.00\t0.00\t3.173041\t2\t1\t2\t2\t2\n278.00\t539.00\t1.00\t3.155297\t2\t2\t2\t1\t2\n186.00\t996.00\t0.00\t3.283539\t2\t1\t2\t2\t2\n177.00\t669.00\t0.00\t3.121483\t1\t1\t2\t2\t2\n168.00\t639.00\t1.00\t3.415429\t2\t2\t2\t2\t2\n195.00\t742.00\t0.00\t3.068053\t1\t1\t2\t2\t2\n150.00\t721.00\t1.00\t3.469168\t2\t1\t2\t2\t2\n330.00\t646.00\t0.00\t3.209633\t1\t2\t1\t1\t2\n105.00\t702.00\t0.00\t3.357594\t2\t2\t2\t2\t2\n102.00\t579.00\t1.00\t3.054001\t2\t2\t2\t1\t2\n160.00\t619.00\t1.00\t3.07084\t1\t1\t2\t2\t2\n231.00\t555.00\t0.00\t3.135059\t2\t1\t2\t1\t2\n210.00\t655.00\t0.00\t3.203153\t1\t1\t2\t2\t2\n60.00\t631.00\t0.00\t3.074543\t2\t1\t2\t2\t2\n99.00\t499.00\t1.00\t2.79545\t2\t2\t2\t1\t2\n162.00\t643.00\t1.00\t3.268047\t2\t2\t2\t1\t2\n129.00\t799.00\t0.00\t3.099642\t2\t1\t2\t2\t2\n230.00\t616.00\t1.00\t3.275256\t2\t2\t2\t1\t2\n180.00\t633.00\t1.00\t2.960623\t2\t1\t1\t2\t2\n243.00\t460.00\t0.00\t3.189653\t2\t2\t2\t1\t2\n219.00\t530.00\t0.00\t2.876949\t2\t2\t1\t1\t2\n171.00\t676.00\t0.00\t2.828496\t2\t2\t1\t1\t2\n114.00\t794.00\t1.00\t3.441059\t1\t1\t2\t2\t2\n225.00\t665.00\t1.00\t3.294354\t1\t2\t2\t1\t2\n261.00\t752.00\t1.00\t3.190476\t2\t2\t2\t1\t2\n246.00\t532.00\t1.00\t3.192121\t2\t2\t1\t1\t2\n227.00\t589.00\t0.00\t3.24688\t2\t2\t2\t1\t2\n102.00\t558.00\t1.00\t3.199489\t2\t1\t2\t2\t2\n108.00\t542.00\t0.00\t2.930127\t2\t1\t1\t2\t2\n177.00\t816.00\t1.00\t3.465111\t2\t1\t2\t2\t2\n128.00\t444.00\t0.00\t2.894253\t2\t2\t2\t1\t2\n162.00\t373.00\t1.00\t3.203153\t2\t1\t2\t2\t2\n123.00\t768.00\t0.00\t3.188004\t2\t1\t1\t1\t2\n150.00\t595.00\t1.00\t3.367296\t2\t1\t2\t2\t2\n198.00\t751.00\t1.00\t3.232384\t2\t2\t2\t2\t2\n264.00\t611.00\t0.00\t3.070376\t2\t2\t1\t1\t2\n96.00\t650.00\t0.00\t3.15955\t2\t2\t2\t2\t2\n249.00\t612.00\t0.00\t3.175968\t2\t1\t1\t1\t2\n279.00\t490.00\t1.00\t3.280535\t2\t2\t2\t1\t2\n320.00\t748.00\t0.00\t3.182627\t2\t2\t1\t1\t2\n135.00\t724.00\t1.00\t3.601413\t2\t1\t2\t2\t2\n133.00\t568.00\t1.00\t3.222868\t1\t2\t2\t2\t2\n222.00\t626.00\t0.00\t3.330059\t2\t2\t2\t1\t2\n150.00\t793.00\t0.00\t3.218876\t2\t2\t1\t2\t2\n219.00\t649.00\t1.00\t3.288775\t1\t1\t2\t2\t2\n231.00\t463.00\t0.00\t3.246102\t2\t1\t1\t1\t2\n254.00\t534.00\t1.00\t3.21165\t2\t1\t2\t1\t2\n225.00\t900.00\t1.00\t3.058707\t2\t2\t2\t2\t2\n284.00\t646.00\t0.00\t3.159975\t2\t2\t2\t1\t2\n141.00\t377.00\t0.00\t2.994732\t1\t1\t2\t2\t2\n138.00\t806.00\t0.00\t3.158276\t2\t1\t2\t2\t2\n51.00\t647.00\t1.00\t3.354455\t2\t2\t2\t1\t2\n147.00\t683.00\t1.00\t3.652734\t2\t2\t2\t2\t2\n222.00\t609.00\t0.00\t3.067122\t2\t1\t2\t1\t2\n99.00\t637.00\t1.00\t3.467297\t2\t1\t2\t2\t2\n153.00\t526.00\t1.00\t3.249211\t2\t2\t2\t1\t2\n162.00\t672.00\t1.00\t3.279406\t2\t2\t2\t2\t2\n236.00\t482.00\t1.00\t3.206398\t2\t2\t2\t1\t2\n69.00\t729.00\t1.00\t3.196221\t2\t2\t2\t2\t2\n177.00\t795.00\t1.00\t3.390136\t2\t2\t2\t2\t2\n306.00\t645.00\t1.00\t3.260402\t2\t2\t2\t1\t2\n195.00\t559.00\t1.00\t3.108168\t2\t2\t1\t1\t2\n165.00\t690.00\t0.00\t3.163786\t2\t1\t2\t1\t2\n159.00\t601.00\t1.00\t3.329343\t1\t2\t2\t2\t2\n279.00\t455.00\t1.00\t3.521052\t2\t2\t1\t1\t2\n138.00\t815.00\t0.00\t3.117065\t2\t1\t2\t2\t2\n174.00\t545.00\t0.00\t3.239071\t1\t1\t2\t2\t2\n186.00\t813.00\t0.00\t3.011113\t1\t1\t2\t2\t2\n78.00\t462.00\t1.00\t3.105035\t2\t1\t2\t2\t2\n227.00\t765.00\t1.00\t3.146735\t2\t2\t2\t1\t2\n156.00\t704.00\t1.00\t3.048325\t2\t1\t2\t2\t2\n234.00\t505.00\t0.00\t3.064792\t2\t2\t2\t1\t2\n186.00\t640.00\t1.00\t3.148453\t2\t2\t1\t1\t2\n72.00\t578.00\t1.00\t3.030134\t2\t2\t2\t2\t2\n141.00\t676.00\t1.00\t3.170945\t2\t2\t2\t2\t2\n165.00\t503.00\t0.00\t3.060115\t2\t1\t2\t2\t2\n270.00\t545.00\t1.00\t3.146735\t2\t2\t1\t1\t2\n200.00\t564.00\t0.00\t3.218876\t2\t2\t1\t1\t2\n210.00\t630.00\t0.00\t3.250762\t2\t2\t2\t2\t2\n192.00\t628.00\t1.00\t3.564449\t1\t1\t2\t2\t2\n189.00\t872.00\t0.00\t3.131573\t1\t2\t2\t2\t2\n75.00\t476.00\t1.00\t3.237109\t2\t2\t2\t1\t2\n159.00\t862.00\t1.00\t3.253857\t1\t2\t2\t2\t2\n156.00\t605.00\t1.00\t3.466985\t1\t1\t2\t2\t2\n186.00\t596.00\t0.00\t3.111736\t2\t1\t2\t1\t2\n297.00\t643.00\t1.00\t3.100092\t1\t2\t2\t1\t2\n243.00\t675.00\t1.00\t3.085116\t1\t2\t1\t1\t2\n138.00\t1050.00\t0.00\t3.278276\t2\t2\t2\t2\t2\n180.00\t741.00\t0.00\t3.318178\t2\t1\t2\t1\t2\n168.00\t818.00\t1.00\t3.115735\t1\t1\t2\t2\t2\n117.00\t754.00\t0.00\t3.140698\t2\t2\t2\t1\t2\n153.00\t621.00\t0.00\t3.042616\t1\t1\t2\t2\t2\n252.00\t493.00\t1.00\t3.504656\t2\t2\t2\t1\t2\n147.00\t630.00\t1.00\t3.249599\t2\t2\t2\t2\t2\n240.00\t649.00\t0.00\t3.498929\t2\t2\t1\t1\t2\n156.00\t782.00\t0.00\t3.310908\t2\t2\t2\t1\t2\n147.00\t582.00\t0.00\t2.959587\t2\t1\t2\t2\t2\n180.00\t708.00\t0.00\t3.169686\t2\t2\t2\t1\t2\n192.00\t665.00\t0.00\t3.489513\t2\t2\t2\t2\t2\n207.00\t801.00\t0.00\t3.300271\t2\t2\t2\t1\t2\n144.00\t507.00\t1.00\t2.788708\t2\t2\t2\t1\t2\n171.00\t792.00\t1.00\t3.503453\t2\t2\t2\t2\t2\n174.00\t738.00\t1.00\t3.23593\t2\t2\t2\t1\t2\n183.00\t930.00\t0.00\t3.321071\t2\t2\t2\t2\t2\n240.00\t613.00\t0.00\t3.322515\t2\t1\t2\t1\t2\n174.00\t639.00\t1.00\t3.24688\t1\t2\t2\t2\t2\n201.00\t690.00\t1.00\t3.062924\t2\t2\t2\t1\t2\n105.00\t1077.00\t0.00\t3.346389\t2\t1\t2\t2\t2\n207.00\t513.00\t0.00\t3.178054\t2\t2\t2\t1\t2\n210.00\t644.00\t0.00\t3.02432\t2\t1\t2\t2\t2\n81.00\t560.00\t1.00\t3.403195\t2\t1\t2\t2\t2\n165.00\t814.00\t1.00\t3.129389\t1\t1\t1\t2\t2\n183.00\t596.00\t1.00\t3.108614\t2\t2\t2\t1\t2\n225.00\t572.00\t0.00\t3.201933\t2\t2\t2\t1\t2\n197.00\t665.00\t1.00\t3.599502\t1\t1\t2\t2\t2\n162.00\t691.00\t0.00\t3.24688\t2\t2\t2\t1\t2\n162.00\t644.00\t1.00\t3.195402\t2\t2\t2\t1\t2\n210.00\t723.00\t0.00\t3.173041\t1\t2\t2\t2\t2\n231.00\t639.00\t0.00\t3.158276\t2\t2\t2\t1\t2\n180.00\t954.00\t0.00\t3.128075\t1\t1\t2\t2\t2\n186.00\t721.00\t1.00\t3.181797\t1\t2\t1\t2\t2\n165.00\t729.00\t1.00\t3.227637\t1\t1\t1\t2\t2\n96.00\t765.00\t0.00\t3.34498\t2\t2\t1\t1\t2\n138.00\t469.00\t0.00\t3.170945\t2\t2\t2\t1\t2\n120.00\t688.00\t1.00\t3.526949\t1\t2\t2\t2\t2\n243.00\t516.00\t0.00\t3.145445\t2\t2\t2\t1\t2\n258.00\t689.00\t1.00\t3.244544\t2\t2\t1\t1\t2\n243.00\t740.00\t1.00\t3.198265\t2\t2\t1\t1\t2\n129.00\t609.00\t1.00\t3.073156\t2\t2\t2\t1\t2\n162.00\t608.00\t0.00\t3.257712\t1\t2\t2\t1\t2\n102.00\t663.00\t1.00\t3.416086\t2\t2\t2\t1\t2\n198.00\t806.00\t1.00\t3.173041\t2\t2\t2\t1\t2\n273.00\t690.00\t0.00\t3.194173\t1\t2\t2\t1\t2\n183.00\t625.00\t1.00\t3.585184\t2\t2\t2\t1\t2\n207.00\t716.00\t0.00\t3.310908\t2\t2\t2\t1\t2\n174.00\t501.00\t0.00\t3.023834\t2\t2\t2\t1\t2\n282.00\t589.00\t0.00\t3.125444\t2\t2\t2\t1\t2\n237.00\t557.00\t0.00\t3.121483\t2\t2\t2\t1\t2\n186.00\t625.00\t0.00\t3.190888\t2\t2\t2\t1\t2\n84.00\t466.00\t0.00\t3.160823\t2\t1\t2\t1\t2\n201.00\t623.00\t1.00\t3.121483\t2\t1\t2\t1\t2\n201.00\t657.00\t1.00\t3.404525\t2\t1\t2\t1\t2\n87.00\t609.00\t0.00\t3.088767\t2\t2\t2\t1\t2\n216.00\t631.00\t0.00\t3.244544\t2\t1\t2\t1\t2\n174.00\t542.00\t0.00\t3.112181\t2\t2\t2\t1\t2\n224.00\t625.00\t1.00\t3.2312\t2\t2\t2\t1\t2\n225.00\t709.00\t1.00\t3.369707\t2\t2\t2\t1\t2\n216.00\t471.00\t1.00\t3.08603\t1\t2\t2\t1\t2\n264.00\t566.00\t0.00\t3.180966\t2\t2\t2\t1\t2\n165.00\t648.00\t1.00\t3.21326\t2\t1\t2\t1\t2\n87.00\t672.00\t1.00\t3.199081\t2\t2\t2\t1\t2\n270.00\t723.00\t0.00\t3.109507\t1\t1\t2\t1\t2\n216.00\t687.00\t1.00\t3.301745\t2\t2\t1\t1\t2\n285.00\t462.00\t1.00\t3.251537\t1\t2\t2\t1\t2\n138.00\t794.00\t1.00\t3.32071\t2\t1\t2\t2\t2\n92.00\t678.00\t0.00\t3.092859\t2\t2\t1\t1\t2\n237.00\t510.00\t0.00\t3.507358\t2\t1\t1\t1\t2\n213.00\t681.00\t1.00\t3.381335\t2\t2\t2\t1\t2\n192.00\t767.00\t1.00\t3.335058\t1\t1\t2\t2\t2\n294.00\t524.00\t0.00\t3.411808\t1\t1\t2\t1\t2\n177.00\t619.00\t0.00\t3.264614\t1\t2\t2\t2\t2\n210.00\t459.00\t0.00\t3.606313\t2\t2\t1\t1\t2\n378.00\t769.00\t0.00\t3.209229\t2\t1\t2\t1\t2\n240.00\t452.00\t0.00\t3.243373\t1\t1\t2\t1\t2\n159.00\t779.00\t1.00\t3.266904\t2\t2\t2\t2\t2\n186.00\t686.00\t1.00\t3.068053\t1\t1\t2\t2\t2\n69.00\t658.00\t1.00\t3.137666\t2\t2\t2\t1\t2\n135.00\t983.00\t0.00\t3.06152\t1\t2\t2\t2\t2\n210.00\t536.00\t1.00\t3.345685\t2\t2\t2\t1\t2\n228.00\t697.00\t1.00\t3.248823\t1\t2\t2\t2\t2\n190.00\t750.00\t0.00\t3.322515\t2\t2\t2\t1\t2\n167.00\t584.00\t1.00\t3.262318\t2\t1\t2\t2\t2\n218.00\t544.00\t0.00\t3.275256\t2\t2\t2\t1\t2\n210.00\t571.00\t0.00\t2.95178\t1\t1\t2\t2\t2\n186.00\t722.00\t0.00\t3.538347\t2\t2\t2\t1\t2\n264.00\t667.00\t0.00\t3.29101\t2\t2\t1\t1\t2\n150.00\t683.00\t0.00\t2.968875\t1\t1\t2\t2\t2\n219.00\t531.00\t1.00\t3.209633\t2\t1\t2\t1\t2\n213.00\t578.00\t1.00\t3.508256\t2\t2\t2\t1\t2\n174.00\t665.00\t1.00\t3.240246\t1\t2\t2\t2\t2\n174.00\t513.00\t0.00\t3.070376\t2\t2\t2\t1\t2\n204.00\t607.00\t1.00\t3.179303\t2\t2\t1\t2\t2\n201.00\t713.00\t1.00\t3.623274\t2\t2\t2\t2\t2\n156.00\t619.00\t1.00\t3.346037\t2\t2\t2\t1\t2\n129.00\t849.00\t1.00\t3.378952\t2\t1\t2\t2\t2\n285.00\t596.00\t0.00\t3.145875\t1\t1\t1\t1\t2\n252.00\t1286.00\t0.00\t3.15487\t2\t2\t2\t1\t2\n129.00\t730.00\t0.00\t3.035914\t2\t1\t2\t2\t2\n129.00\t949.00\t1.00\t3.22843\t2\t2\t2\t2\t2\n180.00\t701.00\t0.00\t3.273364\t2\t1\t2\t2\t2\n177.00\t539.00\t1.00\t3.158276\t2\t2\t2\t1\t2\n195.00\t641.00\t1.00\t2.93492\t2\t1\t2\t2\t2\n255.00\t724.00\t0.00\t3.201933\t2\t2\t2\t1\t2\n153.00\t512.00\t0.00\t3.441379\t2\t2\t2\t2\t2\n285.00\t646.00\t0.00\t3.288775\t2\t2\t2\t1\t2\n237.00\t512.00\t1.00\t3.014063\t2\t1\t1\t1\t2\n168.00\t737.00\t1.00\t3.185112\t2\t1\t2\t2\t2\n231.00\t479.00\t0.00\t3.058707\t2\t1\t2\t1\t2\n243.00\t458.00\t0.00\t3.356549\t2\t2\t2\t1\t2\n198.00\t876.00\t0.00\t3.086943\t2\t1\t2\t2\t2\n171.00\t828.00\t1.00\t3.415429\t1\t2\t2\t2\t2\n267.00\t508.00\t0.00\t3.054944\t2\t2\t2\t1\t2\n114.00\t576.00\t1.00\t3.217675\t2\t1\t2\t2\t2\n174.00\t745.00\t0.00\t3.105483\t2\t2\t2\t1\t2\n189.00\t635.00\t0.00\t3.194173\t1\t1\t2\t2\t2\n189.00\t621.00\t0.00\t3.25347\t1\t2\t2\t2\t2\n90.00\t378.00\t0.00\t2.850707\t2\t2\t2\t1\t2\n210.00\t648.00\t1.00\t3.275256\t2\t2\t2\t1\t2\n204.00\t658.00\t1.00\t3.432696\t2\t2\t2\t1\t2\n153.00\t686.00\t1.00\t3.466673\t2\t2\t2\t2\t2\n267.00\t589.00\t1.00\t3.13201\t2\t2\t2\t1\t2\n123.00\t628.00\t1.00\t3.21326\t2\t1\t2\t1\t2\n83.00\t577.00\t0.00\t3.221273\t2\t2\t2\t1\t2\n222.00\t731.00\t0.00\t3.555348\t1\t1\t2\t2\t2\n189.00\t499.00\t0.00\t3.221273\t2\t1\t1\t1\t2\n102.00\t344.00\t0.00\t3.258097\t2\t2\t2\t1\t2\n156.00\t772.00\t1.00\t3.358986\t2\t1\t2\t2\t2\n186.00\t618.00\t0.00\t3.333275\t2\t2\t2\t1\t2\n105.00\t428.00\t1.00\t2.99373\t2\t1\t2\t1\t2\n132.00\t675.00\t0.00\t3.609836\t2\t1\t2\t2\t2\n183.00\t690.00\t1.00\t3.270709\t2\t1\t2\t1\t2\n258.00\t454.00\t1.00\t3.186766\t2\t2\t2\t1\t2\n141.00\t770.00\t0.00\t3.322515\t1\t1\t2\t2\t2\n255.00\t463.00\t0.00\t3.500439\t2\t2\t2\t1\t2\n165.00\t748.00\t1.00\t3.354106\t2\t1\t1\t2\t2\n234.00\t549.00\t1.00\t3.501646\t1\t1\t2\t1\t2\n135.00\t538.00\t1.00\t3.380654\t1\t1\t2\t2\t2\n249.00\t462.00\t1.00\t3.299534\t2\t2\t2\t1\t2\n177.00\t605.00\t1.00\t3.554205\t2\t2\t2\t2\t2\n174.00\t519.00\t0.00\t2.851284\t2\t1\t2\t1\t2\n183.00\t707.00\t0.00\t3.078233\t2\t2\t2\t2\t2\n204.00\t556.00\t1.00\t3.278276\t2\t2\t2\t1\t2\n153.00\t629.00\t0.00\t3.196221\t2\t2\t2\t1\t2\n165.00\t577.00\t0.00\t3.133754\t1\t2\t2\t2\t2\n225.00\t654.00\t0.00\t3.271468\t2\t2\t1\t1\t2\n231.00\t684.00\t1.00\t3.339322\t2\t1\t2\t2\t2\n210.00\t717.00\t0.00\t3.244544\t2\t2\t2\t1\t2\n114.00\t662.00\t1.00\t3.067122\t2\t1\t2\t2\t2\n225.00\t585.00\t0.00\t3.019449\t2\t2\t2\t1\t2\n168.00\t522.00\t1.00\t3.061988\t2\t2\t2\t2\t2\n222.00\t652.00\t0.00\t3.066191\t2\t2\t2\t1\t2\n195.00\t776.00\t0.00\t2.969388\t2\t1\t2\t2\t2\n234.00\t521.00\t0.00\t3.356549\t2\t2\t1\t1\t2\n105.00\t488.00\t1.00\t3.335058\t1\t2\t2\t2\t2\n180.00\t590.00\t0.00\t3.29101\t2\t2\t1\t1\t2\n180.00\t615.00\t0.00\t3.048325\t1\t1\t2\t2\t2\n210.00\t654.00\t1.00\t3.392829\t2\t2\t2\t1\t2\n264.00\t661.00\t1.00\t3.269569\t2\t2\t2\t1\t2\n183.00\t841.00\t1.00\t3.36833\t1\t2\t2\t2\t2\n156.00\t703.00\t0.00\t3.279783\t2\t2\t2\t1\t2\n180.00\t915.00\t1.00\t3.308351\t2\t2\t2\t2\t2\n168.00\t843.00\t0.00\t3.285412\t1\t1\t1\t2\t2\n195.00\t832.00\t0.00\t3.287282\t2\t2\t2\t1\t2\n180.00\t1020.00\t1.00\t3.442019\t1\t2\t2\t2\t2\n225.00\t513.00\t0.00\t3.322515\t1\t1\t2\t1\t2\n180.00\t638.00\t1.00\t2.922624\t1\t1\t2\t2\t2\n216.00\t964.00\t1.00\t3.426215\t2\t1\t2\t1\t2\n234.00\t632.00\t0.00\t3.12016\t1\t1\t2\t1\t2\n192.00\t739.00\t1.00\t3.275256\t1\t1\t2\t2\t2\n54.00\t702.00\t0.00\t2.811208\t2\t1\t2\t2\t2\n60.00\t757.00\t0.00\t3.226844\t2\t2\t2\t2\t2\n246.00\t676.00\t0.00\t3.169686\t1\t2\t2\t1\t2\n171.00\t860.00\t1.00\t3.389125\t2\t1\t2\t2\t2\n270.00\t452.00\t0.00\t3.180551\t2\t2\t2\t1\t2\n183.00\t695.00\t0.00\t3.125444\t2\t1\t2\t2\t2\n195.00\t837.00\t1.00\t3.239854\t1\t2\t1\t2\t2\n93.00\t802.00\t0.00\t3.224858\t2\t2\t2\t2\t2\n141.00\t561.00\t1.00\t3.17346\t2\t2\t2\t1\t2\n183.00\t1009.00\t1.00\t3.310908\t2\t1\t2\t2\t2\n243.00\t619.00\t0.00\t3.166319\t2\t2\t2\t1\t2\n96.00\t586.00\t1.00\t3.02965\t1\t2\t2\t2\t2\n96.00\t739.00\t0.00\t3.070376\t2\t2\t2\t1\t2\n45.00\t725.00\t0.00\t2.963725\t2\t1\t2\t2\t2\n117.00\t641.00\t0.00\t2.998728\t2\t1\t2\t2\t2\n234.00\t686.00\t1.00\t3.131573\t2\t2\t2\t1\t2\n159.00\t567.00\t0.00\t3.183456\t2\t1\t2\t1\t2\n126.00\t691.00\t1.00\t3.543854\t1\t1\t2\t2\t2\n231.00\t723.00\t0.00\t3.294354\t2\t2\t2\t1\t2\n192.00\t721.00\t1.00\t3.093766\t1\t1\t2\t2\t2\n192.00\t640.00\t0.00\t3.351657\t1\t2\t2\t2\t2\n257.00\t653.00\t1.00\t3.309813\t2\t2\t1\t1\t2\n60.00\t638.00\t0.00\t3.322515\t1\t1\t2\t2\t2\n186.00\t880.00\t1.00\t3.356549\t2\t2\t2\t1\t2\n129.00\t694.00\t0.00\t3.125444\t2\t2\t2\t2\t2\n219.00\t612.00\t0.00\t3.237109\t2\t2\t2\t1\t2\n186.00\t721.00\t0.00\t2.979603\t2\t2\t2\t2\t2\n240.00\t595.00\t0.00\t3.244154\t2\t1\t2\t1\t2\n216.00\t670.00\t0.00\t2.91398\t2\t1\t2\t2\t2\n132.00\t564.00\t0.00\t3.234749\t2\t2\t1\t1\t2\n132.00\t693.00\t0.00\t3.188004\t1\t1\t2\t2\t2\n213.00\t590.00\t1.00\t3.215269\t2\t2\t2\t1\t2\n207.00\t514.00\t1.00\t3.355851\t1\t2\t2\t1\t2\n111.00\t640.00\t1.00\t3.073156\t2\t1\t2\t1\t2\n114.00\t644.00\t1.00\t3.127199\t1\t2\t2\t2\t2\n216.00\t613.00\t1.00\t3.346741\t2\t2\t2\t1\t2\n177.00\t1166.00\t1.00\t3.12016\t2\t1\t2\t1\t2\n138.00\t630.00\t0.00\t3.179303\t2\t2\t2\t2\t2\n186.00\t736.00\t0.00\t3.289893\t2\t1\t2\t2\t2\n267.00\t473.00\t1.00\t2.998229\t2\t2\t2\t1\t2\n72.00\t685.00\t0.00\t2.961658\t2\t1\t2\t2\t2\n69.00\t833.00\t1.00\t3.331847\t2\t1\t2\t2\t2\n99.00\t612.00\t0.00\t3.242202\t1\t2\t2\t1\t2\n174.00\t667.00\t1.00\t3.165897\t1\t1\t2\t1\t2\n198.00\t732.00\t1.00\t3.342155\t1\t2\t2\t2\t2\n96.00\t551.00\t0.00\t3.044999\t2\t2\t2\t1\t2\n201.00\t685.00\t1.00\t3.15487\t2\t1\t2\t2\t2\n150.00\t533.00\t0.00\t2.925846\t2\t2\t2\t1\t2\n159.00\t705.00\t1.00\t3.092405\t2\t1\t2\t2\t2\n198.00\t612.00\t1.00\t3.415758\t2\t2\t2\t1\t2\n195.00\t888.00\t0.00\t3.11795\t2\t2\t2\t1\t2\n126.00\t678.00\t1.00\t3.24142\t1\t1\t2\t2\t2\n171.00\t510.00\t0.00\t3.23593\t2\t2\t2\t1\t2\n111.00\t767.00\t1.00\t3.206398\t2\t2\t2\t2\t2\n96.00\t603.00\t1.00\t3.442339\t2\t2\t2\t1\t2\n132.00\t472.00\t0.00\t3.241029\t2\t1\t2\t2\t2\n159.00\t644.00\t1.00\t3.375538\t2\t1\t2\t2\t2\n111.00\t884.00\t0.00\t3.035434\t1\t1\t2\t2\t2\n138.00\t708.00\t0.00\t3.27639\t2\t1\t2\t2\t2\n138.00\t592.00\t0.00\t2.879198\t2\t1\t2\t2\t2\n309.00\t653.00\t1.00\t3.36557\t2\t2\t2\t1\t2\n231.00\t716.00\t1.00\t3.346741\t2\t2\t2\t1\t2\n114.00\t862.00\t0.00\t3.301009\t2\t2\t2\t2\t2\n102.00\t617.00\t1.00\t3.400197\t2\t1\t2\t2\t2\n147.00\t592.00\t0.00\t3.074081\t2\t2\t2\t1\t2\n162.00\t527.00\t0.00\t3.591542\t2\t2\t2\t2\t2\n177.00\t810.00\t0.00\t3.048799\t1\t2\t1\t2\t2\n165.00\t523.00\t0.00\t3.005683\t2\t2\t2\t1\t2\n162.00\t614.00\t1.00\t3.492865\t1\t1\t2\t2\t2\n78.00\t954.00\t0.00\t3.603322\t1\t1\t2\t2\t2\n105.00\t479.00\t0.00\t3.246491\t2\t1\t2\t1\t2\n165.00\t716.00\t1.00\t3.168845\t2\t2\t2\t1\t2\n237.00\t594.00\t0.00\t3.309813\t2\t1\t2\t1\t2\n225.00\t607.00\t0.00\t3.109507\t1\t2\t2\t2\t2\n201.00\t696.00\t1.00\t3.270709\t2\t2\t2\t1\t2\n72.00\t734.00\t1.00\t3.011606\t1\t2\t2\t2\t2\n168.00\t534.00\t0.00\t3.170945\t2\t1\t2\t2\t2\n146.00\t818.00\t1.00\t3.070376\t2\t1\t2\t2\t2\n198.00\t545.00\t0.00\t3.007661\t2\t2\t2\t1\t2\n93.00\t726.00\t1.00\t2.913437\t2\t1\t2\t2\t2\n237.00\t552.00\t1.00\t3.182627\t2\t2\t2\t1\t2\n153.00\t589.00\t1.00\t3.299903\t1\t2\t2\t2\t2\n162.00\t476.00\t0.00\t3.299534\t2\t2\t2\t1\t2\n240.00\t787.00\t0.00\t3.083285\t2\t2\t2\t2\t2\n240.00\t472.00\t0.00\t3.357942\t2\t2\t2\t1\t2\n237.00\t743.00\t1.00\t3.114848\t2\t2\t2\t1\t2\n198.00\t433.00\t1.00\t3.072693\t2\t2\t2\t1\t2\n216.00\t914.00\t0.00\t3.361763\t1\t1\t2\t2\t2\n90.00\t526.00\t0.00\t2.998229\t2\t1\t2\t1\t2\n144.00\t743.00\t1.00\t3.670206\t1\t2\t2\t2\t2\n276.00\t717.00\t0.00\t3.203559\t2\t2\t1\t1\t2\n117.00\t644.00\t0.00\t3.208421\t2\t1\t2\t2\t2\n171.00\t795.00\t0.00\t3.034953\t2\t1\t2\t1\t2\n174.00\t489.00\t1.00\t3.210844\t2\t2\t2\t1\t2\n150.00\t505.00\t0.00\t3.073619\t2\t2\t2\t1\t2\n81.00\t766.00\t1.00\t3.292126\t1\t1\t2\t2\t2\n186.00\t744.00\t0.00\t3.323956\t2\t2\t2\t1\t2\n183.00\t884.00\t0.00\t3.282414\t2\t2\t2\t2\t2\n147.00\t782.00\t0.00\t3.243764\t1\t1\t2\t2\t2\n105.00\t631.00\t1.00\t3.21165\t2\t2\t2\t1\t2\n147.00\t689.00\t1.00\t3.318902\t2\t2\t2\t2\t2\n207.00\t729.00\t0.00\t3.227637\t2\t1\t2\t2\t2\n213.00\t610.00\t0.00\t2.984671\t2\t2\t2\t1\t2\n261.00\t547.00\t0.00\t3.278276\t1\t1\t2\t1\t2\n168.00\t526.00\t1.00\t3.47785\t1\t1\t2\t2\t2\n177.00\t560.00\t0.00\t3.117507\t2\t1\t1\t2\t2\n162.00\t475.00\t1.00\t3.089678\t2\t2\t2\t1\t2\n156.00\t647.00\t0.00\t3.097837\t2\t1\t2\t1\t2\n99.00\t660.00\t1.00\t3.092405\t2\t2\t2\t2\t2\n159.00\t593.00\t0.00\t3.222071\t1\t1\t2\t2\t2\n309.00\t630.00\t0.00\t3.022861\t1\t1\t2\t1\t2\n255.00\t458.00\t0.00\t3.157426\t2\t2\t2\t1\t2\n183.00\t857.00\t1.00\t3.441699\t1\t1\t2\t2\t2\n261.00\t545.00\t1.00\t3.240246\t2\t2\t2\t1\t2\n150.00\t882.00\t0.00\t3.165897\t2\t1\t2\t2\t2\n258.00\t607.00\t1.00\t3.254629\t1\t2\t2\t1\t2\n195.00\t552.00\t0.00\t3.357594\t1\t1\t2\t2\t2\n117.00\t677.00\t1.00\t3.383712\t2\t1\t2\t2\t2\n180.00\t601.00\t1.00\t3.125005\t2\t2\t1\t1\t2\n207.00\t675.00\t1.00\t3.557061\t2\t1\t2\t2\t2\n225.00\t668.00\t0.00\t3.369018\t2\t2\t2\t1\t2\n180.00\t930.00\t1.00\t3.493169\t1\t1\t2\t2\t2\n312.00\t635.00\t1.00\t3.15487\t2\t2\t2\t1\t2\n219.00\t613.00\t1.00\t3.17346\t1\t2\t1\t1\t2\n90.00\t467.00\t1.00\t2.986692\t1\t1\t1\t2\t2\n123.00\t747.00\t1.00\t3.201526\t2\t1\t2\t1\t2\n198.00\t807.00\t0.00\t3.193763\t2\t2\t2\t2\t2\n273.00\t777.00\t0.00\t3.046901\t2\t2\t2\t1\t2\n164.00\t804.00\t1.00\t3.134624\t2\t2\t2\t1\t2\n153.00\t726.00\t1.00\t3.641788\t2\t2\t2\t2\t2\n246.00\t647.00\t0.00\t3.121483\t2\t2\t2\t1\t2\n240.00\t836.00\t1.00\t3.256557\t2\t1\t2\t1\t2\n194.00\t707.00\t0.00\t3.279406\t1\t1\t2\t2\t2\n117.00\t572.00\t1.00\t3.531055\t2\t2\t2\t1\t2\n231.00\t542.00\t1.00\t3.451574\t1\t2\t2\t1\t2\n120.00\t782.00\t0.00\t3.089678\t2\t1\t2\t1\t2\n120.00\t864.00\t0.00\t2.892037\t2\t2\t2\t2\t2\n309.00\t739.00\t0.00\t3.131573\t2\t2\t2\t1\t2\n117.00\t638.00\t0.00\t3.288775\t2\t1\t2\t1\t2\n129.00\t565.00\t0.00\t3.135929\t2\t2\t2\t2\t2\n213.00\t520.00\t1.00\t3.485232\t2\t2\t2\t1\t2\n258.00\t739.00\t1.00\t3.246102\t2\t2\t2\t1\t2\n201.00\t707.00\t0.00\t3.197039\t2\t2\t2\t2\t2\n204.00\t572.00\t1.00\t3.404193\t1\t2\t2\t1\t2\n138.00\t528.00\t1.00\t3.423285\t2\t2\t1\t1\t2\n213.00\t780.00\t0.00\t3.343921\t1\t1\t2\t2\t2\n174.00\t626.00\t0.00\t2.999724\t2\t2\t2\t2\t2\n120.00\t832.00\t1.00\t3.684369\t1\t1\t2\t2\t2\n90.00\t837.00\t1.00\t3.425239\t2\t1\t2\t2\t2\n159.00\t847.00\t0.00\t3.292498\t2\t2\t2\t2\t2\n114.00\t752.00\t0.00\t3.092405\t1\t1\t2\t2\t2\n117.00\t754.00\t1.00\t3.363149\t1\t1\t2\t2\t2\n300.00\t775.00\t1.00\t3.244933\t2\t1\t1\t1\t1\n130.00\t620.00\t0.00\t3.379974\t1\t1\t2\t2\t1\n210.00\t595.00\t0.00\t3.116622\t2\t1\t1\t1\t1\n90.00\t879.00\t1.00\t3.074543\t1\t1\t2\t2\t1\n205.00\t724.00\t1.00\t3.239071\t2\t1\t1\t1\t1\n160.00\t956.00\t1.00\t3.137666\t1\t1\t2\t2\t1\n190.00\t853.00\t1.00\t3.075929\t2\t2\t2\t1\t1\n290.00\t827.00\t1.00\t3.279783\t2\t2\t1\t1\t1\n120.00\t646.00\t1.00\t3.345332\t2\t1\t2\t2\t1\n130.00\t879.00\t0.00\t3.273364\t2\t1\t2\t2\t1\n290.00\t698.00\t1.00\t3.262701\t2\t1\t1\t1\t1\n90.00\t595.00\t1.00\t3.055415\t2\t1\t2\t2\t1\n180.00\t905.00\t1.00\t3.331847\t2\t2\t2\t1\t1\n160.00\t905.00\t1.00\t3.399195\t2\t1\t2\t2\t1\n155.00\t672.00\t0.00\t3.129389\t2\t1\t1\t1\t1\n85.00\t750.00\t1.00\t3.070376\t2\t1\t2\t1\t1\n140.00\t724.00\t1.00\t3.141563\t1\t1\t2\t2\t1\n165.00\t672.00\t0.00\t3.136798\t2\t1\t2\t1\t1\n100.00\t801.00\t1.00\t2.999724\t2\t2\t1\t1\t1\n220.00\t595.00\t1.00\t3.310908\t2\t1\t2\t1\t1\n150.00\t982.00\t1.00\t2.993229\t2\t1\t2\t2\t1\n75.00\t775.00\t1.00\t3.268047\t2\t1\t2\t1\t1\n300.00\t724.00\t0.00\t3.181797\t2\t2\t1\t1\t1\n100.00\t931.00\t1.00\t3.490124\t2\t1\t2\t2\t1\n305.00\t801.00\t1.00\t3.240246\t2\t2\t2\t1\t1\n140.00\t853.00\t1.00\t3.192121\t1\t1\t2\t2\t1\n185.00\t775.00\t1.00\t3.475686\t2\t1\t2\t1\t1\n190.00\t853.00\t0.00\t3.376563\t1\t1\t2\t2\t1\n150.00\t775.00\t0.00\t3.149311\t2\t2\t2\t2\t1\n200.00\t775.00\t0.00\t3.212455\t2\t2\t1\t1\t1\n115.00\t698.00\t1.00\t3.304686\t1\t1\t1\t2\t1\n190.00\t982.00\t1.00\t3.161247\t2\t1\t2\t1\t1\n220.00\t775.00\t1.00\t3.538347\t2\t1\t2\t1\t1\n150.00\t879.00\t0.00\t3.137666\t1\t1\t2\t2\t1\n150.00\t775.00\t1.00\t3.301009\t2\t1\t2\t1\t1\n115.00\t672.00\t1.00\t3.289893\t1\t1\t2\t2\t1\n230.00\t956.00\t1.00\t3.312002\t2\t2\t2\t1\t1\n210.00\t672.00\t1.00\t3.101443\t1\t2\t1\t2\t1\n190.00\t595.00\t0.00\t3.283539\t2\t1\t2\t1\t1\n160.00\t827.00\t0.00\t3.042616\t2\t1\t2\t2\t1\n110.00\t724.00\t1.00\t3.566147\t1\t1\t2\t2\t1\n220.00\t543.00\t0.00\t2.891482\t2\t1\t1\t1\t1\n130.00\t956.00\t1.00\t3.383712\t1\t1\t2\t2\t1\n90.00\t750.00\t1.00\t3.162094\t2\t1\t1\t2\t1\n180.00\t620.00\t0.00\t3.140265\t2\t1\t2\t1\t1\n200.00\t646.00\t1.00\t3.505557\t1\t1\t2\t2\t1\n220.00\t569.00\t0.00\t3.186766\t2\t1\t2\t1\t1\n190.00\t853.00\t0.00\t3.150169\t2\t1\t2\t1\t1\n130.00\t1008.00\t0.00\t3.283539\t1\t1\t2\t2\t1\n165.00\t620.00\t0.00\t2.882564\t2\t1\t2\t1\t1\n250.00\t569.00\t0.00\t3.125005\t2\t1\t2\t1\t1\n120.00\t1163.00\t1.00\t3.109507\t1\t1\t2\t2\t1\n250.00\t698.00\t1.00\t3.509454\t2\t1\t1\t1\t1\n70.00\t1008.00\t1.00\t3.32071\t1\t1\t2\t2\t1\n160.00\t698.00\t0.00\t3.070376\t2\t1\t2\t1\t1\n120.00\t853.00\t0.00\t2.944439\t2\t1\t2\t1\t1\n85.00\t931.00\t1.00\t3.742894\t2\t1\t2\t2\t1\n90.00\t982.00\t0.00\t3.299903\t1\t1\t2\t2\t1\n120.00\t543.00\t0.00\t3.270709\t2\t1\t2\t1\t1\n190.00\t750.00\t1.00\t3.417071\t2\t2\t1\t1\t1\n230.00\t620.00\t0.00\t3.058707\t2\t2\t2\t1\t1\n70.00\t931.00\t1.00\t3.109507\t1\t1\t1\t2\t1\n210.00\t982.00\t1.00\t3.337903\t2\t1\t2\t2\t1\n200.00\t905.00\t1.00\t3.381335\t2\t2\t2\t1\t1\n165.00\t956.00\t0.00\t3.370394\t2\t1\t1\t2\t1\n200.00\t775.00\t1.00\t3.24688\t2\t1\t2\t1\t1\n120.00\t672.00\t0.00\t3.132882\t2\t1\t2\t2\t1\n140.00\t595.00\t1.00\t3.198265\t2\t1\t2\t1\t1\n140.00\t620.00\t0.00\t2.909084\t2\t1\t1\t2\t1\n180.00\t750.00\t1.00\t3.404525\t2\t1\t2\t1\t1\n160.00\t827.00\t1.00\t3.162094\t2\t1\t2\t2\t1\n325.00\t905.00\t1.00\t3.129389\t1\t2\t1\t1\t1\n250.00\t724.00\t1.00\t3.139833\t2\t2\t1\t1\t1\n150.00\t1267.00\t1.00\t3.25925\t1\t1\t2\t2\t1\n170.00\t620.00\t1.00\t3.379633\t2\t1\t2\t1\t1\n170.00\t905.00\t1.00\t3.273364\t2\t1\t2\t1\t1\n100.00\t595.00\t0.00\t2.956472\t2\t1\t2\t1\t1\n180.00\t1008.00\t1.00\t3.516013\t1\t1\t2\t2\t1\n180.00\t853.00\t1.00\t3.497113\t2\t1\t1\t1\t1\n160.00\t698.00\t1.00\t3.284664\t2\t1\t2\t1\t1\n190.00\t698.00\t0.00\t3.192121\t1\t1\t2\t2\t1\n115.00\t698.00\t1.00\t3.342862\t1\t1\t1\t2\t1\n165.00\t620.00\t1.00\t3.287282\t2\t1\t2\t1\t1\n110.00\t801.00\t0.00\t3.236323\t2\t1\t1\t2\t1\n200.00\t595.00\t0.00\t3.393165\t2\t2\t2\t1\t1\n90.00\t750.00\t1.00\t3.318178\t1\t1\t2\t2\t1\n215.00\t827.00\t1.00\t3.326833\t2\t2\t1\t1\t1\n180.00\t827.00\t1.00\t3.242202\t2\t1\t2\t2\t1\n125.00\t595.00\t1.00\t3.415429\t1\t1\t2\t2\t1\n120.00\t595.00\t1.00\t3.190476\t2\t1\t2\t1\t1\n120.00\t750.00\t1.00\t3.299903\t1\t1\t2\t2\t1\n60.00\t698.00\t0.00\t2.809403\t1\t1\t2\t2\t1\n210.00\t672.00\t1.00\t3.270709\t2\t2\t1\t1\t1\n370.00\t801.00\t0.00\t3.245712\t2\t2\t2\t1\t1\n65.00\t543.00\t1.00\t3.227637\t1\t1\t2\t2\t1\n230.00\t672.00\t1.00\t3.254243\t2\t2\t2\t1\t1\n170.00\t905.00\t0.00\t3.197039\t2\t2\t2\t2\t1\n170.00\t646.00\t1.00\t3.69883\t1\t1\t2\t2\t1\n240.00\t620.00\t1.00\t3.581016\t2\t2\t1\t1\t1\n160.00\t724.00\t1.00\t3.533687\t2\t1\t2\t2\t1\n290.00\t698.00\t0.00\t3.168424\t2\t1\t1\t1\t1\n110.00\t1060.00\t1.00\t3.326833\t2\t1\t2\t2\t1\n95.00\t853.00\t1.00\t3.083285\t1\t1\t2\t2\t1\n370.00\t827.00\t1.00\t3.140265\t1\t1\t2\t1\t1\n230.00\t775.00\t1.00\t3.184698\t2\t1\t1\t1\t1\n170.00\t646.00\t1.00\t3.425239\t1\t2\t2\t2\t1\n160.00\t672.00\t0.00\t3.100543\t2\t1\t2\t2\t1\n370.00\t620.00\t0.00\t3.170945\t2\t2\t1\t1\t1\n250.00\t724.00\t0.00\t3.170945\t2\t1\t1\t1\t1\n105.00\t853.00\t1.00\t3.519277\t2\t1\t2\t2\t1\n240.00\t620.00\t0.00\t3.193763\t2\t1\t2\t1\t1\n130.00\t1008.00\t0.00\t3.22843\t1\t1\t2\t2\t1\n200.00\t801.00\t0.00\t3.271468\t1\t1\t2\t2\t1\n130.00\t775.00\t1.00\t3.017004\t2\t1\t1\t1\t1\n135.00\t775.00\t1.00\t3.297687\t2\t1\t2\t1\t1\n90.00\t698.00\t1.00\t3.379633\t2\t1\t2\t1\t1\n80.00\t750.00\t1.00\t3.237894\t1\t1\t2\t2\t1\n230.00\t595.00\t1.00\t3.225255\t2\t1\t1\t1\t1\n150.00\t646.00\t1.00\t3.39081\t1\t1\t2\t2\t1\n155.00\t646.00\t0.00\t3.049747\t2\t2\t1\t1\t1\n100.00\t620.00\t1.00\t3.042616\t2\t1\t2\t2\t1\n180.00\t827.00\t1.00\t3.219276\t2\t1\t2\t1\t1\n180.00\t724.00\t1.00\t3.505557\t1\t2\t2\t2\t1\n210.00\t569.00\t1.00\t3.439135\t1\t2\t1\t1\t1\n270.00\t620.00\t0.00\t3.269569\t2\t1\t2\t1\t1\n180.00\t827.00\t0.00\t3.569251\t2\t1\t2\t2\t1\n190.00\t724.00\t1.00\t3.24688\t2\t1\t1\t1\t1\n135.00\t465.00\t0.00\t3.537475\t1\t1\t1\t1\t1\n225.00\t698.00\t1.00\t3.234355\t1\t1\t2\t2\t1\n135.00\t801.00\t0.00\t3.208421\t2\t2\t2\t1\t1\n85.00\t724.00\t1.00\t3.752089\t2\t1\t2\t2\t1\n150.00\t646.00\t1.00\t3.148882\t2\t1\t2\t1\t1\n130.00\t646.00\t1.00\t3.401864\t1\t1\t2\t2\t1\n180.00\t672.00\t1.00\t3.226844\t1\t1\t1\t2\t1\n200.00\t750.00\t0.00\t3.187179\t1\t1\t2\t2\t1\n210.00\t646.00\t1.00\t3.205993\t2\t1\t2\t1\t1\n160.00\t956.00\t1.00\t3.530763\t1\t1\t2\t2\t1\n160.00\t801.00\t1.00\t3.288775\t1\t1\t1\t1\t1\n90.00\t801.00\t0.00\t3.192121\t1\t1\t2\t2\t1\n260.00\t801.00\t1.00\t3.275256\t2\t2\t1\t1\t1\n200.00\t646.00\t0.00\t3.405189\t2\t1\t2\t1\t1\n190.00\t1344.00\t1.00\t3.344627\t2\t1\t2\t2\t1\n180.00\t750.00\t1.00\t3.219276\t1\t2\t2\t1\t1\n280.00\t646.00\t1.00\t3.208017\t2\t2\t1\t1\t1\n200.00\t698.00\t1.00\t3.299534\t2\t1\t1\t1\t1\n185.00\t956.00\t0.00\t3.210844\t2\t1\t1\t1\t1\n100.00\t672.00\t1.00\t3.343215\t1\t1\t2\t2\t1\n130.00\t801.00\t0.00\t3.187179\t2\t2\t2\t2\t1\n110.00\t569.00\t1.00\t3.068053\t1\t1\t2\t2\t1\n155.00\t724.00\t0.00\t3.016515\t2\t1\t2\t1\t1\n260.00\t569.00\t1.00\t3.414114\t1\t2\t2\t1\t1\n150.00\t801.00\t0.00\t3.157\t1\t1\t2\t2\t1\n180.00\t931.00\t1.00\t3.21326\t2\t2\t2\t1\t1\n190.00\t465.00\t0.00\t3.128513\t2\t2\t2\t1\t1\n280.00\t543.00\t1.00\t3.14974\t2\t2\t1\t1\t1\n210.00\t1318.00\t0.00\t3.315276\t2\t1\t2\t2\t1\n120.00\t646.00\t1.00\t3.117507\t2\t1\t1\t1\t1\n150.00\t931.00\t0.00\t2.959587\t2\t1\t2\t2\t1\n210.00\t543.00\t1.00\t3.137666\t2\t2\t1\t1\t1\n140.00\t724.00\t0.00\t3.300271\t2\t1\t2\t1\t1\n175.00\t698.00\t1.00\t3.1307\t1\t1\t2\t2\t1\n280.00\t646.00\t1.00\t3.391484\t2\t1\t1\t1\t1\n155.00\t775.00\t0.00\t3.333632\t1\t1\t2\t2\t1\n160.00\t801.00\t1.00\t3.428813\t2\t2\t2\t2\t1\n230.00\t724.00\t1.00\t3.150169\t2\t2\t1\t1\t1\n195.00\t750.00\t0.00\t3.242202\t1\t1\t2\t2\t1\n190.00\t724.00\t1.00\t3.244544\t2\t2\t1\t1\t1\n70.00\t879.00\t0.00\t3.16674\t1\t1\t2\t2\t1\n180.00\t724.00\t1.00\t3.219276\t2\t1\t2\t1\t1\n230.00\t595.00\t1.00\t3.329343\t2\t2\t2\t1\t1\n100.00\t724.00\t1.00\t3.215269\t2\t1\t2\t1\t1\n100.00\t750.00\t1.00\t3.105035\t2\t1\t2\t2\t1\n170.00\t724.00\t1.00\t3.128075\t1\t1\t2\t2\t1\n190.00\t646.00\t0.00\t3.004196\t2\t2\t2\t1\t1\n80.00\t698.00\t1.00\t3.250762\t1\t1\t2\t2\t1\n220.00\t724.00\t1.00\t3.539509\t2\t1\t1\t2\t1\n140.00\t620.00\t0.00\t3.364188\t2\t2\t1\t1\t1\n130.00\t879.00\t1.00\t3.449035\t1\t1\t1\t2\t1\n130.00\t905.00\t0.00\t3.434632\t2\t1\t2\t1\t1\n130.00\t827.00\t0.00\t2.948116\t2\t2\t2\t2\t1\n155.00\t698.00\t0.00\t3.220475\t2\t1\t2\t1\t1\n70.00\t569.00\t1.00\t3.205993\t2\t1\t1\t1\t1\n130.00\t698.00\t1.00\t3.183456\t2\t1\t2\t1\t1\n215.00\t698.00\t1.00\t2.862772\t2\t1\t2\t1\t1\n120.00\t827.00\t0.00\t2.761275\t1\t1\t2\t2\t1\n170.00\t672.00\t0.00\t3.222868\t2\t1\t2\t1\t1\n160.00\t775.00\t0.00\t3.055415\t1\t1\t2\t2\t1\n150.00\t827.00\t1.00\t3.121483\t2\t1\t1\t2\t1\n105.00\t672.00\t1.00\t3.000222\t2\t1\t2\t1\t1\n50.00\t827.00\t0.00\t3.120601\t2\t1\t2\t2\t1\n80.00\t646.00\t0.00\t3.135929\t2\t1\t2\t2\t1\n140.00\t698.00\t0.00\t3.192121\t2\t1\t2\t1\t1\n75.00\t620.00\t1.00\t3.332562\t1\t1\t2\t2\t1\n165.00\t517.00\t1.00\t3.44967\t2\t1\t2\t1\t1\n160.00\t879.00\t0.00\t3.401197\t1\t1\t2\t2\t1\n110.00\t569.00\t1.00\t3.365916\t2\t1\t2\t2\t1\n170.00\t1060.00\t1.00\t3.416743\t2\t1\t2\t1\t1\n240.00\t853.00\t0.00\t3.346741\t2\t1\t1\t1\t1\n135.00\t905.00\t1.00\t2.805782\t2\t1\t2\t2\t1\n220.00\t646.00\t0.00\t3.165897\t2\t1\t1\t1\t1\n220.00\t698.00\t0.00\t3.293983\t2\t2\t2\t1\t1\n130.00\t672.00\t1.00\t3.52783\t2\t2\t1\t2\t1\n170.00\t775.00\t1.00\t3.297687\t1\t1\t2\t1\t1\n200.00\t698.00\t1.00\t3.266522\t2\t2\t2\t1\t1\n175.00\t1008.00\t1.00\t3.208421\t1\t2\t1\t2\t1\n65.00\t750.00\t1.00\t3.030134\t2\t1\t2\t1\t1\n170.00\t672.00\t0.00\t3.416414\t1\t1\t2\t2\t1\n220.00\t827.00\t1.00\t3.210844\t2\t1\t2\t1\t1\n230.00\t905.00\t1.00\t3.274121\t2\t1\t2\t1\t1\n190.00\t672.00\t1.00\t3.253857\t2\t1\t2\t2\t1\n260.00\t801.00\t1.00\t3.254629\t2\t2\t2\t1\t1\n150.00\t646.00\t1.00\t2.971952\t1\t1\t2\t2\t1\n250.00\t569.00\t0.00\t3.225255\t2\t2\t1\t1\t1\n190.00\t775.00\t1.00\t3.11795\t2\t2\t2\t2\t1\n320.00\t543.00\t1.00\t3.238678\t2\t1\t2\t1\t1\n150.00\t775.00\t1.00\t3.492256\t2\t1\t2\t2\t1\n115.00\t698.00\t1.00\t3.230014\t2\t1\t2\t1\t1\n75.00\t879.00\t0.00\t3.210037\t2\t1\t2\t2\t1\n150.00\t724.00\t0.00\t3.128513\t2\t1\t2\t1\t1\n90.00\t724.00\t1.00\t3.243764\t1\t1\t1\t2\t1\n150.00\t931.00\t0.00\t3.312366\t2\t2\t2\t1\t1\n185.00\t905.00\t0.00\t3.262318\t2\t1\t2\t2\t1\n250.00\t698.00\t1.00\t3.269189\t2\t1\t1\t1\t1\n165.00\t775.00\t1.00\t3.239854\t1\t1\t2\t2\t1\n75.00\t595.00\t0.00\t2.986692\t2\t1\t2\t1\t1\n170.00\t724.00\t1.00\t3.140698\t2\t1\t2\t1\t1\n200.00\t905.00\t1.00\t3.080073\t2\t1\t2\t2\t1\n270.00\t982.00\t0.00\t3.248823\t2\t1\t2\t1\t1\n85.00\t1034.00\t1.00\t3.331847\t2\t1\t2\t2\t1\n100.00\t750.00\t1.00\t3.416743\t2\t1\t2\t2\t1\n170.00\t853.00\t1.00\t3.247269\t2\t1\t2\t2\t1\n130.00\t724.00\t0.00\t3.329343\t2\t1\t2\t1\t1\n165.00\t750.00\t0.00\t3.125005\t1\t1\t2\t2\t1\n300.00\t750.00\t0.00\t3.278276\t2\t2\t2\t1\t1\n120.00\t879.00\t1.00\t3.429461\t1\t1\t2\t2\t1\n110.00\t827.00\t1.00\t3.319264\t1\t1\t2\t2\t1\n160.00\t724.00\t0.00\t3.322154\t2\t2\t2\t1\t1\n100.00\t646.00\t0.00\t3.192121\t2\t1\t1\t1\t1\n80.00\t698.00\t1.00\t3.354106\t1\t1\t2\t2\t1\n185.00\t827.00\t0.00\t3.285412\t2\t1\t2\t1\t1\n60.00\t620.00\t1.00\t3.441699\t2\t1\t2\t2\t1\n200.00\t827.00\t1.00\t3.145445\t2\t1\t1\t1\t1\n115.00\t827.00\t0.00\t3.488598\t1\t1\t2\t2\t1\n170.00\t672.00\t0.00\t3.162094\t2\t1\t2\t1\t1\n100.00\t801.00\t1.00\t3.454422\t1\t2\t2\t2\t1\n100.00\t750.00\t1.00\t3.392829\t2\t2\t2\t1\t1\n150.00\t595.00\t0.00\t3.061988\t1\t1\t2\t2\t1\n250.00\t724.00\t0.00\t3.268047\t2\t1\t2\t1\t1\n180.00\t853.00\t0.00\t3.054944\t1\t2\t2\t2\t1\n250.00\t439.00\t1.00\t3.334701\t2\t2\t2\t1\t1\n245.00\t905.00\t1.00\t3.215269\t2\t2\t2\t1\t1\n145.00\t698.00\t0.00\t3.180551\t2\t1\t2\t1\t1\n140.00\t698.00\t1.00\t3.578506\t2\t1\t2\t2\t1\n250.00\t414.00\t1.00\t3.310543\t2\t1\t2\t1\t1\n260.00\t801.00\t0.00\t3.086943\t2\t1\t2\t1\t1\n150.00\t905.00\t0.00\t3.196221\t2\t1\t2\t2\t1\n280.00\t620.00\t0.00\t3.264996\t2\t1\t1\t1\t1\n95.00\t750.00\t0.00\t3.331847\t1\t1\t2\t2\t1\n265.00\t775.00\t0.00\t3.219276\t2\t1\t1\t1\t1\n210.00\t620.00\t0.00\t3.222868\t2\t1\t2\t1\t1\n120.00\t931.00\t1.00\t3.331847\t2\t1\t2\t2\t1\n130.00\t879.00\t1.00\t3.564449\t2\t2\t2\t2\t1\n270.00\t672.00\t1.00\t3.403528\t2\t1\t2\t1\t1\n200.00\t491.00\t0.00\t3.063858\t2\t2\t1\t1\t1\n190.00\t801.00\t1.00\t3.40386\t1\t1\t2\t2\t1\n140.00\t775.00\t1.00\t3.389125\t2\t1\t2\t1\t1\n130.00\t724.00\t1.00\t3.283539\t2\t1\t2\t2\t1\n150.00\t1060.00\t1.00\t3.540379\t2\t1\t2\t1\t1\n105.00\t1008.00\t1.00\t3.333632\t1\t1\t2\t2\t1\n160.00\t698.00\t0.00\t3.194173\t1\t2\t2\t1\t1\n100.00\t724.00\t0.00\t3.338967\t2\t2\t1\t2\t1\n75.00\t801.00\t1.00\t3.380314\t2\t2\t2\t1\t1\n90.00\t853.00\t1.00\t3.464485\t2\t1\t1\t1\t1\n300.00\t750.00\t1.00\t3.346389\t2\t2\t2\t1\t1\n120.00\t672.00\t1.00\t2.948116\t2\t2\t2\t2\t1\n145.00\t672.00\t1.00\t3.387436\t1\t1\t2\t1\t1\n210.00\t646.00\t1.00\t2.998229\t2\t2\t1\t1\t1\n150.00\t879.00\t1.00\t3.361763\t2\t1\t1\t2\t1\n130.00\t672.00\t0.00\t3.234355\t2\t2\t1\t1\t1\n210.00\t672.00\t1.00\t3.158276\t2\t1\t1\t1\t1\n200.00\t775.00\t0.00\t3.175551\t1\t1\t2\t2\t1\n110.00\t724.00\t1.00\t3.615771\t2\t1\t2\t1\t1\n220.00\t724.00\t1.00\t2.878074\t2\t2\t2\t1\t1\n155.00\t595.00\t1.00\t3.188829\t2\t1\t2\t1\t1\n140.00\t698.00\t0.00\t3.017983\t2\t1\t2\t1\t1\n100.00\t750.00\t1.00\t3.367641\t1\t1\t2\t2\t1\n260.00\t672.00\t0.00\t3.04785\t2\t1\t1\t1\t1\n160.00\t698.00\t1.00\t3.137666\t1\t1\t1\t2\t1\n70.00\t724.00\t1.00\t3.426215\t1\t1\t2\t1\t1\n160.00\t1060.00\t1.00\t3.095578\t1\t1\t1\t2\t1\n160.00\t827.00\t1.00\t3.085573\t2\t1\t2\t1\t1\n190.00\t853.00\t1.00\t3.398193\t2\t2\t2\t1\t1\n120.00\t853.00\t1.00\t3.38845\t2\t1\t1\t2\t1\n180.00\t698.00\t1.00\t3.177637\t2\t1\t2\t1\t1\n120.00\t698.00\t1.00\t3.322515\t2\t1\t2\t2\t1\n230.00\t569.00\t1.00\t3.244544\t2\t1\t1\t1\t1\n260.00\t879.00\t1.00\t3.179303\t2\t2\t1\t1\t1\n180.00\t853.00\t0.00\t3.403195\t2\t1\t2\t2\t1\n190.00\t879.00\t1.00\t3.304686\t2\t1\t2\t2\t1\n210.00\t853.00\t1.00\t3.288029\t2\t1\t1\t1\t1\n190.00\t672.00\t0.00\t3.321432\t2\t2\t1\t1\t1\n180.00\t646.00\t1.00\t3.192532\t2\t1\t2\t2\t1\n250.00\t775.00\t1.00\t3.289521\t1\t1\t1\t1\t1\n120.00\t775.00\t0.00\t3.208825\t1\t1\t1\t2\t1\n170.00\t1034.00\t0.00\t3.196221\t2\t1\t2\t2\t1\n140.00\t801.00\t1.00\t3.480317\t2\t1\t2\t2\t1\n190.00\t1060.00\t1.00\t3.179303\t2\t1\t2\t2\t1\n180.00\t672.00\t0.00\t3.023834\t2\t1\t2\t2\t1\n110.00\t827.00\t1.00\t3.164208\t2\t1\t2\t1\t1\n110.00\t853.00\t1.00\t3.423285\t1\t2\t2\t2\t1\n270.00\t775.00\t0.00\t3.197039\t1\t2\t1\t1\t1\n340.00\t595.00\t1.00\t3.35829\t2\t2\t2\t1\t1\n40.00\t905.00\t0.00\t3.093766\t2\t1\t2\t2\t1\n185.00\t905.00\t0.00\t3.275256\t2\t1\t1\t1\t1\n230.00\t750.00\t1.00\t3.357942\t2\t2\t2\t1\t1\n105.00\t1112.00\t1.00\t3.046901\t2\t1\t2\t2\t1\n210.00\t698.00\t0.00\t3.239854\t2\t1\t2\t1\t1\n100.00\t801.00\t0.00\t3.106826\t2\t1\t2\t2\t1\n100.00\t827.00\t1.00\t3.467297\t1\t1\t2\t2\t1\n140.00\t931.00\t1.00\t3.074543\t1\t1\t2\t2\t1\n280.00\t620.00\t0.00\t3.389462\t2\t1\t1\t1\t1\n180.00\t853.00\t0.00\t3.38845\t2\t1\t2\t2\t1\n120.00\t1008.00\t0.00\t3.123246\t1\t1\t2\t2\t1\n";
+}
+}
+
+function demorat()
+{
+  with(window.document.key_search)
+  {
+
+searchkey.value="Sex\tDrug\tW1\tW2\nM\tD1\t5.00\t6.00\nM\tD1\t7.00\t6.00\nM\tD1\t9.00\t9.00\nM\tD1\t5.00\t4.00\nM\tD2\t9.00\t12.00\nM\tD2\t7.00\t7.00\nM\tD2\t7.00\t6.00\nM\tD2\t6.00\t8.00\nM\tD3\t14.00\t11.00\nM\tD3\t21.00\t15.00\nM\tD3\t12.00\t10.00\nM\tD3\t17.00\t12.00\nF\tD1\t7.00\t10.00\nF\tD1\t8.00\t10.00\nF\tD1\t6.00\t6.00\nF\tD1\t9.00\t7.00\nF\tD2\t7.00\t6.00\nF\tD2\t10.00\t13.00\nF\tD2\t6.00\t9.00\nF\tD2\t8.00\t7.00\nF\tD3\t14.00\t9.00\nF\tD3\t14.00\t8.00\nF\tD3\t16.00\t12.00\nF\tD3\t10.00\t5.00\n";
+}
+}
+
+
+function Upload()
+{
+        
+        with(window.document.key_search)
+        {
+		MyUpload.value="YES";            
+        }
+}
+
+
+function SearchCheck()
+{
+	with(window.document.key_search)
+  	{
+        	if(trim(searchkey.value)=="")
+        	{
+                	alert("Sorry,the search field is empty");
+                	return false;
+        	}
+        	else
+        	{
+			my_page.value=1;
+                        Search.value="YES";
+               		return true;
+        	}
+  	}
+}
+function pheno()
+{
+	with(window.document.pheno)
+	{
+		my_page.value=1;
+	}
+}
+function clear_key()
+{
+        with(window.document.key_search)
+        {
+         my_snpid.value="";
+         my_mirid.value="";
+         my_run.value=0;
+	 my_org.value="All";
+        submit();
+        }
+
+}
+
+function refresh()
+{
+	with(window.document.key_search)
+	{
+		if(my_org.value=="Human")
+		{
+		//	search_method[3].disabled=true;
+		//	my_phenodesc.disabled=true;
+		//	pheno_sample.disabled=true;
+		}
+  		else
+		{
+			search_method[3].disabled=false;	
+			my_phenodesc.disabled=false;
+			pheno_sample.disabled=false;
+		}
+	}
+}
+
+
+function pheno_next()
+{
+	with(window.document.key_search)
+	{
+		Search.value="YES";
+                my_run.value=2;
+		my_page.value++;
+		submit();
+	}
+}
+
+function pheno_previous()
+{
+	with(window.document.key_search)
+	{       Search.value="YES";
+		my_run.value=2;
+		my_page.value--;
+		submit();
+	}
+}
+
+function next_page()
+{
+		with(window.document.key_search)
+		{
+			Search.value="YES";
+                        my_page.value++;
+			submit();
+		}
+       
+}
+function previous_page()
+{
+        with(window.document.key_search)
+        {       
+                Search.value="YES";
+                my_page.value--;
+        	submit();
+	}
+}
+
+function wopen(url, name, param) 
+{
+ window.open(url,name, param);
+ return ;
+}
+
+function trim(inputString)
+{
+   if (typeof inputString != "string")
+        {
+                return inputString;
+        }
+   var retValue = inputString;
+   var ch = retValue.substring(0, 1);
+   while (ch == " ")
+        { // Check for spaces at the beginning of the string
+      retValue = retValue.substring(1, retValue.length);
+      ch = retValue.substring(0, 1);
+   }
+   ch = retValue.substring(retValue.length-1, retValue.length);
+   while (ch == " ")
+        { // Check for spaces at the end of the string
+      retValue = retValue.substring(0, retValue.length-1);
+      ch = retValue.substring(retValue.length-1, retValue.length);
+   }
+   while (retValue.indexOf("  ") != -1)
+        { // Note that there are two spaces in the string - look for multiple spaces within the string
+      retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two 
+spac$   }
+   return retValue; // Return the trimmed string back to the user
+} // Ends the "trim" function
+
+
+-->
+</script>
diff --git a/sourcecodes/header_new.inc b/sourcecodes/header_new.inc
new file mode 100644
index 00000000..b6db3db4
--- /dev/null
+++ b/sourcecodes/header_new.inc
@@ -0,0 +1,22 @@
+<html>
+<head>
+<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
+<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
+<META HTTP-EQUIV="Expires" CONTENT="0">
+
+  <title>Bayesian Network Webserver</title>
+  <link rel="stylesheet" href="my_new_style.css">
+
+</head>
+
+<body>
+<script type="text/javascript">
+                document.body.innerHTML = '';
+</script>
+<table align=center width="100%" bordercolor=#33339F border=1 cellspacing=0 cellpadding=0>
+<tr>
+<td width="100%" height=60 class="td_title">Bayesian Network Webserver for Biological Network Modeling</td>
+</tr>
+</table>
+
+<!-- #81BEF7 -->
diff --git a/sourcecodes/help.php b/sourcecodes/help.php
new file mode 100644
index 00000000..a6f6d336
--- /dev/null
+++ b/sourcecodes/help.php
@@ -0,0 +1,241 @@
+<?php
+
+$key=$_POST["My_key"];
+if($key=="")
+  $key="ab";//uniqid("");
+
+include("header_new.inc");
+?>
+
+<!-- Site navigation menu -->
+<ul class="navbar">
+  <li><a href="bn_file_load_gom.php">Learn a network model from data</a>
+  <li><a href="home_upload.php">Make predictions using a known structure</a>  
+  <li><a href="workflow.php">Tutorials and examples</a>
+  <li><a href="help.php">Help</a>
+  <li><a href="faq.php">FAQ</a>
+  <li><a href="home.php">Home</a>
+</ul>
+
+
+<!-- Main content -->
+<div id="outer">
+
+<table width=100% align=center>
+<tr>
+<td>
+<h2>Table of Contents</h2>
+<ol>
+<li><a href="#introduction">Introduction</a>
+<li><a href="#learn_methods">Structure learning overview</a>
+<li><a href="#constraint_interface">Structural constraint interface</a>
+<li><a href="#param_learn">Parameter learning and using models to make predictions</a>
+<li><a href="#learn_details">Details of structure learning methods</a>
+<li><a href="#file_format">Formatting files for BNW</a>
+<li><a href="#download_sl">Downloadable structure learning package</a>
+<!-- <li><a href="#updates">Recent updates and upcoming BNW features</a> -->
+
+</ol>
+</td>
+</tr>
+</table>
+
+
+<br>
+<table>
+<tr>
+<a name=learn_methods><h2>1. Introduction to BNW</h2></a>
+</tr>
+<br>
+<tr><td>
+  <p align="justify">Use of the Bayesian network webserver (BNW) can be broken up into two main parts: learning the structure of a network model and using the model to make predictions about the interactions between the variables in the model. Both of these steps are more fully described later in this help file. However, users may also want to start using BNW by following <a href="BNW_workflow_net1.htm">this tutorial</a> for network modeling of a dataset containing 8 variables which is available <a href="example_datasets/example_data_8nodes.txt">here</a>. 
+</td></tr>
+</table>
+
+
+
+<br>
+<table>
+<tr>
+<a name=learn_methods><h2>2. Overview of structure learning in BNW</h2></a>
+</tr>
+<br>
+<tr><td>
+  <p align="justify"> The first step in Bayesian network modeling of a dataset is identifying the network structure. In BNW, users can either upload a known network structure or learn the network structure that best explains the data. Structure learning from a dataset identifies which directed edges between network variables (nodes) should be included in the network to represent the conditional dependencies observed in the data. The structure learning method implemented in BNW can be used to learn the network structures of discrete, continuous, and hybrid (i.e., datasets containing both hybrid and continuous variables) datasets. After <a href="#file_format">uploading a text file</a> containing a dataset, users can either immediately perform structure learning using default settings or <a href="#constraint_interface">add or modify structural constraints</a> that can improve the performance of structure learning. By default, BNW limits the maximum number of parents for each node in the network to 4 and presents only the highest scoring network structure (i.e., no model averaging is performed). The structure learning method is more fully described <a href="#learn_details">later in this help file</a>. 
+</td></tr>
+</table>
+
+
+<br>
+<table>
+<tr>
+<a name=constraint_interface><h2>3. Structural constraint interface</h2></a>
+</tr>
+<br>
+<tr><td>
+<p align="justify">
+BNW includes a structural constraint interface that provides users with options that can increase the speed of structure learning, aid in identifying robust network structures, and limit structure searches to biologically or physically meaningful networks by incorporating prior knowledge. Examples of using the structural constraint interface are available <a href="BNW_workflow_sci.htm">here</a>.<br><br><b>Global structure learning settings</b>: The first section of the structural constraint interface allows users to set the following options that define global properties of the network structure search:<br><br>
+<u>Maximum number of parents</u>: This option sets a limit on the number of immediate parents for every node in the network and can impact structure learning in two main ways. First, limiting the maximum number of parents can dramatically increase the speed of  structure learning for larger networks. Second, this limit may also help in avoiding over-fitting a network model, as it prevents a variable from being directly influenced by a large number of the other variables in the network. By default, the maximum number of parents of a node in BNW is 4.<br><br>
+<u>Number of networks to include in model averaging</u>: This option specifies <i>k</i>, the number of the high scoring networks that will be included in <a href="#learn_details">model averaging</a>. For <i>k</i>=1, only the highest scoring network is considered and no model averaging is performed. For other values of <i>k</i>, model averaging is performed over the <i>k</i>-best networks. Increasing the value of <i>k</i> will increase the time required to perform the structure learning search but may increase the performance of model averaging.<br><br>
+<u>Model averaging selection threshold</u>: This option specifies the threshold that should be used to select directed edges to be included in the network given their posterior probabilities after model averaging. All directed edges with posterior probabilities greater than the threshold will be included in the network. It is ignored if <i>k</i>=1. By default, the threshold is set to 0.5.<br><br>
+<u>Number of tiers</u>: Users of BNW can separate the nodes in the network into tiers, which can then be used to specify structure learning constraints as discussed below. The number of tiers is set to 3 by default. If the network variables are not assigned to tiers, this option will be ignored when structure learning is performed.
+<br><br><b> Tier Assignment</b>: The next section of the structural constraint interface allows users to separate the nodes in the network into tiers that can be used to easily indicate structural constraints. A node can be placed in a tier by simple clicking and dragging the node into the appropriate box.<br><br>
+<b>Tier Interactions</b>: This section allows for the description of the interactions that are allowed within and between tiers. By default, edges are allowed within tiers for all tiers, and nodes within a tier are only allowed to be parents of nodes within lower ranking tiers. For example, nodes in Tier2 of a network with 4 tiers could be the parents of nodes in Tiers 3 and 4, but could not be the parents of nodes in Tier1. Users can modify the allowed interactions to fit the details of their networks. For example, they may want to prohibit interactions within a tier containing variables that do not causally depend on each other.<br><br>
+<b>Specific Banned and Required Edges</b>: Finally, users can enter lists of banned and required edges to identify specific interactions that should or should not be included in the network. Banned edges can be used if experimental testing has shown that a particular regulatory relationship does not exist, while required edges can specify known regulatory relationships.
+</p>
+<br>
+</td></tr>
+</table>
+
+
+<br>
+<table>
+<tr>
+<a name=param_learn><h2>4. Parameter learning and using models to make predictions</h2></a>
+</tr>
+<br>
+<tr><td>
+  <p align="justify"> After structure learning is completed, BNW automatically performs parameter learning of the network model using the Kevin Murphy's <a href=http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.25.1216>Bayes Net Toolbox</a> (<a href=https://github.com/bayesnet/bnt>BNT</a>) and displays the network model. Discrete variables in the network are displayed as bar charts and continuous variables are displayed as Gaussian distributions. The networks can be used to make predictions after clicking on a node and entering a value for that variable. Specifically, click on either the blue bar for a discrete node or the blue line for a continuous node to bring up a pop-up box that can be used to enter a value for the node. After submitting a value for the variable, the distributions of the other nodes in the network will change, allowing for visualization of the impact of setting the variable to the given value. The distributions after the entered value is considered are shown in red, while the original distributions are shown in blue. The node for which data was entered is outlined in red.<br><br>
+Two prediction modes are available in BNW: evidence and intervention. In the evidence mode, entered values will alter the distributions of the other variables in the network, but will not alter the network structure. In intervention mode, the intervention alters both the distributions of the network variables and the network structure. Specifically, the intervened variable becomes independent of its parents. Evidence mode is appropriate when making predictions of other network variables after the value of one variable in the network is observed, while intervention mode is appropriate for predictions after experimental interventions that alter the values of some variables in the network. Further discussion of the difference between evidence and intervention prediction modes is given on the BNW <a href="faq.php">FAQ</a> page.       
+</td></tr>
+</table>
+
+
+<br>
+<table>
+<tr>
+<a name=learn_details><h2>5. Details of structure learning methods</h2></a>
+</tr>
+<br>
+<tr><td>
+  <p align="justify"> The structure learning method used in BNW can be broken down into three main steps: calculating local network scores, determing global structures that optimize network scores, and, if indicated by user settings, performing model averaging over high scoring structures.<br><br>
+<u>Local score calculation</u>: The score of a local structure of a Bayesian network considers how well a node is explained by the nodes that are its immediate parents. To begin structure learning in BNW, we calculate all possible local scores by perform an exhaustive search of local structures given the structural constraints specified by the user. In order to allow structure learning of hybrid datasets, BNW calculates local scores using the scoring metric proposed by <a href=http://www.jstatsoft.org/v08/i20/paper>Bottcher and Dethlefsen</a> that they have previously incorporated in the R package <a href=http://cran.r-project.org/web/packages/deal/index.html><i>deal</i></a>. Briefly, to allow for the use hybrid datasets containing both discrete and continuous variables, local structures are scored based on conditional probability tables for entirely discrete local strucutes, Gaussian distributions for entirely continuous local structures, and conditional Gaussian distributions for hybrid local structures. One property of this scoring metric is that it does not allow discrete nodes to be the children of continuous nodes. To improve the speed of structure learning, we do not use <i>deal</i>, but, instead, calculate local scores using code that we have written in the C programming language.<br><br>
+<u>Search for the <i>k</i>-best global optimal structures</u>: After calculating local scores, BNW performs a search for the <i>k</i>-best global optimal structures, using a user-specified value of <i>k</i>. The <i>k</i>-best structure search method used in BNW was developed by <a href=http://arxiv.org/abs/1203.3520>Tian and Re</a>. It is an adaptation of an algorithm for identifying the optimal network structure developed by <a href=http://arxiv.org/ftp/arxiv/papers/1206/1206.6875.pdf>Silander and Myllymaki</a> that is available <a href=http://b-course.cs.helsinki.fi/obc/bene/>here</a>.<br><br>
+<u>Model averaging</u>: Model averaging can be used to reduce the risk of over-fitting data to a single model. In BNW, model averaging is automatically performed over the <i>k</i>-best scoring structures, when users select values of <i>k</i> > 1. To select features (i.e., directed edges between nodes), the posterior probability of each feature is calculated by a weighted average over the <i>k</i>-best networks where the weight is given by the score of the global network structure. This posterior probability, which ranges for 1 for features included in all high scoring networks to 0 for features in no high scoring networks, reflects confidence in the feature.<br><br>Model averaging may be particularly advantageous when learning network models using small datasets. As the number of samples in a dataset increases, the differences between the scores of the highest scoring networks often also increase. Therefore, instead of a single network structure having the best score, structure learning of small datasets may identify a group of structures with similar scores. Model averaging can be used to select features that are common to many of these high scoring networks.
+</td></tr>
+</table>
+
+
+
+
+<br>
+<table>
+<tr>
+<a name=file_format><h2>6. Data formatting guidelines</h2></a>
+</tr>
+<br>
+<tr>
+<h3>Data file format</h3>
+</tr>
+<tr><td>
+  <p align="justify"> Data files uploaded to the Bayesian Network Webserver should be tab-delimited text files with the names of the variables in the first row of the file and the values of the variables for each sample or individual in the remaining rows. <br><br>BNW automatically determines whether variables contain continuous or discrete data. To help ensure that BNW correctly parses data files, users should follow these formatting guidelines:<br>
+  1. Variable names should start with a letter, not a number, and should not contain any whitespace characters.<br>
+  2. Discrete variables should be listed before continuous variables, that is, discrete variables should be the leftmost columns of the file.<br>
+3. The values of the levels of discrete variables should be integers starting with 1.<br>
+  4. The data values for each continuous variables should include a period (.) followed by a number in at least one of the samples.<br><br>
+    An example input data file for a file with 5 variables is given below. The network contains 2 discrete (Disc1 and Disc2) variables, which are given in the first two columns of the file, and 3 continuous variables (Cont1, Cont2, and Cont3). Disc1 is a discrete variable with two states (1 and 2), while Disc2 has three states (1, 2, and 3). Although the samples of Cont2 are integral values, we wish to deal with this variable as continuous, not discrete. Therefore, the value of Cont2 for the first sample is given as '3.0' instead of '3' so that one of the values of Cont2 contains a '.' followed by a number and Cont2 is interpreted as a continuous variable.
+</p>
+<br>
+<table>
+<tr><th>Disc1</th><th>&nbsp;</th><th>Disc2</th><th>&nbsp;</th><th>Cont1</th><th>&nbsp;</th><th>Cont2</th><th>&nbsp;</th><th>Cont3</td></tr>
+<tr>
+<td>2</td><td>&nbsp;</td><td>1</td><td>&nbsp;</td><td>3.25</td><td>&nbsp;</td><td>3.0</td><td>&nbsp;</td><td>0.97</td>
+</tr>
+<tr>
+<td>2</td><td>&nbsp;</td><td>3</td><td>&nbsp;</td><td>2.46</td><td>&nbsp;</td><td>2</td><td>&nbsp;</td><td>0.93</td>
+</tr>
+<tr>
+<td>1</td><td>&nbsp;</td><td>2</td><td>&nbsp;</td><td>4.21</td><td>&nbsp;</td><td>33</td><td>&nbsp;</td><td>0.43</td>
+</tr>
+<tr>
+<td>2</td><td>&nbsp;</td><td>3</td><td>&nbsp;</td><td>3.76</td><td>&nbsp;</td><td>8</td><td>&nbsp;</td><td>0.88</td>
+</tr>
+<tr>
+<td>2</td><td>&nbsp;</td><td>1</td><td>&nbsp;</td><td>3.69</td><td>&nbsp;</td><td>4</td><td>&nbsp;</td><td>0.91</td>
+</tr>
+<tr>
+<td>1</td><td>&nbsp;</td><td>1</td><td>&nbsp;</td><td>4.27</td><td>&nbsp;</td><td>13</td><td>&nbsp;</td><td>0.38</td>
+</tr>
+</table>
+<br>
+<br>
+<h3>Structure file format</h3>
+<p align="justify">
+  If the structure of the network model for a dataset is already known, users can upload this structure by selecting "Upload structure" on the BNW home page. The structure file should be tab-delimited, with the variable names on the first row. The remainder of the file should be an n x n matrix of 0's and 1's, where n is the number of variables in the network. A '1' in row i and column j in this matrix indicates that there is a directed edge connecting variables i and j, (i.e., there is a edge from i to j in the network). '0' indicate that there is not a directed edge from variable i to variable j.
+<br><br> An example of a structure data file is shown below. The following edges would be included in the network:
+<br>1. Disc1 -> Cont1
+<br>2. Dics2 -> Cont2
+<br>3. Cont1 -> Cont3
+<br>4. Cont2 -> Cont3 
+</p>
+<br>
+<table>
+<tr><th>Disc1</th><th>&nbsp;</th><th>Disc2</th><th>&nbsp;</th><th>Cont1</th><th>&nbsp;</th><th>Cont2</th><th>&nbsp;</th><th>Cont3</td></tr>
+<tr><td>0</td><td>&nbsp;</td><td>0</td><td>&nbsp;</td><td>1</td><td>&nbsp;</td><td>0</td><td>&nbsp;</td><td>0</td></tr>
+<tr><td>0</td><td>&nbsp;</td><td>0</td><td>&nbsp;</td><td>0</td><td>&nbsp;</td><td>1</td><td>&nbsp;</td><td>0</td></tr>
+<tr><td>0</td><td>&nbsp;</td><td>0</td><td>&nbsp;</td><td>0</td><td>&nbsp;</td><td>0</td><td>&nbsp;</td><td>1</td></tr>
+<tr><td>0</td><td>&nbsp;</td><td>0</td><td>&nbsp;</td><td>0</td><td>&nbsp;</td><td>0</td><td>&nbsp;</td><td>1</td></tr>
+<tr><td>0</td><td>&nbsp;</td><td>0</td><td>&nbsp;</td><td>0</td><td>&nbsp;</td><td>0</td><td>&nbsp;</td><td>0</td></tr>
+</table>
+<br>
+</table>
+
+
+
+
+<br>
+<table>
+<tr>
+<a name=download_sl><h2>7. Downloadable structure learning package</h2></a>
+</tr>
+<br>
+<tr><td>
+<p align="justify"> To learn the structure of large networks or for large values of <i>k</i> when identifying the <i>k</i>-highest scoring networks for model averaging, users may want to download a package containing the BNW structure learning method, which is available <a href="../downloads/BNW_src_files.tar">here</a>. The model_averaging.txt output file provided by the package can be loaded into BNW by selecting "Make predictions using a known structure" on the left menu on the BNW homepage or <a href="home_upload.php">here</a> and used to make predictions. The input of the data file required by the downloadable package has one change from the BNW input file format; namely, the downloadable package requires that user specify the variable type on the second line of input file. Enter the number of unique states on this line for discrete variables and enter '1' on this line to indicate a continuous variable. The downloadable package is written in C and is intended for use on computers with a Linux operating system and the gcc compiler.<br>
+</table>
+
+
+<br>
+<br>
+<br>
+
+<table align="center" width="100%">
+<tr>
+<a name="contact"><h2>Contact us</h2></a>
+</tr>
+<tr>
+<td>
+Please send questions and comments to <a href=mailto:ycui2@uthsc.edu>Dr. Yan Cui</a> at University of Tennesee Health 
+Science Center.
+</td>
+</tr>
+</table>
+
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+</div>
+</html>
diff --git a/sourcecodes/home.php b/sourcecodes/home.php
new file mode 100644
index 00000000..571124c8
--- /dev/null
+++ b/sourcecodes/home.php
@@ -0,0 +1,179 @@
+<?php 
+
+include("header_new.inc");
+?>
+
+<!-- Site navigation menu -->
+<ul class="navbar">
+  <li><a href="bn_file_load_gom.php">Learn a network model from data</a>
+  <li><a href="home_upload.php">Make predictions using a known structure</a>  
+  <li><a href="getting_started.php">Getting started with BNW</a>
+  <li><a href="help.php">Help</a>
+  <li><a href="workflow.php">Tutorials and examples</a>
+  <li><a href="faq.php">FAQ</a>
+  <li><a href="../downloads/BNW_src_files.tar">Download</a>
+  <li><a href="home.php">Home</a>
+
+
+</ul>
+
+
+<!-- Main content -->
+<div id="outer">
+<h1>BNW: from data to predictions</h1>
+<IMG SRC="BNW_overview.png" ATL="" BORDER=0 WIDTH=812 HEIGHT=290><BR>
+<br>
+<br>
+    <p align="justify"> The Bayesian Network Web Server (BNW) is a comprehensive web server for Bayesian network modeling of biological data sets. It is designed so that users can quickly and seamlessly upload a dataset, learn the structure of the network model that best explains the data, and use the model to understand and make predictions about relationships between the variables in the model. Many real world data sets, including those used to create genetic network models, contain both discrete (e.g., genotypes) and  continuous (e.g., gene expression traits) variables, and BNW allows for modeling of these hybrid data sets.
+<br><br>
+<b>*A note about browser usage:</b> The BNW interface for adding structural constraints uses HTML5 features that are may not be supported by Internet Explorer. We have not observed any problems with the interface using recent versions of any other web browser, and, therefore, we suggest against using Internet Explorer when accessing BNW. 
+<br>
+<br>
+<b>
+How to cite the BNW:
+</b>
+<br>
+1. Ziebarth JD, Bhattacharya A, Cui Y (2013) <a href="http://bioinformatics.oxfordjournals.org/content/29/21/2801.abstract"  target="_blank">Bayesian Network Webserver: a comprehensive tool for biological network modeling.</a> Bioinformatics. 29(21): 2801-2803.
+<br>
+<br>
+<b>Developed and maintained by: </b><a href="http://compbio.uthsc.edu/" target="_blank">Yan Cui's Lab at University of Tennessee Health Science Center</a>
+<br>
+</p>
+<br>
+<br>
+<br>
+</div>
+</body>
+</html>
+
+<script>
+var BrowserDetect = {
+	init: function () {
+		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
+		this.version = this.searchVersion(navigator.userAgent)
+			|| this.searchVersion(navigator.appVersion)
+			|| "an unknown version";
+		this.OS = this.searchString(this.dataOS) || "an unknown OS";
+	},
+	searchString: function (data) {
+		for (var i=0;i<data.length;i++)	{
+			var dataString = data[i].string;
+			var dataProp = data[i].prop;
+			this.versionSearchString = data[i].versionSearch || data[i].identity;
+			if (dataString) {
+				if (dataString.indexOf(data[i].subString) != -1)
+					return data[i].identity;
+			}
+			else if (dataProp)
+				return data[i].identity;
+		}
+	},
+	searchVersion: function (dataString) {
+		var index = dataString.indexOf(this.versionSearchString);
+		if (index == -1) return;
+		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
+	},
+	dataBrowser: [
+		{
+			string: navigator.userAgent,
+			subString: "Chrome",
+			identity: "Chrome"
+		},
+		{ 	string: navigator.userAgent,
+			subString: "OmniWeb",
+			versionSearch: "OmniWeb/",
+			identity: "OmniWeb"
+		},
+		{
+			string: navigator.vendor,
+			subString: "Apple",
+			identity: "Safari",
+			versionSearch: "Version"
+		},
+		{
+			prop: window.opera,
+			identity: "Opera",
+			versionSearch: "Version"
+		},
+		{
+			string: navigator.vendor,
+			subString: "iCab",
+			identity: "iCab"
+		},
+		{
+			string: navigator.vendor,
+			subString: "KDE",
+			identity: "Konqueror"
+		},
+		{
+			string: navigator.userAgent,
+			subString: "Firefox",
+			identity: "Firefox"
+		},
+		{
+			string: navigator.vendor,
+			subString: "Camino",
+			identity: "Camino"
+		},
+		{		// for newer Netscapes (6+)
+			string: navigator.userAgent,
+			subString: "Netscape",
+			identity: "Netscape"
+		},
+		{
+			string: navigator.userAgent,
+			subString: "MSIE",
+			identity: "Explorer",
+			versionSearch: "MSIE"
+		},
+		{
+			string: navigator.userAgent,
+			subString: "Gecko",
+			identity: "Mozilla",
+			versionSearch: "rv"
+		},
+		{ 		// for older Netscapes (4-)
+			string: navigator.userAgent,
+			subString: "Mozilla",
+			identity: "Netscape",
+			versionSearch: "Mozilla"
+		}
+	],
+	dataOS : [
+		{
+			string: navigator.platform,
+			subString: "Win",
+			identity: "Windows"
+		},
+		{
+			string: navigator.platform,
+			subString: "Mac",
+			identity: "Mac"
+		},
+		{
+			   string: navigator.userAgent,
+			   subString: "iPhone",
+			   identity: "iPhone/iPod/iPad"
+	    },
+		{
+			string: navigator.platform,
+			subString: "Linux",
+			identity: "Linux"
+		}
+	]
+
+};
+BrowserDetect.init();
+if (BrowserDetect.browser=="Explorer")
+ {
+        alert("Some features of BNW, particularly the structural constraint interface, are not supported by Internet Explorer. We suggest using other browser, such as Firefox or Chorome, when accessing BNW");
+ 
+ }
+if (BrowserDetect.dataOS=="iPhone")
+ {
+        alert("Some features of BNW are not supported by mini devices. We suggest using computer, when accessing BNW");
+ 
+ }
+
+</script>
+
diff --git a/sourcecodes/home_upload.php b/sourcecodes/home_upload.php
new file mode 100644
index 00000000..09af0910
--- /dev/null
+++ b/sourcecodes/home_upload.php
@@ -0,0 +1,34 @@
+<?php 
+
+include("header_new.inc");
+?>
+
+<!-- Site navigation menu -->
+<ul class="navbar2">
+<li><a href="upload_structure_file.php">Upload data and structure files</a>
+</ul>
+<ul class="navbar">
+  <li><a href="help.php#file_format" target="_blank">Data formatting guidelines</a>
+  <li><a href="help.php" target="_blank">Help</a>
+  <li><a href="home.php">Home</a>
+</ul>
+
+<div id="outer">
+<!-- Main content -->
+<br>
+<br>
+<h1>Investigate networks with a known structure</h1>
+<br>
+<p align="justify"> 
+  BNW can be used to study and make predictions for models with a known structure. To use this feature, click the "Upload data and structure files" button below to upload the file containing the data for each of the variables in the network. Then, upload a file containing the network structure. Guidelines for formatting the data and structure data files can be found <a href="help.php#file_format">here</a>.
+<br>
+<br>
+<FORM METHOD="LINK" ACTION="upload_structure_file.php">
+<INPUT TYPE="submit" VALUE="Upload data and structure files" style="color: #fff; padding: 2px 5px; border: 2px solid; border-color: black black black black; background-color: #33339f; font-family: Georgia, ..., serif; font-size: 18px;
+display: block; height: 30px; width: 300px;">
+</FORM>
+</p>
+<br>
+</div>
+</body>
+</html>
\ No newline at end of file
diff --git a/sourcecodes/index.html b/sourcecodes/index.html
new file mode 100644
index 00000000..b0e33f6e
--- /dev/null
+++ b/sourcecodes/index.html
@@ -0,0 +1,6 @@
+<html>
+<head>
+<title>Bayesian Network Web Server</title>
+<meta HTTP-EQUIV="REFRESH" content="0; url=home.php">
+</head>
+</html>
diff --git a/sourcecodes/js-graph-it.css b/sourcecodes/js-graph-it.css
new file mode 100644
index 00000000..46757760
--- /dev/null
+++ b/sourcecodes/js-graph-it.css
@@ -0,0 +1,24 @@
+.draggable
+{
+	position: absolute;
+	cursor: move;
+	z-index: 1;
+}
+
+.connector
+{
+	background-color: black;
+}
+
+.dock_point
+{
+	height: 1px;
+	width: 1px;
+	overflow: hidden;
+	padding: 0px !important;
+	border: none !important;
+	margin: 0px !important;
+	position: absolute;
+	font-size: 1px;
+	visibility: hidden;
+}
\ No newline at end of file
diff --git a/sourcecodes/js-graph-it.js b/sourcecodes/js-graph-it.js
new file mode 100644
index 00000000..8d9387b4
--- /dev/null
+++ b/sourcecodes/js-graph-it.js
@@ -0,0 +1,1802 @@
+/*********************
+ * browser detection *
+ *********************/
+
+var ie=document.all;
+var nn6=document.getElementById&&!document.all;
+
+/****************************************************
+ * This class is a scanner for the visitor pattern. *
+ ****************************************************/
+ 
+/**
+ * Constructor, parameters are:
+ * visitor: the visitor implementation, it must be a class with a visit(element) method.
+ * scanElementsOnly: a flag telling whether to scan html elements only or all html nodes.
+ */
+function DocumentScanner(visitor, scanElementsOnly)
+{
+	this.visitor = visitor;
+	this.scanElementsOnly = scanElementsOnly;
+
+	/**
+	 * Scans the element
+	 */
+	this.scan = function(element)
+	{
+		var i;
+		if(this.visitor.visit(element))
+		{
+			// visit child elements
+			var children = element.childNodes;
+			for(i = 0; i < children.length; i++)
+			{
+				if(!this.scanElementsOnly || children[i].nodeType == 1)
+				{
+					this.scan(children[i]);
+				}
+			}
+		}		
+	}	
+}
+
+/*****************
+ * drag and drop *
+ *****************/
+ 
+var isdrag=false;					// this flag indicates that the mouse movement is actually a drag.
+var mouseStartX, mouseStartY;		// mouse position when drag starts
+var elementStartX, elementStartY;	// element position when drag starts
+
+/**
+ * the html element being dragged.
+ */
+var elementToMove;
+
+/**
+ * an array containing the blocks being dragged. This is used to notify them of move.
+ */
+var blocksToMove;
+
+/**
+ * this variable stores the orginal z-index of the object being dragged in order
+ * to restore it upon drop.
+ */ 
+var originalZIndex;
+
+/**
+ * an array containing bounds to be respected while dragging elements,
+ * these bounds are left, top, left + width, top + height of the parent element.
+ */
+var bounds = new Array(4);
+
+/**
+ * this visitor is used to find blocks nested in the element being moved.
+ */
+function BlocksToMoveVisitor()
+{
+	this.visit = function(element)
+	{
+		if(isBlock(element))
+		{
+			blocksToMove.push(findBlock(element.id));
+			return false;
+		}
+		else
+			return true;
+	}
+}
+
+var blocksToMoveScanner = new DocumentScanner(new BlocksToMoveVisitor(), true);
+
+function movemouse(e)
+{
+	if (isdrag)
+	{
+		var currentMouseX = nn6 ? e.clientX : event.clientX;
+		var currentMouseY = nn6 ? e.clientY : event.clientY;
+		var newElementX = elementStartX + currentMouseX - mouseStartX;
+		var newElementY = elementStartY + currentMouseY - mouseStartY;
+
+		// check bounds
+		// note: the "-1" and "+1" is to avoid borders overlap
+		if(newElementX < bounds[0])
+			newElementX = bounds[0] + 1;
+		if(newElementX + elementToMove.offsetWidth > bounds[2])
+			newElementX = bounds[2] - elementToMove.offsetWidth - 1;
+		if(newElementY < bounds[1])
+			newElementY = bounds[1] + 1;
+		if(newElementY + elementToMove.offsetHeight > bounds[3])
+			newElementY = bounds[3] - elementToMove.offsetHeight - 1;
+		
+		// move element
+		elementToMove.style.left = newElementX + 'px';
+		elementToMove.style.top  = newElementY + 'px';
+
+//		elementToMove.style.left = newElementX / elementToMove.parentNode.offsetWidth * 100 + '%';
+//		elementToMove.style.top  = newElementY / elementToMove.parentNode.offsetHeight * 100 + '%';
+	
+		elementToMove.style.right = null;
+		elementToMove.style.bottom = null;
+		
+		var i;
+		for(i = 0; i < blocksToMove.length; i++)
+		{
+			blocksToMove[i].onMove();
+		}
+		return false;
+	}
+}
+
+/**
+ * finds the innermost draggable element starting from the one that generated the event "e"
+ * (i.e.: the html element under mouse pointer), then setup the document's onmousemove function to
+ * move the element around.
+ */
+function startDrag(e) 
+{	
+	var eventSource = nn6 ? e.target : event.srcElement;
+	if(eventSource.tagName == 'HTML')
+		return;
+
+	while (eventSource != document.body && !hasClass(eventSource, "draggable"))
+	{  	
+		eventSource = nn6 ? eventSource.parentNode : eventSource.parentElement;
+	}
+
+	// if a draggable element was found, calculate its actual position
+	if (hasClass(eventSource, "draggable"))
+	{
+		isdrag = true;
+		elementToMove = eventSource;
+
+		// set absolute positioning on the element		
+		elementToMove.style.position = "absolute";
+				
+		// calculate start point
+		elementStartX = elementToMove.offsetLeft;
+		elementStartY = elementToMove.offsetTop;
+		
+		// calculate mouse start point
+		mouseStartX = nn6 ? e.clientX : event.clientX;
+		mouseStartY = nn6 ? e.clientY : event.clientY;
+		
+		// calculate bounds as left, top, width, height of the parent element
+		if(getStyle(elementToMove.parentNode, "position") == 'absolute')
+		{
+			bounds[0] = 0;
+			bounds[1] = 0;
+		}
+		else
+		{
+			bounds[0] = calculateOffsetLeft(elementToMove.parentNode);
+			bounds[1] = calculateOffsetTop(elementToMove.parentNode);
+		}
+		bounds[2] = bounds[0] + elementToMove.parentNode.offsetWidth;
+		bounds[3] = bounds[1] + elementToMove.parentNode.offsetHeight;		
+		
+		// either find the block related to the dragging element to call its onMove method
+		blocksToMove = new Array();
+		
+		blocksToMoveScanner.scan(eventSource);
+		document.onmousemove = movemouse;
+		
+		originalZIndex = getStyle(elementToMove, "z-index");
+		elementToMove.style.zIndex = "3";
+		
+		return false;
+	}
+}
+
+function stopDrag(e)
+{
+	isdrag=false; 
+	if(elementToMove)
+		elementToMove.style.zIndex=originalZIndex;
+	elementToMove = null;
+	document.onmousemove = null;
+       
+}
+
+document.onmousedown = startDrag;
+document.onmouseup = stopDrag;
+
+
+
+/*************
+ * Constants *
+ *************/
+var LEFT = 1;
+var RIGHT = 2;
+var UP = 4;
+var DOWN = 8;
+var HORIZONTAL = LEFT + RIGHT;
+var VERTICAL = UP + DOWN;
+var AUTO = HORIZONTAL + VERTICAL;
+
+var START = 0;
+var END = 1;
+var SCROLLBARS_WIDTH = 18;
+
+/**************
+ * Inspectors *
+ **************/
+
+var inspectors = new Array();
+
+/**
+ * The canvas class.
+ * This class is built on a div html element.
+ */
+function Canvas(htmlElement)
+{
+	/*
+	 * initialization
+	 */
+	this.id = htmlElement.id;
+	this.htmlElement = htmlElement;
+	this.blocks = new Array();
+	this.connectors = new Array();
+	this.offsetLeft = calculateOffsetLeft(this.htmlElement);
+	this.offsetTop = calculateOffsetTop(this.htmlElement);	
+	
+	this.width;
+	this.height;
+
+	// create the inner div element
+	this.innerDiv = document.createElement("div");
+	
+	this.initCanvas = function()
+	{
+		// setup the inner div
+		var children = this.htmlElement.childNodes;
+		var i;
+		var el;
+		var n = children.length;
+		for(i = 0; i < n; i++)
+		{
+			el = children[0];
+			this.htmlElement.removeChild(el);
+			this.innerDiv.appendChild(el);
+			if(el.style)
+				el.style.zIndex = "2";
+		}
+		this.htmlElement.appendChild(this.innerDiv);
+
+		this.htmlElement.style.overflow = "auto";
+		this.htmlElement.style.position = "relative";
+		this.innerDiv.id = this.id + "_innerDiv";
+		this.innerDiv.style.border = "none";
+		this.innerDiv.style.padding = "0px";
+		this.innerDiv.style.margin = "0px";
+		this.innerDiv.style.position = "absolute";
+		this.innerDiv.style.top = "0px";
+		this.innerDiv.style.left = "0px";
+		this.width = 0;
+		this.height = 0;
+		this.offsetLeft = calculateOffsetLeft(this.innerDiv);
+		this.offsetTop = calculateOffsetTop(this.innerDiv);
+
+		// inspect canvas children to identify first level blocks
+		new DocumentScanner(this, true).scan(this.htmlElement);
+		
+		// now this.width and this.height are populated with minimum values needed for the inner
+		// blocks to fit, add 2 to avoid border overlap;
+		this.height += 2;
+		this.width += 2;
+		
+		var visibleWidth = this.htmlElement.offsetWidth - 2; // - 2 is to avoid border overlap
+		var visibleHeight = this.htmlElement.offsetHeight - 2; // - 2 is to avoid border overlap
+		
+		// consider the scrollbars width calculating the inner div size
+		if(this.height > visibleHeight)
+			visibleWidth -= SCROLLBARS_WIDTH;
+		if(this.width > visibleWidth)
+			visibleHeight -= SCROLLBARS_WIDTH;
+			
+		this.height = Math.max(this.height, visibleHeight);
+		this.width = Math.max(this.width, visibleWidth);
+		
+		this.innerDiv.style.width = this.width + "px";
+		this.innerDiv.style.height = this.height + "px";
+		
+		// init connectors
+		for(i = 0; i < this.connectors.length; i++)
+		{
+			this.connectors[i].initConnector();
+		}
+	}
+	
+	this.visit = function(element)
+	{
+		if(element == this.htmlElement)
+			return true;
+	
+		// check the element dimensions against the acutal size of the canvas
+		this.width = Math.max(this.width, calculateOffsetLeft(element) - this.offsetLeft + element.offsetWidth);
+		this.height = Math.max(this.height, calculateOffsetTop(element) - this.offsetTop + element.offsetHeight);
+		
+		if(isBlock(element))
+		{
+			// block found initialize it
+			var newBlock = new Block(element, this);
+			newBlock.initBlock();
+			this.blocks.push(newBlock);
+			return false;
+		}
+		else if(isConnector(element))
+		{
+			// connector found, just create it, source or destination blocks may not 
+			// have been initialized yet
+			var newConnector = new Connector(element, this);
+			this.connectors.push(newConnector);
+			return false;
+		}
+		else
+		{
+			// continue searching nested elements
+			return true;
+		}
+	}
+	
+	/*
+	 * methods
+	 */	
+	this.print = function()
+	{
+		var output = '<ul><legend>canvas: ' + this.id + '</legend>';
+		var i;
+		for(i = 0; i < this.blocks.length; i++)
+		{
+			output += '<li>';
+			output += this.blocks[i].print();
+			output += '</li>';
+		}
+		output += '</ul>';
+		return output;
+	}
+	
+	/*
+	 * This function searches for a nested block with a given id
+	 */
+	this.findBlock = function(blockId)
+	{
+		var result;
+		var i;
+		for(i = 0; i < this.blocks.length && !result; i++)
+		{
+			result = this.blocks[i].findBlock(blockId);
+		}
+		
+		return result;
+	}
+	
+	this.toString = function()
+	{
+		return 'canvas: ' + this.id;		
+	}
+}
+
+/*
+ * Block class
+ */
+function Block(htmlElement, canvas)
+{	
+	/*
+	 * initialization
+	 */
+	 
+	this.canvas = canvas;
+	this.htmlElement = htmlElement;
+	this.id = htmlElement.id;
+	this.blocks = new Array();
+	this.moveListeners = new Array();
+	
+	if(this.id == 'description2_out1')
+		var merda = 0;
+	this.currentTop = calculateOffsetTop(this.htmlElement) - this.canvas.offsetTop;
+	this.currentLeft = calculateOffsetLeft(this.htmlElement) - this.canvas.offsetLeft;
+	
+	this.visit = function(element)
+	{
+		if(element == this.htmlElement)
+		{
+			// exclude itself
+			return true;
+		}
+
+		if(isBlock(element))
+		{
+			var innerBlock = new Block(element, this.canvas);
+			innerBlock.initBlock();
+			this.blocks.push(innerBlock);
+			this.moveListeners.push(innerBlock);
+			return false;
+		}
+		else
+			return true;
+	}
+	
+	this.initBlock = function()
+	{
+		// inspect block children to identify nested blocks
+		
+		new DocumentScanner(this, true).scan(this.htmlElement);
+	}
+	
+	this.top = function()
+	{
+		return this.currentTop;
+	}
+	
+	this.left = function()
+	{
+		return this.currentLeft;
+	}
+	
+	this.width = function()
+	{
+		return this.htmlElement.offsetWidth;		
+	}
+	
+	this.height = function()
+	{
+		return this.htmlElement.offsetHeight;
+	}
+	
+	/*
+	 * methods
+	 */	
+	this.print = function()
+	{
+		var output = 'block: ' + this.id;
+		if(this.blocks.length > 0)
+		{
+			output += '<ul>';
+			var i;
+			for(i = 0; i < this.blocks.length; i++)
+			{
+				output += '<li>';
+				output += this.blocks[i].print();
+				output += '</li>';
+			}
+			output += '</ul>';
+		}
+		return output;
+	}
+	
+	/*
+	 * This function searches for a nested block (or the block itself) with a given id
+	 */
+	this.findBlock = function(blockId)
+	{
+		if(this.id == blockId)
+			return this;
+			
+		var result;
+		var i;
+		for(i = 0; i < this.blocks.length && !result; i++)
+		{
+			result = this.blocks[i].findBlock(blockId);
+		}
+		
+		return result;
+	}
+	
+	this.move = function(left, top)
+	{
+		this.htmlElement.style.left = left;
+		this.htmlElement.style.top = top;
+		
+		this.onMove();
+	}
+		
+	this.onMove = function()
+	{
+		var i;
+		this.currentLeft = calculateOffsetLeft(this.htmlElement) - this.canvas.offsetLeft;
+		this.currentTop = calculateOffsetTop(this.htmlElement) - this.canvas.offsetTop;
+		// notify listeners
+		for(i = 0; i < this.moveListeners.length; i++)
+		{
+			this.moveListeners[i].onMove();
+		}
+	}
+	
+	this.toString = function()
+	{
+		return 'block: ' + this.id;
+	}
+}
+
+/**
+ * This class represents a connector segment, it is drawn via a div element.
+ * A segment has a starting point defined by the properties startX and startY, a length,
+ * a thickness and an orientation.
+ * Allowed values for the orientation property are defined by the constants UP, LEFT, DOWN and RIGHT.
+ */
+function Segment(id, parentElement)
+{
+	this.id = id;
+	this.htmlElement = document.createElement('div');
+	this.htmlElement.id = id;
+	this.htmlElement.style.position = 'absolute';
+	this.htmlElement.style.overflow = 'hidden';
+	parentElement.appendChild(this.htmlElement);
+
+	this.startX;
+	this.startY;
+	this.length;
+	this.thickness;
+	this.orientation;
+	this.nextSegment;
+	this.visible = true;
+	
+	/**
+	 * draw the segment. This operation is cascaded to next segment if any.
+	 */
+	this.draw = function()
+	{
+		// set properties to next segment
+		if(this.nextSegment)
+		{
+			this.nextSegment.startX = this.getEndX();
+			this.nextSegment.startY = this.getEndY();			
+		}
+		
+		if(this.visible)
+			this.htmlElement.style.display = 'block';
+		else
+			this.htmlElement.style.display = 'none';
+	
+		switch(this.orientation)
+		{
+			case LEFT:
+				this.htmlElement.style.left = (this.startX - this.length) + "px";				
+				this.htmlElement.style.top = this.startY + "px";
+				this.htmlElement.style.width = this.length + "px";
+				this.htmlElement.style.height = this.thickness + "px";
+				break;
+			case RIGHT:
+				this.htmlElement.style.left = this.startX + "px";
+				this.htmlElement.style.top = this.startY + "px";
+				if(this.nextSegment)
+					this.htmlElement.style.width = this.length + this.thickness + "px";
+				else
+					this.htmlElement.style.width = this.length + "px";
+				this.htmlElement.style.height = this.thickness + "px";
+				break;
+			case UP:
+				this.htmlElement.style.left = this.startX + "px";
+				this.htmlElement.style.top = (this.startY - this.length) + "px";
+				this.htmlElement.style.width = this.thickness + "px";
+				this.htmlElement.style.height = this.length + "px";
+				break;
+			case DOWN:
+				this.htmlElement.style.left = this.startX + "px";
+				this.htmlElement.style.top = this.startY + "px";
+				this.htmlElement.style.width = this.thickness + "px";
+				if(this.nextSegment)
+					this.htmlElement.style.height = this.length + this.thickness + "px";
+				else
+					this.htmlElement.style.height = this.length + "px";
+				break;
+		}
+		
+		if(this.nextSegment)
+			this.nextSegment.draw();
+	}
+	
+	/**
+	 * Returns the "left" coordinate of the end point of this segment
+	 */
+	this.getEndX = function()
+	{		
+		switch(this.orientation)
+		{
+			case LEFT: return this.startX - this.length;
+			case RIGHT: return this.startX + this.length;
+			case DOWN: return this.startX;
+			case UP: return this.startX;
+		}
+	}
+	
+	/**
+	 * Returns the "top" coordinate of the end point of this segment
+	 */
+	this.getEndY = function()
+	{		
+		switch(this.orientation)
+		{
+			case LEFT: return this.startY;
+			case RIGHT: return this.startY;
+			case DOWN: return this.startY + this.length;
+			case UP: return this.startY - this.length;
+		}
+	}
+		
+	/**
+	 * Append another segment to the end point of this.
+	 * If another segment is already appended to this, cascades the operation so
+	 * the given next segment will be appended to the tail of the segments chain.
+	 */
+	this.append = function(nextSegment)
+	{
+		if(!nextSegment)
+			return;
+		if(!this.nextSegment)
+		{
+			this.nextSegment = nextSegment;
+			this.nextSegment.startX = this.getEndX();
+			this.nextSegment.startY = this.getEndY();
+		}
+		else
+			this.nextSegment.append(nextSegment);
+	}
+	
+	this.detach = function()
+	{
+		var s = this.nextSegment;
+		this.nextSegment = null;
+		return s;
+	}
+	
+	/**
+	 * hides this segment and all the following
+	 */
+	this.cascadeHide = function()
+	{
+		this.visible = false;
+		if(this.nextSegment)
+			this.nextSegment.cascadeHide();
+	}
+}
+/**
+ * Connector class.
+ * The init function takes two Block objects as arguments representing 
+ * the source and destination of the connector
+ */
+function Connector(htmlElement, canvas)
+{
+	/**
+	 * declaring html element
+	 */
+	this.htmlElement = htmlElement;
+	
+	/**
+	 * the canvas this connector is in
+	 */
+	this.canvas = canvas;
+	
+	/**
+	 * the source block
+	 */
+	this.source = null;
+	
+	/**
+	 * the destination block
+	 */
+	this.destination = null;	
+	
+	/**
+	 * preferred orientation
+	 */
+	this.preferredSourceOrientation = AUTO;
+	this.preferredDestinationOrientation = AUTO;
+	
+	/**
+	 * css class to be applied to the connector's segments
+	 */
+	this.connectorClass;
+	
+	/**
+	 * minimum length for a connector segment.
+	 */
+	this.minSegmentLength = 10;
+
+	/**
+	 * size of the connector, i.e.: thickness of the segments.
+	 */
+	this.size = 2;
+	
+	/**
+	 * connector's color
+	 */
+	this.color = 'black';
+	
+	/**
+	 * move listeners, they are notify when connector moves
+	 */
+	this.moveListeners = new Array();
+	
+	this.firstSegment;
+	
+	this.segmentsPool;
+	
+	this.segmentsNumber = 0;
+	
+	this.strategy;
+		
+	this.initConnector = function()
+	{
+		// detect the connector id
+		if(this.htmlElement.id)
+			this.id = this.htmlElement.id;
+		else
+			this.id = this.htmlElement.className;
+			
+		// split the class name to get the ids of the source and destination blocks
+		var splitted = htmlElement.className.split(' ');
+		if(splitted.length < 3)
+		{
+			alert('Unable to create connector \'' + id + '\', class is not in the correct format: connector <sourceBlockId>, <destBlockId>');
+			return;
+		}
+		
+		this.connectorClass = splitted[0] + ' ' + splitted[1] + ' ' + splitted[2];
+		
+		this.source = this.canvas.findBlock(splitted[1]);
+		if(!this.source)
+		{
+			alert('cannot find source block with id \'' + splitted[1] + '\'');
+			return;
+		}
+		
+		this.destination = this.canvas.findBlock(splitted[2]);
+		if(!this.destination)
+		{
+			alert('cannot find destination block with id \'' + splitted[2] + '\'');
+			return;
+		}
+		
+		// check preferred orientation
+		if(hasClass(this.htmlElement, 'vertical'))
+		{
+			this.preferredSourceOrientation = VERTICAL;
+			this.preferredDestinationOrientation = VERTICAL;
+		}
+		else if(hasClass(this.htmlElement, 'horizontal'))
+		{
+			this.preferredSourceOrientation = HORIZONTAL;
+			this.preferredDestinationOrientation = HORIZONTAL;
+		}
+		else
+		{
+			// check preferred orientation on source side
+			if(hasClass(this.htmlElement, 'vertical_start'))
+				this.preferredSourceOrientation = VERTICAL;
+			else if(hasClass(this.htmlElement, 'horizontal_start'))
+				this.preferredSourceOrientation = HORIZONTAL;
+			else if(hasClass(this.htmlElement, 'left_start'))
+				this.preferredSourceOrientation = LEFT;
+			else if(hasClass(this.htmlElement, 'right_start'))
+				this.preferredSourceOrientation = RIGHT;
+			else if(hasClass(this.htmlElement, 'up_start'))
+				this.preferredSourceOrientation = UP;
+			else if(hasClass(this.htmlElement, 'down_start'))
+				this.preferredSourceOrientation = DOWN;
+			
+			// check preferred orientation on destination side
+			if(hasClass(this.htmlElement, 'vertical_end'))
+				this.preferredDestinationOrientation = VERTICAL;
+			else if(hasClass(this.htmlElement, 'horizontal_end'))
+				this.preferredDestinationOrientation = HORIZONTAL;
+			else if(hasClass(this.htmlElement, 'left_end'))
+				this.preferredDestinationOrientation = LEFT;
+			else if(hasClass(this.htmlElement, 'right_end'))
+				this.preferredDestinationOrientation = RIGHT;
+			else if(hasClass(this.htmlElement, 'up_end'))
+				this.preferredDestinationOrientation = UP;
+			else if(hasClass(this.htmlElement, 'down_end'))
+				this.preferredDestinationOrientation = DOWN;
+		}
+		
+		// get the first strategy as default
+		this.strategy = strategies[0](this);
+		this.repaint();
+		
+		this.source.moveListeners.push(this);
+		this.destination.moveListeners.push(this);
+		
+		// call inspectors for this connector
+		var i;
+		for(i = 0; i < inspectors.length; i++)
+		{
+			inspectors[i].inspect(this);
+		}
+		
+		// remove old html element
+		this.htmlElement.parentNode.removeChild(this.htmlElement);
+	}
+	
+	this.getStartSegment = function()
+	{
+		return this.firstSegment;
+	}
+	
+	this.getEndSegment = function()
+	{
+		var s = this.firstSegment;
+		while(s.nextSegment)
+			s = s.nextSegment;
+		return s;
+	}
+	
+	this.getMiddleSegment = function()
+	{
+		if(!this.strategy)
+			return null;
+		else
+			return this.strategy.getMiddleSegment();
+	}
+	
+	this.createSegment = function()
+	{
+		var segment;
+		
+		// if the pool contains more objects, borrow the segment, create it otherwise
+		if(this.segmentsPool)
+		{
+			segment = this.segmentsPool;
+			this.segmentsPool = this.segmentsPool.detach();
+		}
+		else
+		{		
+			segment = new Segment(this.id + "_" + (this.segmentsNumber + 1), this.canvas.htmlElement);
+			segment.htmlElement.className = this.connectorClass;
+			if(!getStyle(segment.htmlElement, 'background-color'))
+				segment.htmlElement.style.backgroundColor = this.color;
+			segment.thickness = this.size;
+		}
+		this.segmentsNumber++;
+		
+		if(this.firstSegment)
+			this.firstSegment.append(segment);
+		else
+			this.firstSegment = segment;
+		segment.visible = true;
+		return segment;
+	}
+	
+	/**
+	 * Repaints the connector
+	 */
+	this.repaint = function()
+	{
+		// check strategies fitness and choose the best fitting one
+		var i;
+		var maxFitness = 0;
+		var fitness;
+		var s;
+		
+		// check if any strategy is possible with preferredOrientation
+		for(i = 0; i < strategies.length; i++)
+		{
+			this.clearSegments();
+			
+			fitness = 0;
+			s = strategies[i](this);
+			if(s.isApplicable())
+			{
+				fitness++;
+				s.paint();
+				// check resulting orientation against the preferred orientations
+				if((this.firstSegment.orientation & this.preferredSourceOrientation) != 0)
+					fitness++;
+				if((this.getEndSegment().orientation & this.preferredDestinationOrientation) != 0)
+					fitness++;
+			}
+			
+			if(fitness > maxFitness)
+			{
+				this.strategy = s;
+				maxFitness = fitness;
+			}
+		}			
+		
+		this.clearSegments();
+
+		this.strategy.paint();
+		this.firstSegment.draw();
+
+		// this is needed to actually hide unused html elements	
+		if(this.segmentsPool)
+			this.segmentsPool.draw();
+	}
+	
+	/**
+	 * Hide all the segments and return them to pool
+	 */
+	this.clearSegments = function()
+	{
+		if(this.firstSegment)
+		{
+			this.firstSegment.cascadeHide();
+			this.firstSegment.append(this.segmentsPool);
+			this.segmentsPool = this.firstSegment;
+			this.firstSegment = null;
+		}	
+	}
+		
+	this.onMove = function()
+	{
+		this.repaint();
+		
+		// notify listeners
+		var i;
+		for(i = 0; i < this.moveListeners.length; i++)
+			this.moveListeners[i].onMove();
+	}
+}
+
+var strategies = new Array();
+
+function ConnectorEnd(htmlElement, connector, side)
+{
+	this.side = side;
+	this.htmlElement = htmlElement;
+	this.connector = connector;
+	connector.canvas.htmlElement.appendChild(htmlElement);
+	// strip extension
+	if(this.htmlElement.tagName.toLowerCase() == "img")
+	{
+		this.src = this.htmlElement.src.substring(0, this.htmlElement.src.lastIndexOf('.'));
+		this.srcExtension = this.htmlElement.src.substring(this.htmlElement.src.lastIndexOf('.'));
+		this.htmlElement.style.zIndex = getStyle(this.connector.htmlElement, "z-index");
+	}
+	
+	this.orientation;
+	
+	this.repaint = function()
+	{
+		this.htmlElement.style.position = 'absolute';
+				
+		var left;
+		var top;
+		var segment;
+		var orientation;
+		
+		if(this.side == START)
+		{
+			segment = connector.getStartSegment();
+			left = segment.startX;
+			top = segment.startY;
+			orientation = segment.orientation;
+			// swap orientation
+			if((orientation & VERTICAL) != 0)
+				orientation = (~orientation) & VERTICAL;
+			else
+				orientation = (~orientation) & HORIZONTAL;
+		}
+		else
+		{
+			segment = connector.getEndSegment();
+			left = segment.getEndX();
+			top = segment.getEndY();
+			orientation = segment.orientation;
+		}
+		
+		switch(orientation)
+		{
+			case LEFT:
+				top -= (this.htmlElement.offsetHeight - segment.thickness) / 2;
+				break;
+			case RIGHT:
+				left -= this.htmlElement.offsetWidth;
+				top -= (this.htmlElement.offsetHeight - segment.thickness) / 2;
+				break;
+			case DOWN:
+				top -= this.htmlElement.offsetHeight;
+				left -= (this.htmlElement.offsetWidth - segment.thickness) / 2;
+				break;
+			case UP:
+				left -= (this.htmlElement.offsetWidth - segment.thickness) / 2;
+				break;
+		}
+		
+		this.htmlElement.style.left = Math.ceil(left) + "px";
+		this.htmlElement.style.top = Math.ceil(top) + "px";
+		
+		if(this.htmlElement.tagName.toLowerCase() == "img" && this.orientation != orientation)
+		{
+			var orientationSuffix;
+			switch(orientation)
+			{
+				case UP: orientationSuffix = "u"; break;
+				case DOWN: orientationSuffix = "d"; break;
+				case LEFT: orientationSuffix = "l"; break;
+				case RIGHT: orientationSuffix = "r"; break;
+			}
+			this.htmlElement.src = this.src + "_" + orientationSuffix + this.srcExtension;
+		}
+		this.orientation = orientation;
+	}
+	
+	this.onMove = function()
+	{
+		this.repaint();
+	}
+}
+
+function SideConnectorLabel(connector, htmlElement, side)
+{
+	this.connector = connector;
+	this.htmlElement = htmlElement;
+	this.side = side;
+	this.connector.htmlElement.parentNode.appendChild(htmlElement);
+		
+	this.repaint = function()
+	{
+		this.htmlElement.style.position = 'absolute';
+		var left;
+		var top;
+		var segment;
+
+		if(this.side == START)
+		{	
+			segment = this.connector.getStartSegment();
+			left = segment.startX;
+			top = segment.startY;
+			if(segment.orientation == LEFT)
+				left -= this.htmlElement.offsetWidth;
+			if(segment.orientation == UP)
+				top -= this.htmlElement.offsetHeight;
+				
+			if((segment.orientation & HORIZONTAL) != 0 && top < this.connector.getEndSegment().getEndY())
+				top -= this.htmlElement.offsetHeight;
+			if((segment.orientation & VERTICAL) != 0 && left < this.connector.getEndSegment().getEndX())
+				left -= this.htmlElement.offsetWidth;
+		}
+		else
+		{	
+			segment = this.connector.getEndSegment();
+			left = segment.getEndX();
+			top = segment.getEndY();
+			if(segment.orientation == RIGHT)
+				left -= this.htmlElement.offsetWidth;
+			if(segment.orientation == DOWN)
+				top -= this.htmlElement.offsetHeight;
+			if((segment.orientation & HORIZONTAL) != 0 && top < this.connector.getStartSegment().startY)
+				top -= this.htmlElement.offsetHeight;
+			if((segment.orientation & VERTICAL) != 0 && left < this.connector.getStartSegment().startX)
+				left -= this.htmlElement.offsetWidth;
+		}
+		
+		this.htmlElement.style.left = Math.ceil(left) + "px";
+		this.htmlElement.style.top = Math.ceil(top) + "px";
+	}
+	
+	this.onMove = function()
+	{
+		this.repaint();
+	}
+}
+
+function MiddleConnectorLabel(connector, htmlElement)
+{
+	this.connector = connector;
+	this.htmlElement = htmlElement;
+	this.connector.canvas.htmlElement.appendChild(htmlElement);
+	
+	this.repaint = function()
+	{
+		this.htmlElement.style.position = 'absolute';
+		
+		var left;
+		var top;
+		var segment = connector.getMiddleSegment();
+
+		if((segment.orientation & VERTICAL) != 0)
+		{
+			// put label at middle height on right side of the connector
+			top = segment.htmlElement.offsetTop + (segment.htmlElement.offsetHeight - this.htmlElement.offsetHeight) / 2;
+			left = segment.htmlElement.offsetLeft;
+		}
+		else
+		{
+			// put connector below the connector at middle widths
+			top = segment.htmlElement.offsetTop;
+			left = segment.htmlElement.offsetLeft + (segment.htmlElement.offsetWidth - this.htmlElement.offsetWidth) / 2;;
+		}
+		
+		this.htmlElement.style.left = Math.ceil(left) + "px";
+		this.htmlElement.style.top = Math.ceil(top) + "px";
+	}
+	
+	this.onMove = function()
+	{
+		this.repaint();
+	}
+}
+
+/*
+ * Inspector classes
+ */
+
+function ConnectorEndsInspector()
+{
+	this.inspect = function(connector)
+	{
+		var children = connector.htmlElement.childNodes;
+		var i;
+		for(i = 0; i < children.length; i++)
+		{
+			if(hasClass(children[i], "connector-end"))
+			{
+				var newElement = new ConnectorEnd(children[i], connector, END);
+				newElement.repaint();
+				connector.moveListeners.push(newElement);
+			}
+			else if(hasClass(children[i], "connector-start"))
+			{
+				var newElement = new ConnectorEnd(children[i], connector, START);
+				newElement.repaint();
+				connector.moveListeners.push(newElement);
+			}
+		}
+	}
+}
+
+function ConnectorLabelsInspector()
+{
+	this.inspect = function(connector)
+	{
+		var children = connector.htmlElement.childNodes;
+		var i;
+		for(i = 0; i < children.length; i++)
+		{
+			if(hasClass(children[i], "source-label"))
+			{
+				var newElement = new SideConnectorLabel(connector, children[i], START);
+				newElement.repaint();
+				connector.moveListeners.push(newElement);
+			}
+			else if(hasClass(children[i], "middle-label"))
+			{
+				var newElement = new MiddleConnectorLabel(connector, children[i]);
+				newElement.repaint();
+				connector.moveListeners.push(newElement);
+			}
+			else if(hasClass(children[i], "destination-label"))
+			{
+				var newElement = new SideConnectorLabel(connector, children[i], END);
+				newElement.repaint();
+				connector.moveListeners.push(newElement);
+			}
+		}
+	}
+}
+
+/*
+ * Inspector registration
+ */
+
+inspectors.push(new ConnectorEndsInspector());
+inspectors.push(new ConnectorLabelsInspector());
+
+/*
+ * an array containing all the canvases in document
+ */
+var canvases = new Array();
+
+/*
+ * This function initializes the js_graph objects inspecting the html document
+ */
+function initPageObjects()
+{
+	if(isCanvas(document.body))
+	{
+		var newCanvas = new Canvas(document.body);
+		newCanvas.initCanvas();
+		canvases.push(newCanvas);
+	}
+	else
+	{	
+		var divs = document.getElementsByTagName('div');
+		var i;
+		for(i = 0; i < divs.length; i++)
+		{
+			if(isCanvas(divs[i]) && !findCanvas(divs[i].id))
+			{
+				var newCanvas = new Canvas(divs[i]);
+				newCanvas.initCanvas();
+				canvases.push(newCanvas);
+			}
+		}
+	}
+}
+
+
+/*
+ * Utility functions
+ */
+
+
+function findCanvas(canvasId)
+{	
+	var i;
+	for(i = 0; i < canvases.length; i++)
+		if(canvases[i].id == canvasId)
+			return canvases[i];
+	return null;
+}
+
+function findBlock(blockId)
+{
+	var i;
+	for(i = 0; i < canvases.length; i++)
+	{
+		var block = canvases[i].findBlock(blockId);
+		if(block)
+			return block;
+	}
+	return null;
+}
+ 
+/*
+ * This function determines whether a html element is to be considered a canvas
+ */
+function isBlock(htmlElement)
+{
+	return hasClass(htmlElement, 'block');
+}
+
+/*
+ * This function determines whether a html element is to be considered a block
+ */
+function isCanvas(htmlElement)
+{
+	return hasClass(htmlElement, 'canvas');
+}
+
+/*
+ * This function determines whether a html element is to be considered a connector
+ */
+function isConnector(htmlElement)
+{
+	return htmlElement.className && htmlElement.className.match(new RegExp('connector .*'));
+}
+
+/*
+ * This function calculates the absolute 'top' value for a html node
+ */
+function calculateOffsetTop(obj)
+{
+	var curtop = 0;
+	if (obj.offsetParent)
+	{
+		curtop = obj.offsetTop
+		while (obj = obj.offsetParent) 
+			curtop += obj.offsetTop
+	}
+	else if (obj.y)
+		curtop += obj.y;
+	return curtop;
+}
+
+/*
+ * This function calculates the absolute 'left' value for a html node
+ */
+function calculateOffsetLeft(obj)
+{
+	var curleft = 0;
+	if (obj.offsetParent)
+	{
+		curleft = obj.offsetLeft
+		while (obj = obj.offsetParent) 
+		{
+			curleft += obj.offsetLeft;
+		}
+	}
+	else if (obj.x)
+		curleft += obj.x;
+	return curleft;
+}
+
+function parseBorder(obj, side)
+{
+	var sizeString = getStyle(obj, "border-" + side + "-width");
+	if(sizeString && sizeString != "")
+	{
+		if(sizeString.substring(sizeString.length - 2) == "px")
+			return parseInt(sizeString.substring(0, sizeString.length - 2));
+	}
+	return 0;
+}
+
+function hasClass(element, className)
+{
+	if(!element || !element.className)
+		return false;
+		
+	var classes = element.className.split(' ');
+	var i;
+	for(i = 0; i < classes.length; i++)
+		if(classes[i] == className)
+			return true;
+	return false;
+}
+
+/**
+ * This function retrieves the actual value of a style property even if it is set via css.
+ */
+function getStyle(node, styleProp)
+{
+	// if not an element
+	if( node.nodeType != 1)
+		return;
+		
+	var value;
+	if (node.currentStyle)
+	{
+		// ie case
+		styleProp = replaceDashWithCamelNotation(styleProp);
+		value = node.currentStyle[styleProp];
+	}
+	else if (window.getComputedStyle)
+	{
+		// mozilla case
+		value = document.defaultView.getComputedStyle(node, null).getPropertyValue(styleProp);
+	}
+	
+	return value;
+}
+
+function replaceDashWithCamelNotation(value)
+{
+	var pos = value.indexOf('-');
+	while(pos > 0 && value.length > pos + 1)
+	{
+		value = value.substring(0, pos) + value.substring(pos + 1, pos + 2).toUpperCase() + value.substring(pos + 2);
+		pos = value.indexOf('-');
+	}
+	return value;
+}
+
+
+/*******************************
+ * Connector paint strategies. *
+ *******************************/
+ 
+/**
+ * Horizontal "S" routing strategy.
+ */
+function HorizontalSStrategy(connector)
+{
+	this.connector = connector;
+	
+	this.startSegment;
+	this.middleSegment;
+	this.endSegment;
+	
+	this.strategyName = "horizontal_s";
+	
+	this.getMiddleSegment = function()
+	{
+		return this.middleSegment;
+	}
+	
+	this.isApplicable = function()
+	{
+		var sourceLeft = this.connector.source.left();
+		var sourceWidth = this.connector.source.width();
+		var destinationLeft = this.connector.destination.left();
+		var destinationWidth = this.connector.destination.width();
+		
+		return Math.abs(2 * destinationLeft + destinationWidth - (2 * sourceLeft + sourceWidth)) - (sourceWidth + destinationWidth) > 4 * this.connector.minSegmentLength;
+	}
+	
+	this.paint = function()
+	{
+		this.startSegment = connector.createSegment();
+		this.middleSegment = connector.createSegment();
+		this.endSegment = connector.createSegment();
+		
+		var sourceLeft = this.connector.source.left();
+		var sourceTop = this.connector.source.top();
+		var sourceWidth = this.connector.source.width();
+		var sourceHeight = this.connector.source.height();
+		
+		var destinationLeft = this.connector.destination.left();
+		var destinationTop = this.connector.destination.top();
+		var destinationWidth = this.connector.destination.width();
+		var destinationHeight = this.connector.destination.height();
+		
+		var hLength;
+		
+		this.startSegment.startY = Math.floor(sourceTop + sourceHeight / 2);
+			
+		// deduce which face to use on source and destination blocks
+		if(sourceLeft + sourceWidth / 2 < destinationLeft + destinationWidth / 2)
+		{
+			// use left side of the source block and right side of the destination block
+			this.startSegment.startX = sourceLeft + sourceWidth;
+			hLength = destinationLeft - (sourceLeft + sourceWidth);
+		}
+		else
+		{
+			// use right side of the source block and left side of the destination block
+			this.startSegment.startX = sourceLeft;
+			hLength = destinationLeft + destinationWidth - sourceLeft;
+		}
+
+		// first horizontal segment positioning
+		this.startSegment.length = Math.floor(Math.abs(hLength) / 2);
+		this.startSegment.orientation = hLength > 0 ? RIGHT : LEFT;
+		
+		// vertical segment positioning			
+		var vLength = Math.floor(destinationTop + destinationHeight / 2 - (sourceTop + sourceHeight / 2));		
+		this.middleSegment.length = Math.abs(vLength);
+		if(vLength == 0)
+			this.middleSegment.visible = false;
+		this.middleSegment.orientation = vLength > 0 ? DOWN : UP;
+		
+		// second horizontal segment positioning
+		this.endSegment.length = Math.floor(Math.abs(hLength) / 2);
+		this.endSegment.orientation = hLength > 0 ? RIGHT : LEFT;
+	}
+}
+
+/**
+ * Vertical "S" routing strategy.
+ */
+function VerticalSStrategy(connector)
+{
+	this.connector = connector;
+	
+	this.startSegment;
+	this.middleSegment;
+	this.endSegment;
+	
+	this.strategyName = "vertical_s";
+	
+	this.getMiddleSegment = function()
+	{
+		return this.middleSegment;
+	}	
+	
+	this.isApplicable = function()
+	{
+		var sourceTop = this.connector.source.top();
+		var sourceHeight = this.connector.source.height();
+		var destinationTop = this.connector.destination.top();
+		var destinationHeight = this.connector.destination.height();
+		return Math.abs(2 * destinationTop + destinationHeight - (2 * sourceTop + sourceHeight)) - (sourceHeight + destinationHeight) > 4 * this.connector.minSegmentLength;
+	}
+	
+	this.paint = function()
+	{
+		this.startSegment = connector.createSegment();
+		this.middleSegment = connector.createSegment();
+		this.endSegment = connector.createSegment();
+		
+		var sourceLeft = this.connector.source.left();
+		var sourceTop = this.connector.source.top();
+		var sourceWidth = this.connector.source.width();
+		var sourceHeight = this.connector.source.height();
+		
+		var destinationLeft = this.connector.destination.left();
+		var destinationTop = this.connector.destination.top();
+		var destinationWidth = this.connector.destination.width();
+		var destinationHeight = this.connector.destination.height();
+		
+		var vLength;
+		
+		this.startSegment.startX = 	Math.floor(sourceLeft + sourceWidth / 2);
+			
+		// deduce which face to use on source and destination blocks
+		if(sourceTop + sourceHeight / 2 < destinationTop + destinationHeight / 2)
+		{
+			// use bottom side of the source block and top side of destination block
+			this.startSegment.startY = sourceTop + sourceHeight;
+			vLength = destinationTop - (sourceTop + sourceHeight);
+		}
+		else
+		{
+			// use top side of the source block and bottom side of the destination block
+			this.startSegment.startY = sourceTop;
+			vLength = destinationTop + destinationHeight - sourceTop;
+		}
+		
+		// first vertical segment positioning
+		this.startSegment.length = Math.floor(Math.abs(vLength) / 2);
+		this.startSegment.orientation = vLength > 0 ? DOWN : UP;
+		
+		// horizontal segment positioning
+		var hLength = Math.floor(destinationLeft + destinationWidth / 2 - (sourceLeft + sourceWidth / 2));
+		this.middleSegment.length = Math.abs(hLength);
+		this.middleSegment.orientation = hLength > 0 ? RIGHT : LEFT;
+					
+		// second vertical segment positioning
+		this.endSegment.length = Math.floor(Math.abs(vLength) / 2);
+		this.endSegment.orientation = vLength > 0 ? DOWN : UP;
+	}
+}
+
+/**
+ * A horizontal "L" connector routing strategy
+ */
+function HorizontalLStrategy(connector)
+{
+	this.connector = connector;
+	
+	this.destination;
+	
+	this.startSegment;
+	this.endSegment;
+	
+	this.strategyName = "horizontal_L";
+	
+	this.isApplicable = function()
+	{
+		var destMiddle = Math.floor(this.connector.destination.left() + this.connector.destination.width() / 2);
+		var sl = this.connector.source.left();
+		var sw = this.connector.source.width();
+		var dt = this.connector.destination.top();
+		var dh = this.connector.destination.height();
+		var sourceMiddle = Math.floor(this.connector.source.top() + this.connector.source.height() / 2);
+
+		if(destMiddle > sl && destMiddle < sl + sw)
+			return false;
+		if(sourceMiddle > dt && sourceMiddle < dt + dh)
+			return false;
+		return true;
+	}
+	
+	/**
+	 * Chooses the longest segment as the "middle" segment.
+	 */
+	this.getMiddleSegment = function()
+	{
+		if(this.startSegment.length > this.endSegment.length)
+			return this.startSegment;
+		else
+			return this.endSegment;
+	}
+	
+	this.paint = function()
+	{
+		this.startSegment = this.connector.createSegment();
+		this.endSegment = this.connector.createSegment();
+		
+		var destMiddleX = Math.floor(this.connector.destination.left() + this.connector.destination.width() / 2);
+		var sl = this.connector.source.left();
+		var sw = this.connector.source.width();
+		var dt = this.connector.destination.top();
+		var dh = this.connector.destination.height();
+		
+		this.startSegment.startY = Math.floor(this.connector.source.top() + this.connector.source.height() / 2);
+		
+		// decide which side of the source block to connect to
+		if(Math.abs(destMiddleX - sl) < Math.abs(destMiddleX - (sl + sw)))
+		{
+			// use the left face
+			this.startSegment.orientation = (destMiddleX < sl) ? LEFT : RIGHT;				
+			this.startSegment.startX = sl;
+		}
+		else
+		{
+			// use the right face
+			this.startSegment.orientation = (destMiddleX > (sl + sw)) ? RIGHT : LEFT;
+			this.startSegment.startX = sl + sw;
+		}
+		
+		this.startSegment.length = Math.abs(destMiddleX - this.startSegment.startX);
+		
+		// decide which side of the destination block to connect to
+		if(Math.abs(this.startSegment.startY - dt) < Math.abs(this.startSegment.startY - (dt + dh)))
+		{
+			// use the upper face
+			this.endSegment.orientation = (this.startSegment.startY < dt) ? DOWN : UP;
+			this.endSegment.length = Math.abs(this.startSegment.startY - dt);
+		}
+		else
+		{
+			// use the lower face
+			this.endSegment.orientation = (this.startSegment.startY > (dt + dh)) ? UP : DOWN;
+			this.endSegment.length = Math.abs(this.startSegment.startY - (dt + dh));
+		}
+	}
+}
+
+/**
+ * Vertical "L" connector routing strategy
+ */
+function VerticalLStrategy(connector)
+{
+	this.connector = connector;
+	
+	this.startSegment;
+	this.endSegment;
+	
+	this.strategyName = "vertical_L";
+	
+	this.isApplicable = function()
+	{
+		var sourceMiddle = Math.floor(this.connector.source.left() + this.connector.source.width() / 2);
+		var dl = this.connector.destination.left();
+		var dw = this.connector.destination.width();
+		var st = this.connector.source.top();
+		var sh = this.connector.source.height();
+		var destMiddle = Math.floor(this.connector.destination.top() + this.connector.destination.height() / 2);
+
+		if(sourceMiddle > dl && sourceMiddle < dl + dw)
+			return false;
+		if(destMiddle > st && destMiddle < st + sh)
+			return false;
+		return true;	
+	}
+	
+	/**
+	 * Chooses the longest segment as the "middle" segment.
+	 */
+	this.getMiddleSegment = function()
+	{
+		if(this.startSegment.length > this.endSegment.length)
+			return this.startSegment;
+		else
+			return this.endSegment;
+	}
+	
+	this.paint = function()
+	{
+		this.startSegment = this.connector.createSegment();
+		this.endSegment = this.connector.createSegment();
+		
+		var destMiddleY = Math.floor(this.connector.destination.top() + this.connector.destination.height() / 2);
+		var dl = this.connector.destination.left();
+		var dw = this.connector.destination.width();
+		var st = this.connector.source.top();
+		var sh = this.connector.source.height();
+		
+		this.startSegment.startX = Math.floor(this.connector.source.left() + this.connector.source.width() / 2);
+		
+		// decide which side of the source block to connect to
+		if(Math.abs(destMiddleY - st) < Math.abs(destMiddleY - (st + sh)))
+		{
+			// use the upper face
+			this.startSegment.orientation = (destMiddleY < st) ? UP : DOWN;
+			this.startSegment.startY = st;
+		}
+		else
+		{
+			// use the lower face
+			this.startSegment.orientation = (destMiddleY > (st + sh)) ? DOWN : UP;
+			this.startSegment.startY = st + sh;
+		}
+		
+		this.startSegment.length = Math.abs(destMiddleY - this.startSegment.startY);
+		
+		// decide which side of the destination block to connect to
+		if(Math.abs(this.startSegment.startX - dl) < Math.abs(this.startSegment.startX - (dl + dw)))
+		{
+			// use the left face
+			this.endSegment.orientation = (this.startSegment.startX < dl) ? RIGHT : LEFT;
+			this.endSegment.length = Math.abs(this.startSegment.startX - dl);
+		}
+		else
+		{
+			// use the right face
+			this.endSegment.orientation = (this.startSegment.startX > dl + dw) ? LEFT : RIGHT;
+			this.endSegment.length = Math.abs(this.startSegment.startX - (dl + dw));
+		}
+	}
+}
+
+function HorizontalCStrategy(connector, startOrientation)
+{
+	this.connector = connector;
+	
+	this.startSegment;
+	this.middleSegment;
+	this.endSegment;
+	
+	this.strategyName = "horizontal_c";
+	
+	this.getMiddleSegment = function()
+	{
+		return this.middleSegment;
+	}	
+	
+	this.isApplicable = function()
+	{
+		return true;
+	}
+	
+	this.paint = function()
+	{
+		this.startSegment = connector.createSegment();
+		this.middleSegment = connector.createSegment();
+		this.endSegment = connector.createSegment();
+		
+		var sign = 1;
+		if(startOrientation == RIGHT)
+			sign = -1;
+		
+		var startX = this.connector.source.left();
+		if(startOrientation == RIGHT)
+			startX += this.connector.source.width();
+		var startY = Math.floor(this.connector.source.top() + this.connector.source.height() / 2);
+		
+		var endX = this.connector.destination.left();
+		if(startOrientation == RIGHT)
+			endX += this.connector.destination.width();
+		var endY = Math.floor(this.connector.destination.top() + this.connector.destination.height() / 2);
+
+		this.startSegment.startX = startX;
+		this.startSegment.startY = startY;
+		this.startSegment.orientation = startOrientation;
+		this.startSegment.length = this.connector.minSegmentLength + Math.max(0, sign * (startX - endX));
+		
+		var vLength = endY - startY;
+		this.middleSegment.orientation = vLength > 0 ? DOWN : UP;
+		this.middleSegment.length = Math.abs(vLength);
+		
+		this.endSegment.orientation = startOrientation == LEFT ? RIGHT : LEFT;
+		this.endSegment.length = Math.max(0, sign * (endX - startX)) + this.connector.minSegmentLength;
+	}
+}
+
+function VerticalCStrategy(connector, startOrientation)
+{
+	this.connector = connector;
+	
+	this.startSegment;
+	this.middleSegment;
+	this.endSegment;
+	
+	this.strategyName = "vertical_c";
+	
+	this.getMiddleSegment = function()
+	{
+		return this.middleSegment;
+	}	
+	
+	this.isApplicable = function()
+	{
+		return true;
+	}
+	
+	this.paint = function()
+	{
+		this.startSegment = connector.createSegment();
+		this.middleSegment = connector.createSegment();
+		this.endSegment = connector.createSegment();
+		
+		var sign = 1;
+		if(startOrientation == DOWN)
+			sign = -1;
+		
+		var startY = this.connector.source.top();
+		if(startOrientation == DOWN)
+			startY += this.connector.source.height();
+		var startX = Math.floor(this.connector.source.left() + this.connector.source.width() / 2);
+		
+		var endY = this.connector.destination.top();
+		if(startOrientation == DOWN)
+			endY += this.connector.destination.height();
+		var endX = Math.floor(this.connector.destination.left() + this.connector.destination.width() / 2);
+
+		this.startSegment.startX = startX;
+		this.startSegment.startY = startY;
+		this.startSegment.orientation = startOrientation;
+		this.startSegment.length = this.connector.minSegmentLength + Math.max(0, sign * (startY - endY));
+		
+		var hLength = endX - startX;
+		this.middleSegment.orientation = hLength > 0 ? RIGHT : LEFT;
+		this.middleSegment.length = Math.abs(hLength);
+		
+		this.endSegment.orientation = startOrientation == UP ? DOWN : UP;
+		this.endSegment.length = Math.max(0, sign * (endY - startY)) + this.connector.minSegmentLength;
+	}
+}
+
+
+strategies[0] = function(connector) {return new HorizontalSStrategy(connector)};
+strategies[1] = function(connector) {return new VerticalSStrategy(connector)};
+strategies[2] = function(connector) {return new HorizontalLStrategy(connector)};
+strategies[3] = function(connector) {return new VerticalLStrategy(connector)};
+strategies[4] = function(connector) {return new HorizontalCStrategy(connector, LEFT)};
+strategies[5] = function(connector) {return new HorizontalCStrategy(connector, RIGHT)};
+strategies[6] = function(connector) {return new VerticalCStrategy(connector, UP)};
+strategies[7] = function(connector) {return new VerticalCStrategy(connector, DOWN)};
\ No newline at end of file
diff --git a/sourcecodes/k-best/index.html b/sourcecodes/k-best/index.html
new file mode 100644
index 00000000..429668c7
--- /dev/null
+++ b/sourcecodes/k-best/index.html
@@ -0,0 +1,6 @@
+<html>
+<head>
+<title>Bayesian Network Web Server</title>
+<meta HTTP-EQUIV="REFRESH" content="0; url=http://compbio.uthsc.edu/BNW/sourcecodes/home.php">
+</head>
+</html>
diff --git a/sourcecodes/k-best/src/Arguments.h b/sourcecodes/k-best/src/Arguments.h
new file mode 100644
index 00000000..574b2bf7
--- /dev/null
+++ b/sourcecodes/k-best/src/Arguments.h
@@ -0,0 +1,195 @@
+#ifndef ARGUMENTS_H
+#define ARGUMENTS_H
+
+#include<stdio.h>
+#include<stdlib.h>
+
+using namespace std;
+
+class Arguments {
+public:
+	static char* datafile;
+	static char* layeringfile;
+	static char* maxindegree;
+	static char* model;
+	static char* task;
+	static char* maxnumrecords;
+	
+	//HR: Add for in_out features
+	static char* inFeasFileName;
+	static char* outFeasFileName;
+	//
+	
+	//HR: Add for in_out features
+	static int option;
+	//
+	
+	//HR: Add for ADtree option
+	static int ADtree;
+	//
+	
+	//HR: Add for Topk dir option
+	static char* directoryName;
+	//
+
+
+
+	static void init(int argc, char **args){
+		for(int i = 1; i < argc; i ++){
+			
+			if(args[i][0]=='-' && args[i][1]=='d' && args[i][2]=='\0'){
+				int j = i + 1;
+				while (j < argc && args[j][0]!='-') {
+					Arguments::datafile = args[j];
+					j ++;
+				} 
+			}
+			else if(args[i][0]=='-' && args[i][1]=='l' && args[i][2]=='\0'){
+				int j = i + 1;
+				while (j < argc && args[j][0]!='-') {
+					Arguments::layeringfile = args[j]; 
+					j ++;
+				}
+			}
+			else if(args[i][0]=='-' && args[i][1]=='m' && args[i][2]=='\0'){
+				int j = i + 1;
+				while (j < argc && args[j][0]!='-') {
+					Arguments::maxindegree = args[j]; 
+					j ++;
+				}
+			}
+			else if(args[i][0]=='-' && args[i][1]=='u' && args[i][2]=='\0'){
+				int j = i + 1;
+				while (j < argc && args[j][0]!='-') {
+					Arguments::maxnumrecords = args[j]; 
+					j ++;
+				}
+			}
+			else if(args[i][0]=='-' && args[i][1]=='M' && args[i][2]=='\0'){
+				int j = i + 1;
+				while (j < argc && args[j][0]!='-') {
+					Arguments::model = args[j]; 
+					j ++;
+				}
+			}
+			else if(args[i][0]=='-' && args[i][1]=='T' && args[i][2]=='\0'){
+				int j = i + 1;
+				while (j < argc && args[j][0]!='-') {
+					Arguments::task = args[j]; 
+					j ++;
+				}
+			}
+			//HR: Add for in_out feature
+			else if(args[i][0]=='-' && args[i][1]=='i' && args[i][2]=='n' && args[i][3]=='\0'){
+				int j = i + 1;
+				while (j < argc && args[j][0]!='-') {
+					Arguments::inFeasFileName = args[j]; 
+					j ++;
+				}
+			}
+			else if(args[i][0]=='-' && args[i][1]=='o' && args[i][2]=='u' && args[i][3]=='t' && args[i][4]=='\0'){
+				int j = i + 1;
+				while (j < argc && args[j][0]!='-') {
+					Arguments::outFeasFileName = args[j]; 
+					j ++;
+				}
+			}
+			//
+			//HR: Add for in_out feature
+			else if(args[i][0]=='-' && args[i][1]=='o' && args[i][2]=='p' && args[i][3]=='t' && args[i][4]=='\0'){
+				int j = i + 1;
+				while (j < argc && args[j][0]!='-') {
+					Arguments::option = atoi(args[j]); 
+					j ++;
+				}
+			}
+			//
+			//HR: Add for ADtree feature
+			else if(args[i][0]=='-' && args[i][1]=='a' && args[i][2]=='d' && args[i][3]=='\0'){
+				int j = i + 1;
+				while (j < argc && args[j][0]!='-') {
+					Arguments::ADtree = atoi(args[j]); 
+					j ++;
+				}
+			}
+			//
+			//HR: Add for Topk dir
+			else if(args[i][0]=='-' && args[i][1]=='d' && args[i][2]=='i' && args[i][3]=='r' && args[i][4]=='\0'){
+				int j = i + 1;
+				while (j < argc && args[j][0]!='-') {
+					Arguments::directoryName = args[j];
+					j++;
+				}
+			}
+			//
+		}
+	
+		print_arguments(stderr);
+		
+	}
+	static void print_arguments(FILE *f){
+		fprintf(f, " -d Data file:\n");
+		fprintf(f, "   %62s\n", Arguments::datafile);	
+		//fprintf(f, " -l Layering file:\n");
+		//fprintf(f, "   %62s\n", Arguments::layeringfile);
+		fprintf(f, " -m Maximum indegree:\n");
+		fprintf(f, "   %62s\n", Arguments::maxindegree);
+		fprintf(f, " -u Maximum number of data records read:\n");
+		fprintf(f, "   %62s\n", Arguments::maxnumrecords);
+		//fprintf(f, " -M Model:\n");
+		//fprintf(f, "   %62s\n", Arguments::model);
+		//fprintf(f, " -T Task (Infer=I, Generate=G):\n");
+		//fprintf(f, "   %62s\n", Arguments::task);
+		
+		//HR: Add for in_out
+		fprintf(f, " -opt Option:\n");
+		fprintf(f, "   %62d\n", Arguments::option);
+		if(Arguments::option == 5){
+			fprintf(f, " -in In_Feature File:\n");
+			fprintf(f, "   %62s\n", Arguments::inFeasFileName);
+			fprintf(f, " -out Out_Feature File:\n");
+			fprintf(f, "   %62s\n", Arguments::outFeasFileName);
+		}
+		//
+		//HR: Add for ADtree
+		fprintf(f, " -ad ADtree:\n");
+		fprintf(f, "   %62d\n", Arguments::ADtree);
+		//
+		//HR: Add for Topk dir
+		fprintf(f, " -dir directory name:\n");
+		fprintf(f, "   %62s\n", Arguments::directoryName);
+		//
+	}
+};
+
+char* Arguments::datafile = "testdata.dat";
+char* Arguments::layeringfile = "%";
+char* Arguments::maxindegree = "3";
+char* Arguments::model = "M";
+char* Arguments::task = "I";
+char* Arguments::maxnumrecords = "999999";
+
+
+//HR: For test
+//char* Arguments::datafile = "cases/iris.idt";
+//char* Arguments::layeringfile = "%";
+//char* Arguments::maxindegree = "4";
+//char* Arguments::model = "M";
+//char* Arguments::task = "I";
+//char* Arguments::maxnumrecords = "150";
+
+
+//HR: Add for in_out
+char* Arguments::inFeasFileName = "inFeature.txt";
+char* Arguments::outFeasFileName = "outFeature.txt";
+int Arguments::option = 5;
+
+//HR: Add for ADtree
+int Arguments::ADtree = 0;
+
+
+//HR: Add for Topk dir option
+char* Arguments::directoryName = "./";
+//
+
+#endif
diff --git a/sourcecodes/k-best/src/Engine.h b/sourcecodes/k-best/src/Engine.h
new file mode 100644
index 00000000..2e16a701
--- /dev/null
+++ b/sourcecodes/k-best/src/Engine.h
@@ -0,0 +1,2278 @@
+#ifndef ENGINE_H
+#define ENGINE_H
+
+#include<stdio.h>
+#include<stdlib.h>
+
+#include"Arguments.h"
+#include"Model.h"
+
+#include <sys/time.h>
+#include <time.h> 
+
+#define MARK 9.0e99
+
+// Substitutes la += log(1+exp(lb-la)) <=> a = a + b.
+#define LOGADD(la,lb) if(la>8e99||lb-la>100) la=lb;else la+=log(1+exp(lb-la));
+
+#define LOG_ZERO -1.0e101
+
+using namespace std;
+
+#include"UpdateHR.h"
+
+
+
+//----------------
+// Fast Möbius transform routines.
+void sub_fumt(int j, int d, int S, int overlap, double *t, double *s, int n, int k){
+	if (d < n && overlap < k){
+		sub_fumt(j, d+1, S, overlap, t, s, n, k);
+		
+		
+		S |= (1 << d);
+		overlap += (d >= j+1);
+		sub_fumt(j, d+1, S, overlap, t, s, n, k); 
+	}
+	
+	else{
+		//base case: 
+		//since s[S] = MARK initially,  and the following 3 cases, s[S] must be assigned some score (neither MARK nor undecided)
+		s[S] = MARK;
+		
+		//jinS: j is in S
+		int jinS = ((S >> j) & 1);
+		if (overlap + jinS <= k) s[S] = t[S];
+		//if (jinS) LOGADD(s[S], t[S - (1 << j)]);
+		if (jinS) logAdd_New(s[S], t[S - (1 << j)]);
+	}
+}
+
+// Fast upward Möbius transform:
+// s(S) := \sum_{T \subseteq S : |T| \leq k} t(T).
+void fumt(double *t, double *s, int n, int k){
+	double *tmp, *sprev = new double[1 << n];
+	for (int T = 0; T < (1<<n); T ++) 
+		sprev[T] = t[T];
+	for (int j = 0; j < n; j ++){
+		//for each j
+		sub_fumt(j, 0, 0, 0, sprev, s, n, k);
+		//recyclely use sprev, s
+		tmp = sprev; 
+		sprev = s; 
+		s = tmp;
+	}
+	if (n % 2 == 0){ 
+		for (int S = 0; S < (1<<n); S ++){ 
+			s[S] = sprev[S];
+		}
+	}
+	else{ 
+		tmp = sprev; 
+		sprev = s; 
+		s = tmp;
+	}
+	delete [] sprev;
+}
+void test_fumt(){
+	int n = 4;
+	double t[16], s[16];
+	for (int S = 0; S < 16; S ++){
+		t[S] = log(S+1);
+	}
+	fumt(t, s, n, 2);
+	for (int S = 0; S < 16; S ++){
+		cerr<<" s["<<S<<"] = "<<exp(s[S])<<endl;
+	}
+}
+
+
+void sub_fdmt(int j, int d, int T, int overlap, double *s, double *t, int n, int k){
+	//cerr<<" T = "<<T<<":"; print_set(cerr, T); 
+	//cerr<<" overlap = "<<overlap<<endl; 
+	if (d < n && overlap <= k){
+		sub_fdmt(j, d+1, T, overlap, s, t, n, k);
+		T |= (1 << d);
+		overlap += (d <= j);
+		sub_fdmt(j, d+1, T, overlap, s, t, n, k); 
+	}
+	else if (d == n){
+		t[T] = s[T];
+		int jinT = ((T >> j) & 1);
+		//if (jinT == 0) LOGADD(t[T], s[T + (1 << j)]);
+		if (jinT == 0) logAdd_New(t[T], s[T + (1 << j)]);
+		if (overlap > k) t[T] = MARK;
+	}
+}
+// Fast downward Möbius transform:
+// t(T) := \sum_{T \subseteq S} s(S).
+void fdmt(double *s, double *t, int n, int k){
+	double *tmp, *tprev = new double[1 << n];
+	for (int S = 0; S < (1<<n); S ++) tprev[S] = s[S];
+	for (int j = 0; j < n; j ++){
+		
+		sub_fdmt(j, 0, 0, 0, tprev, t, n, k);	
+		tmp = t; t = tprev; tprev = tmp;
+	}
+	if (n % 2 == 0){ for (int T = 0; T < (1<<n); T ++) t[T] = tprev[T];}
+	else{ tmp = t; t = tprev; tprev = tmp;}
+	delete [] tprev;
+}
+
+
+void sub_fdmtLogAddComp(int j, int d, int T, int overlap, double *s, double *t, int n, int k){
+	//cerr<<" T = "<<T<<":"; print_set(cerr, T); 
+	//cerr<<" overlap = "<<overlap<<endl; 
+	if (d < n && overlap <= k){
+		sub_fdmtLogAddComp(j, d+1, T, overlap, s, t, n, k);
+		T |= (1 << d);
+		overlap += (d <= j);
+		sub_fdmtLogAddComp(j, d+1, T, overlap, s, t, n, k); 
+	}
+	else if (d == n){
+		t[T] = s[T];
+		int jinT = ((T >> j) & 1);
+		if (jinT == 0) logAddComp(t[T], s[T + (1 << j)]);
+		if (overlap > k) t[T] = MARK;
+	}
+}
+// Fast downward Möbius transform:
+// t(T) := \sum_{T \subseteq S} s(S).
+void fdmtLogAddComp(double *s, double *t, int n, int k){
+	double *tmp, *tprev = new double[1 << n];
+	for (int S = 0; S < (1<<n); S ++) tprev[S] = s[S];
+	for (int j = 0; j < n; j ++){
+		
+		sub_fdmtLogAddComp(j, 0, 0, 0, tprev, t, n, k);	
+		tmp = t; t = tprev; tprev = tmp;
+	}
+	if (n % 2 == 0){ for (int T = 0; T < (1<<n); T ++) t[T] = tprev[T];}
+	else{ tmp = t; t = tprev; tprev = tmp;}
+	delete [] tprev;
+}
+
+
+void sub_fdmtNoLog(int j, int d, int T, int overlap, double *s, double *t, int n, int k){
+	//cerr<<" T = "<<T<<":"; print_set(cerr, T); 
+	//cerr<<" overlap = "<<overlap<<endl; 
+	if (d < n && overlap <= k){
+		sub_fdmtNoLog(j, d+1, T, overlap, s, t, n, k);
+		T |= (1 << d);
+		overlap += (d <= j);
+		sub_fdmtNoLog(j, d+1, T, overlap, s, t, n, k); 
+	}
+	else if (d == n){
+		t[T] = s[T];
+		int jinT = ((T >> j) & 1);
+		//if (jinT == 0) LOGADD(t[T], s[T + (1 << j)]);
+		//if (jinT == 0) logAdd_New(t[T], s[T + (1 << j)]);
+		if (jinT == 0) t[T] += s[T + (1 << j)];
+		if (overlap > k) t[T] = MARK;
+	}
+}
+
+// Fast downward Möbius transform:
+// t(T) := \sum_{T \subseteq S} s(S).
+void fdmtNoLog(double *s, double *t, int n, int k){
+	double *tmp, *tprev = new double[1 << n];
+	for (int S = 0; S < (1<<n); S ++) tprev[S] = s[S];
+	for (int j = 0; j < n; j ++){
+		
+		sub_fdmtNoLog(j, 0, 0, 0, tprev, t, n, k);	
+		tmp = t; t = tprev; tprev = tmp;
+	}
+	if (n % 2 == 0){ for (int T = 0; T < (1<<n); T ++) t[T] = tprev[T];}
+	else{ tmp = t; t = tprev; tprev = tmp;}
+	delete [] tprev;
+}
+
+
+void test_fdmt(){
+	int n = 4;
+	double t[16], s[16];
+	for (int S = 0; S < 16; S ++){
+		s[S] = log(S+1);
+	}
+	fdmt(s, t, n, 3);
+	for (int T = 0; T < 16; T ++){
+		cerr<<" t["<<T<<"] = "<<exp(t[T])<<endl;
+	}
+}
+
+//----------------
+
+
+
+
+
+
+// NOTE: Engine only calls a veru limited set of interface functions
+// implemented in Model.
+class Engine {
+public:
+	Engine(){}
+	~Engine(){}	
+	
+	void init(Model *m){
+		model = m;
+		//test();
+	
+	}
+	void test(){
+		vector<int> T;
+		T.push_back(1); T.push_back(2);
+		
+		cerr<<" log p(x_0 | x_1,2): "<<model->log_lcp(0, T)<<endl;
+	
+		for (int h = 0; h < model->num_layers(); h ++){
+			int *Vh, *Vu, *Vl;
+			int nh, nu, nl;
+			model->layer(h, &Vh, &nh);	
+			model->upper_layers(h, &Vu, &nu);	
+			model->lower_layers(h, &Vl, &nl);
+			cerr<<"Layer "<<h<<":";
+			cerr<<endl<<" layer: ";
+			print_nodes(cerr, Vh, nh);
+			cerr<<endl<<" upper: ";
+			print_nodes(cerr, Vu, nu);
+			cerr<<endl<<" lower: ";
+			print_nodes(cerr, Vl, nl);
+			cerr<<endl;	
+		}
+		
+		//test_fumt();
+		test_fdmt(); 
+		exit(1);
+
+	}
+	// Computes all edge probabilities.
+	void compute_edge_probabilities(){
+//		int l = model->num_layers();
+	
+		//Arguments::option == 0 means the rebel method with new Dirichlet hyper-param (see sub_beta)
+		if(Arguments::option == 0){
+			compute_edge_probabilities(0);
+		}
+		//Arguments::option == 1 means the forward method
+		else if(Arguments::option == 1){
+			compute_edge_probabilities_forward(0);
+		}
+		//Arguments::option == 2 means the backward method
+		else if(Arguments::option == 2){
+			compute_edge_probabilities_backward(0);
+		}
+		//Arguments::option == 3 means the mix method in the UAI paper
+		else if(Arguments::option == 3){
+			compute_edge_probabilities_mixIndegree(0);
+		 	//compute_edge_probabilities_mixIndegreeNoLog(0);
+		}
+		//Arguments::option == 4 means the computation used in top-k
+		else if(Arguments::option == 4){
+			compute_edge_probabilities_top_k(0);
+		}
+		//Arguments::option == 5 means the computation required for in and out features
+		else if(Arguments::option == 5){
+			//For In_Out features
+			compute_edge_probabilities_in_out_features(0);
+		}
+		
+		
+	}
+	// Computes probabilities for edges pointing to the h-th layer.
+	void compute_edge_probabilities(int h){
+		cerr<<"\nREBEL Method:" << endl;
+		cerr<<" Compute edge probabilities for Layer "<<h<<":"<<endl;
+		
+		// Step 1: Compute beta[][];
+		// Step 2: Compute alpha[][];
+		int *Vh, *Vu; int nh, nu;
+		model->layer(h, &Vh, &nh);
+		model->upper_layers(h-1, &Vu, &nu);
+
+		
+		beta = new double*[nh];
+		alpha = new double*[nh];
+		
+		k = model->max_indegree();
+		
+		cerr<<" . "<<nh<<" nodes"<<endl;
+		
+		struct timeval startTime;
+		struct timeval endTime;
+		struct timezone myTimeZone;
+
+		
+		double betaTime;
+		double alphaTime;
+		double forwardTime;
+		double backwardTime;
+		double gammaTime;
+		
+		double step2BTime;
+	
+		gettimeofday(&startTime, &myTimeZone);		
+
+		//If Arguments::ADtree == 1, user wants to use ADtree, then make the whole tree first
+		if(Arguments::ADtree == 1){
+			model->makeADTree();
+		}
+		
+		for (int j = 0; j < nh; j ++){
+
+			beta[j] = new double[1 << nh];
+			//int i = Vh[j];
+			compute_beta(j, Vh, nh, Vu, nu);
+		
+		}
+		
+		//If Arguments::ADtree == 1, then delete the whole tree
+		if(Arguments::ADtree == 1){
+			model->freeADTree();
+		}
+		
+		gettimeofday(&endTime, &myTimeZone);		
+		betaTime = (endTime.tv_sec - startTime.tv_sec) + 
+		           (endTime.tv_usec - startTime.tv_usec) / 1000000.0 ;
+		           
+		cerr<<" . Tables beta are now ready."<<endl;
+		
+		gettimeofday(&startTime, &myTimeZone);
+		for (int j = 0; j < nh; j ++){
+
+			alpha[j] = new double[1 << nh];	
+			compute_alpha(j, Vh, nh);
+		
+			//cerr<<" . Tables beta and alpha computed for node "<<j<<"."<<endl; 
+		
+		}
+		gettimeofday(&endTime, &myTimeZone);		
+		alphaTime = (endTime.tv_sec - startTime.tv_sec) + 
+		           (endTime.tv_usec - startTime.tv_usec) / 1000000.0 ;
+		
+		cerr<<" . Tables alpha are now ready."<<endl;
+
+			
+		// Step 3: Compute g_forward[];
+		gf = new double[1 << nh];
+		
+		gettimeofday(&startTime, &myTimeZone);
+		
+		compute_g_forward(nh);
+		
+		gettimeofday(&endTime, &myTimeZone);		
+		forwardTime = (endTime.tv_sec - startTime.tv_sec) + 
+		           (endTime.tv_usec - startTime.tv_usec) / 1000000.0 ;
+		
+		//cerr<<" . gf[all] = "<<gf[(1<<nh)-1]<<endl;
+		
+		// Step 4: Compute g_backward[];
+		
+		gb = new double[1 << nh];
+		
+		gettimeofday(&startTime, &myTimeZone);
+		
+		compute_g_backward(nh);
+		
+		gettimeofday(&endTime, &myTimeZone);		
+		backwardTime = (endTime.tv_sec - startTime.tv_sec) + 
+		           (endTime.tv_usec - startTime.tv_usec) / 1000000.0 ;
+		
+		//cerr<<" . gb[all] = "<<gb[(1<<nh)-1]<<endl;
+	
+		// Step 5: Loop over end-point nodes j.
+		
+		gammaTime = 0.0;
+		step2BTime = 0.0;
+		
+		double *gamma = new double[1 << nh];
+		double *gfb = new double[1 << nh];
+		for (int j = 0; j < nh; j ++){
+			// Compute gfb[]. 
+			
+			//start counting gammaTime for each j
+			gettimeofday(&startTime, &myTimeZone);
+			
+			for (int S = 0; S < (1<<nh); S ++){
+				
+				//if j \in the binary repre of S
+				if ((S>>j) & 1){
+					gfb[S] = -MARK;
+				}
+				else{
+					int cS = (1 << nh) - 1 - S - (1 << j);
+					gfb[S] = gf[S] + gb[cS];
+					//cerr<<" j = "<<j<<": ";
+					//print_set(cerr, S);
+					//cerr<<"; ";
+					//print_set(cerr, cS);
+					//cerr<<": "<<gfb[S];
+					//cerr<<endl;
+				}
+			}
+			// Compute gamma_j() := gamma[].
+			fdmt(gfb, gamma, nh, k);
+			
+			gettimeofday(&endTime, &myTimeZone);		
+			gammaTime += (endTime.tv_sec - startTime.tv_sec) + 
+		           (endTime.tv_usec - startTime.tv_usec) / 1000000.0 ;
+			//end counting gammaTime for each j
+			
+			//cerr<<" gamma[0]: "<<gamma[0]<<endl;
+			//cerr<<" gfb[0]: "<<gfb[0]<<endl;
+			
+			cerr<<" . Incoming edges for node "<<j<<":";
+			// Loop over start-point nodes i.
+			
+			//start counting step2BTime for each j
+			gettimeofday(&startTime, &myTimeZone);
+			
+			for (int i = 0; i < nh; i ++){
+				if (i == j) continue;
+				cerr<<" "<<i;		
+				double log_prob = eval_edge(i,  j, gamma, beta[j], nh, k);
+		
+				model->print_edge_prob(
+					cout, Vh[i], Vh[j], exp(log_prob - gb[(1<<nh)-1])); //HR: - gb[(1<<nh)-1] mean /L(v)
+			
+			}
+			gettimeofday(&endTime, &myTimeZone);		
+			step2BTime += (endTime.tv_sec - startTime.tv_sec) + 
+		           (endTime.tv_usec - startTime.tv_usec) / 1000000.0 ;
+			//end counting step2BTime for each j
+			
+			
+			
+			cerr<<endl;
+			
+		} 
+		
+		
+		cout << "\n\n\nTime Statistics" << endl;
+		cout << "betaTime = " << betaTime <<  endl;				
+		cout << "alphaTime = " << alphaTime <<  endl;
+		cout << "forwardTime = " << forwardTime <<  endl;
+		cout << "backwardTime = " << backwardTime <<  endl;				
+		cout << "gammaTime = " << gammaTime <<  endl;
+		
+		cout << "step2BTime = " << step2BTime <<  endl;
+		
+		double totalTime = betaTime + alphaTime + forwardTime 
+						+ backwardTime + gammaTime + step2BTime;
+		cout << "totalTime = " << totalTime <<  endl;
+		
+		/*
+		ofResult << "\n\n\nTime Statistics" << endl;
+		ofResult << "betaTime = " << betaTime <<  endl;				
+		ofResult << "alphaTime = " << alphaTime <<  endl;
+		ofResult << "RRFuncTime = " << RRFuncTime <<  endl;
+		ofResult << "HFuncTime = " << HFuncTime <<  endl;
+		ofResult << "KFuncTime = " << KFuncTime <<  endl;		
+				
+		ofResult << "GammaTime = " << GammaTime <<  endl;
+		ofResult << "step2Time = " << step2Time <<  endl;
+		double totalTime = betaTime + alphaTime + RRFuncTime 
+						+ HFuncTime + KFuncTime + GammaTime + step2Time;
+		ofResult << "totalTime = " << totalTime <<  endl;
+		*/
+		
+		
+		delete [] gamma;
+		delete [] gfb;
+	
+		delete [] gf; delete [] gb;
+		for (int j = 0; j < nh; j ++){
+			delete [] beta[j]; delete [] alpha[j];
+		}
+		delete [] beta; delete [] alpha;
+		cerr<<" Edge probabilities now computed."<<endl; 
+	}
+	
+	
+	void compute_edge_probabilities_ind(int h){
+		cerr<<"\nREBEL Method with each individual edge:" << endl;
+		cerr<<" Compute edge probabilities for Layer "<<h<<":"<<endl;
+				
+		// Step 1: Compute beta[][];
+		// Step 2: Compute alpha[][];
+		int *Vh, *Vu; int nh, nu;
+		model->layer(h, &Vh, &nh);
+		model->upper_layers(h-1, &Vu, &nu);
+				
+		beta = new double*[nh];
+		alpha = new double*[nh];
+		
+		betaNume = new double*[nh];
+		alphaNume = new double*[nh];
+		
+		k = model->max_indegree();
+		
+		cerr<<" . "<<nh<<" nodes"<<endl;
+		
+		for (int j = 0; j < nh; j ++){
+
+			beta[j] = new double[1 << nh];
+
+			//int i = Vh[j];
+			compute_beta(j, Vh, nh, Vu, nu);
+			
+			alpha[j] = new double[1 << nh];	
+			compute_alpha(j, Vh, nh);
+			
+			//alphaNume[j] = new double[1 << nh];	
+			//compute_alphaNume(j, Vh, nh);
+		
+			cerr<<" . Tables beta and alpha computed for node "<<j<<"."<<endl; 
+		
+		}
+	
+	  for(int uu = 0; uu < nh; uu++){
+	   for(int vv = 0; vv < nh; vv++){
+	  	if(vv != uu){
+
+		cerr<<" Compute edge ("<< uu <<"<-" << vv <<")" <<endl;
+
+		for (int j = 0; j < nh; j ++){
+			betaNume[j] = new double[1 << nh];
+			compute_betaNume(j, Vh, nh, Vu, nu, uu, vv);
+			
+			alphaNume[j] = new double[1 << nh];	
+			compute_alphaNume(j, Vh, nh);
+		
+			cerr<<" . Tables betaNume and alphaNume computed for node "<<j<<"."<<endl; 
+		
+		}
+	
+		cerr<<" . Tables beta/betaNume and alpha/alphaNume are now ready."<<endl;
+
+			
+		// Step 3: Compute g_forward[];
+		gf = new double[1 << nh];
+
+		compute_g_forward(nh);
+
+		gfNume = new double[1 << nh];
+		compute_gNume_forward(nh);
+		
+		cerr << "\nalpha" << endl;
+		for (int j = 0; j < nh; j ++){		
+			for(int index=0; index < (1 << nh); index++){
+				cerr<< "alpha[" << j << "][" << index << "] =" <<  alpha[j][index] << endl;
+			}
+		}
+		
+		cerr << "\nalphaNume" << endl;
+		for (int j = 0; j < nh; j ++){		
+			for(int index=0; index < (1 << nh); index++){
+				cerr<< "alphaNume[" << j << "][" << index << "] =" <<  alphaNume[j][index] << endl;
+			}
+		}
+		
+		cerr << "\ngf:" << endl;
+		for(int index = 0; index < (1 << nh); index++){
+			cerr << "gf[" << index << "] = " << gf[index] << endl;
+		}
+		
+		cerr << "\ngfNume:" << endl;
+		for(int index = 0; index < (1 << nh); index++){
+			cerr << "gfNume[" << index << "] = " << gfNume[index] << endl;
+		}
+
+		cerr<<"gf[all] = "<<gf[(1<<nh)-1]<<endl;
+		cerr<<"gfNume[all] = "<<gfNume[(1<<nh)-1]<<endl;
+		
+		//For checking: Compute g_backward[];
+		
+		gb = new double[1 << nh];
+		compute_g_backward(nh);	
+		cerr<<" gb[all] = "<<gb[(1<<nh)-1]<<endl;
+				
+		cerr<<" . Incoming edges from node " << vv << " to node " << uu <<" :";
+		model->print_edge_prob(cout, Vh[vv], Vh[uu], exp(gfNume[(1<<nh)-1] - gf[(1<<nh)-1])); //HR: - gb[(1<<nh)-1] mean /L(v)		
+		cerr<<endl;
+		
+	  	}
+	   }
+	  }
+		
+		delete [] gf; 
+		delete [] gfNume; 
+		for (int j = 0; j < nh; j ++){
+			delete [] beta[j]; 
+			delete [] betaNume[j];
+			delete [] alpha[j];
+			delete [] alphaNume[j];
+		}
+		delete [] beta; 
+		delete [] betaNume; 
+		delete [] alpha;
+		delete [] alphaNume;
+		
+		cerr<<" Edge probabilities now computed."<<endl; 
+		
+		return;
+		
+		
+
+	}
+	
+		
+	//HR: new forward method, compute for each individual edge
+	void compute_edge_probabilities_forward(int h){
+		cerr<<"Forward method: " << endl;
+		cerr<<" Compute edge probabilities for Layer "<<h<<":"<<endl;
+				
+		// Step 1: Compute beta[][];
+		// Step 2: Compute alpha[][];
+		int *Vh, *Vu; int nh, nu;
+		model->layer(h, &Vh, &nh);
+		model->upper_layers(h-1, &Vu, &nu);
+				
+		//If Arguments::ADtree == 1, user wants to use ADtree, then make the whole tree first
+		if(Arguments::ADtree == 1){
+			model->makeADTree();
+		}
+
+	
+		beta = new double*[nh];
+		alpha = new double*[nh];
+		
+		betaNume = new double*[nh];
+		alphaNume = new double*[nh];
+		
+		k = model->max_indegree();
+		
+		cerr<<" . "<<nh<<" nodes"<<endl;
+		
+		for (int j = 0; j < nh; j ++){
+
+			beta[j] = new double[1 << nh];
+					
+			//int i = Vh[j];
+			compute_beta(j, Vh, nh, Vu, nu);
+
+			alpha[j] = new double[1 << nh];	
+			compute_alpha(j, Vh, nh);
+				
+			cerr<<" . Tables beta and alpha computed for node "<<j<<"."<<endl; 
+		
+		}
+		
+		hFunc = new double[1 << nh];
+		compute_h_Fast(nh, hFunc, alpha);
+		cerr<<"hFunc[all] = "<<hFunc[(1<<nh)-1]<<endl;
+
+		
+	    for(int uu = 0; uu < nh; uu++){
+	    	for(int vv = 0; vv < nh; vv++){
+	  			if(vv != uu){
+	  		
+					cerr<<"Compute edge ("<< uu <<"<-" << vv <<")" <<endl;
+	
+					for (int j = 0; j < nh; j ++){
+						betaNume[j] = new double[1 << nh];
+
+						compute_betaNume(j, Vh, nh, Vu, nu, uu, vv);
+			
+						alphaNume[j] = new double[1 << nh];	
+						compute_alphaNume(j, Vh, nh);
+		
+						//cerr<<" . Tables betaNume and alphaNume computed for node "<<j<<"."<<endl; 
+		
+					}
+		
+		
+					cerr<<" . Tables beta/betaNume and alpha/alphaNume are now ready."<<endl;
+
+		
+					hFuncNume = new double[1 << nh];
+					compute_h_Fast(nh, hFuncNume, alphaNume);
+
+					cerr<<"hFunc[all] = "<<hFunc[(1<<nh)-1]<<endl;
+					cerr<<"hFuncNume[all] = "<<hFuncNume[(1<<nh)-1]<<endl;
+				
+					cerr<<" . Incoming edges from node " << vv << " to node " << uu <<" :";
+					model->print_edge_prob(cout, Vh[vv], Vh[uu], exp(hFuncNume[(1<<nh)-1] - hFunc[(1<<nh)-1])); //HR: - gb[(1<<nh)-1] mean /L(v)		
+					cerr<<endl;
+		
+	  			}
+	   		}
+	  	}
+		
+		
+		//If Arguments::ADtree == 1, then delete the whole tree
+		if(Arguments::ADtree == 1){
+			model->freeADTree();
+		}
+		
+		delete [] hFunc; 
+		
+		//it better to move the following line inside the double for loop
+		delete [] hFuncNume; 
+		
+		for (int j = 0; j < nh; j ++){
+			delete [] beta[j]; 
+			delete [] betaNume[j];
+			delete [] alpha[j];
+			delete [] alphaNume[j];
+		}
+		delete [] beta; 
+		delete [] betaNume; 
+		delete [] alpha;
+		delete [] alphaNume;
+		cerr<<" Edge probabilities now computed."<<endl; 
+		
+		return;
+		
+		
+
+	}
+	
+	
+	//HR: new backward method, compute for each individual edge
+	void compute_edge_probabilities_backward(int h){
+		cerr<<"Backward method: " << endl;
+		cerr<<" Compute edge probabilities for Layer "<<h<<":"<<endl;
+				
+		// Step 1: Compute beta[][];
+		// Step 2: Compute alpha[][];
+		int *Vh, *Vu; int nh, nu;
+		model->layer(h, &Vh, &nh);
+		model->upper_layers(h-1, &Vu, &nu);
+		
+		//If Arguments::ADtree == 1, user wants to use ADtree, then make the whole tree first
+		if(Arguments::ADtree == 1){
+			model->makeADTree();
+		}
+	
+		beta = new double*[nh];
+		alpha = new double*[nh];
+		
+		betaNume = new double*[nh];
+		alphaNume = new double*[nh];
+		
+		k = model->max_indegree();
+		
+		cerr<<" . "<<nh<<" nodes"<<endl;
+		
+		for (int j = 0; j < nh; j ++){
+
+			beta[j] = new double[1 << nh];
+
+			compute_beta(j, Vh, nh, Vu, nu);
+
+			alpha[j] = new double[1 << nh];	
+			compute_alpha(j, Vh, nh);
+			
+			cerr<<" . Tables beta and alpha computed for node "<<j<<"."<<endl; 
+		
+		}
+		
+		RRFunc = new double[1 << nh];
+		compute_RR_Fast(nh, RRFunc, alpha);
+		cerr<<"RRFunc[all] = "<<RRFunc[(1<<nh)-1]<<endl;
+		
+					
+		//int uu;
+		//int vv;
+	    //uu = 2;
+		//vv = 1;	
+	    for(int uu = 0; uu < nh; uu++){
+	    	for(int vv = 0; vv < nh; vv++){
+	  			if(vv != uu){
+	  		
+					cerr<<"Compute edge ("<< uu <<"<-" << vv <<")" <<endl;
+	
+					for (int j = 0; j < nh; j ++){
+
+						betaNume[j] = new double[1 << nh];
+						compute_betaNume(j, Vh, nh, Vu, nu, uu, vv);
+			
+						alphaNume[j] = new double[1 << nh];	
+						compute_alphaNume(j, Vh, nh);
+		
+						cerr<<" . Tables betaNume and alphaNume computed for node "<<j<<"."<<endl; 
+		
+					}
+				
+					cerr<<" . Tables beta/betaNume and alpha/alphaNume are now ready."<<endl;
+		
+					RRFuncNume = new double[1 << nh];
+					compute_RR_Fast(nh, RRFuncNume, alphaNume);
+
+					cerr<<"RRFunc[all] = "<<RRFunc[(1<<nh)-1]<<endl;
+					cerr<<"RRFuncNume[all] = "<<RRFuncNume[(1<<nh)-1]<<endl;
+
+					cerr<<" . Incoming edges from node " << vv << " to node " << uu <<" :";
+					model->print_edge_prob(cout, Vh[vv], Vh[uu], exp(RRFuncNume[(1<<nh)-1] - RRFunc[(1<<nh)-1])); //HR: - gb[(1<<nh)-1] mean /L(v)		
+					cerr<<endl;
+		
+	  			}
+	   		}
+	  	}
+		
+		//If Arguments::ADtree == 1, then delete the whole tree
+		if(Arguments::ADtree == 1){
+			model->freeADTree();
+		}
+		
+		delete [] RRFunc;
+		
+		//it better to move the following line inside the double for loop 
+		delete [] RRFuncNume; 
+		
+		for (int j = 0; j < nh; j ++){
+			delete [] beta[j]; 
+			delete [] betaNume[j];
+			delete [] alpha[j];
+			delete [] alphaNume[j];
+		}
+		delete [] beta; 
+		delete [] betaNume; 
+		delete [] alpha;
+		delete [] alphaNume;
+		cerr<<" Edge probabilities now computed."<<endl; 
+		
+		return;
+		
+		
+
+	}
+	
+
+	void compute_edge_probabilities_in_out_features(int h){
+		cerr<<"Backward method for in and out features: " << endl;
+		//cerr<<" Compute poster probabilities for Layer "<<h<<":"<<endl;
+				
+		// Step 1: Compute beta[][];
+		// Step 2: Compute alpha[][];
+		int *Vh, *Vu; int nh, nu;
+		model->layer(h, &Vh, &nh);
+		model->upper_layers(h-1, &Vu, &nu);
+		
+		beta = new double*[nh];
+		alpha = new double*[nh];
+		
+		betaInOut = new double*[nh];
+		alphaInOut = new double*[nh];
+		
+		k = model->max_indegree();
+		
+		cerr<<" . "<<nh<<" nodes"<<endl;
+
+		//If Arguments::ADtree == 1, user wants to use ADtree, then make the whole tree first
+		if(Arguments::ADtree == 1){
+			model->makeADTree();
+		}
+
+		for (int j = 0; j < nh; j ++){
+
+			beta[j] = new double[1 << nh];
+			compute_beta(j, Vh, nh, Vu, nu);			
+
+			alpha[j] = new double[1 << nh];	
+			compute_alpha(j, Vh, nh);
+				
+			cerr<<" . Tables beta and alpha computed for node "<<j<<"."<<endl; 
+		
+		}
+		
+	
+		inFeatureEdges = new int[nh];
+		outFeatureEdges = new int[nh];	
+		//cerr << "call: getInOutFeatures(" << nh << ")" << endl;	
+		getInOutFeatures(nh);		
+		//cerr << "return: getInOutFeatures()"  << endl;
+		
+//		for(int i = 0; i < nh; i++){
+//			cerr << "inFeatureEdges[" << i << "] = " << inFeatureEdges[i] << endl;
+//		}
+//		for(int i = 0; i < nh; i++){
+//			cerr << "outFeatureEdges[" << i << "] = " << outFeatureEdges[i] << endl;
+//		}
+		
+		for (int j = 0; j < nh; j ++){
+			//cerr<<"\nj = " << j << endl;
+			betaInOut[j] = new double[1 << nh];
+			compute_betaInOut(j, Vh, nh, Vu, nu);
+
+			alphaInOut[j] = new double[1 << nh];			
+			compute_alphaInOut(j, Vh, nh);
+
+			cerr<<" . Tables betaInOut and alphaInOut computed for node "<<j<<"."<<endl; 
+
+		}
+				
+		cerr<<" Tables beta/betaInOut and alpha/alphaInOut are now ready."<<endl;
+
+		cerr << " Compute the postier probability for the specified In-Out features:" << endl;
+		RRFunc = new double[1 << nh];
+		compute_RR_Fast(nh, RRFunc, alpha);
+		//compute_h_Fast(nh, RRFunc, alpha); //To confirm that the result is the same for forward and backward
+
+		RRFuncInOut = new double[1 << nh];
+		compute_RR_Fast(nh, RRFuncInOut, alphaInOut);
+		//compute_h_Fast(nh, RRFuncInOut, alphaInOut); //To confirm that the result is the same for forward and backward
+
+		cerr<<"RRFunc[all] = "<<RRFunc[(1<<nh)-1]<<endl;
+		cerr<<"RRFuncInOut[all] = "<<RRFuncInOut[(1<<nh)-1]<<endl;
+
+		//cerr<<" . Incoming edges from node " << vv << " to node " << uu <<" :";
+		//model->print_edge_prob(cout, Vh[vv], Vh[uu], exp(RRFuncNume[(1<<nh)-1] - RRFunc[(1<<nh)-1])); //HR: - gb[(1<<nh)-1] mean /L(v)
+		cerr << "\nThe postier probability for the specified In-Out features: " <<  exp(RRFuncInOut[(1<<nh)-1] - RRFunc[(1<<nh)-1]);		
+		cerr<<endl;
+		
+		cout << "The postier probability for the specified In-Out features: " <<  exp(RRFuncInOut[(1<<nh)-1] - RRFunc[(1<<nh)-1]);		
+		cout<<endl;
+		
+		//If Arguments::ADtree == 1, then delete the whole tree
+		if(Arguments::ADtree == 1){
+			model->freeADTree();
+		}
+		
+		delete [] RRFunc; 
+		delete [] RRFuncInOut; 
+	
+		
+		delete [] inFeatureEdges;
+		delete [] outFeatureEdges;	
+		
+		for (int j = 0; j < nh; j ++){
+			delete [] beta[j]; 
+			delete [] betaInOut[j];
+			delete [] alpha[j];
+			delete [] alphaInOut[j];
+		}
+		delete [] beta; 
+		delete [] betaInOut; 
+		delete [] alpha;
+		delete [] alphaInOut;
+		cerr<<" Poster probabilities now computed."<<endl; 
+		
+		return;
+		
+		
+	}
+
+
+	void compute_edge_probabilities_top_k(int h){
+		cerr<<"For top-k: compute p(D): " << endl;
+		cerr<<" Compute edge probabilities for Layer "<<h<<":"<<endl;		
+		
+		// Step 1: Compute beta[][];
+		// Step 2: Compute alpha[][];
+		int *Vh, *Vu; int nh, nu;
+		model->layer(h, &Vh, &nh);
+		model->upper_layers(h-1, &Vu, &nu);
+		
+		
+		beta = new double*[nh];
+		alpha = new double*[nh];
+		
+		//betaNume = new double*[nh];
+		//alphaNume = new double*[nh];
+		
+		k = model->max_indegree();
+		
+		cerr<<" . "<<nh<<" nodes"<<endl;
+		
+		//If Arguments::ADtree == 1, user wants to use ADtree, then make the whole tree first
+		if(Arguments::ADtree == 1){
+			model->makeADTree();
+		}
+
+		for (int j = 0; j < nh; j ++){
+
+			beta[j] = new double[1 << nh];
+		
+			//cerr<<" Start compute_beta for node "<<j<<"."<<endl;
+			compute_beta(j, Vh, nh, Vu, nu);
+			//cerr<<" Tables beta computed for node "<<j<<"."<<endl;
+
+			alpha[j] = new double[1 << nh];	
+			compute_alpha(j, Vh, nh);
+				
+			cerr<<" . Tables beta and alpha computed for node "<<j<<"."<<endl; 
+		
+		}
+
+		//If Arguments::ADtree == 1, then delete the whole tree
+		if(Arguments::ADtree == 1){
+			model->freeADTree();
+		}
+			
+		RRFunc = new double[1 << nh];
+		
+		cerr<<"\n Compute_RR_Fast(): "<<endl;		
+		compute_RR_Fast(nh, RRFunc, alpha);
+		cerr<<"\n RRFunc[all] = "<<RRFunc[(1<<nh)-1]<<endl <<endl;
+		cout<<"\n RRFunc[all] = "<<RRFunc[(1<<nh)-1]<<endl <<endl;
+
+		fprintf(stderr, "RRFunc[all] = %18.8f\n", RRFunc[(1<<nh)-1]);
+		
+		//write to 
+		FILE * fp_PD = fopen("exactPD.txt", "a");
+		if(fp_PD){
+			fprintf(fp_PD, "%18.8f\n", RRFunc[(1<<nh)-1]);
+			fclose(fp_PD);
+			
+		}
+		else{
+			cerr <<"fopen exactPD.txt fails" << endl;
+			
+		}
+		
+	
+		delete [] RRFunc; 
+		//delete [] RRFuncNume; 
+		
+		for (int j = 0; j < nh; j ++){
+			delete [] beta[j]; 
+			//delete [] betaNume[j];
+			delete [] alpha[j];
+			//delete [] alphaNume[j];
+		}
+		delete [] beta; 
+		//delete [] betaNume; 
+		delete [] alpha;
+		//delete [] alphaNume;
+		//cerr<<" Edge probabilities now computed."<<endl; 
+		
+		return;
+
+	}
+
+		
+	//HR: new mix with max in-degree method, 
+	void compute_edge_probabilities_mixIndegree(int h){
+		cerr<<" Mix with max in-degree method: " << endl;
+		//cerr<<" Compute edge probabilities for Layer "<<h<<":"<<endl;
+				
+		// Step 1: Compute beta[][];
+		// Step 2: Compute alpha[][];
+		int *Vh, *Vu; int nh, nu;
+		model->layer(h, &Vh, &nh);
+		model->upper_layers(h-1, &Vu, &nu);
+		
+		//Step 1(a) (b)
+		
+		beta = new double*[nh];
+		alpha = new double*[nh];
+		
+		k = model->max_indegree();
+		
+		cerr<<" . "<<nh<<" nodes"<<endl;
+		
+		struct timeval startTime;
+		struct timeval endTime;
+		struct timezone myTimeZone;
+		
+		double betaTime;
+		double alphaTime;
+		double RRFuncTime;
+		double HFuncTime;
+		double KFuncTime;
+		double GammaTime;
+		
+		double step2Time;
+		
+		
+		//Step 1(a)
+
+		gettimeofday(&startTime, &myTimeZone);
+		
+		//If Arguments::ADtree == 1, user wants to use ADtree, then make the whole tree first
+		if(Arguments::ADtree == 1){
+			//cout << "Arguments::ADtree == 1"  << endl;
+			model->makeADTree();
+		}
+		else{
+			//cout << "Arguments::ADtree == 0"  << endl;
+		}
+
+		for (int j = 0; j < nh; j ++){
+			beta[j] = new double[1 << nh];
+					
+			//int i = Vh[j];
+			compute_beta(j, Vh, nh, Vu, nu);
+
+			//cerr<<" . Tables beta and alpha computed for node "<<j<<"."<<endl; 
+		
+		}
+		
+		//If Arguments::ADtree == 1, then delete the whole tree
+		if(Arguments::ADtree == 1){
+			model->freeADTree();
+		}
+		
+		gettimeofday(&endTime, &myTimeZone);		
+		betaTime = (endTime.tv_sec - startTime.tv_sec) + 
+		           (endTime.tv_usec - startTime.tv_usec) / 1000000.0 ;
+				
+		cerr<<" . Tables beta have been computed" << endl;
+
+
+		//HR: Add for Top-k inside void compute_edge_probabilities_mixIndegree(int h)
+		//HR: Use the Poster tool to compute the local scores for all the families of each variable (without max-indegree
+		//	restriction). So for each of n variables, there are 2^(n-1) family scores.
+		write_family_scores_to_files(nh);
+		
+
+		//step 1(b)
+		gettimeofday(&startTime, &myTimeZone);
+		for (int j = 0; j < nh; j ++){
+
+			alpha[j] = new double[1 << nh];	
+			compute_alpha(j, Vh, nh);
+			
+			//cerr<<" . Tables beta and alpha computed for node "<<j<<"."<<endl; 
+		
+		}
+		gettimeofday(&endTime, &myTimeZone);
+		alphaTime = (endTime.tv_sec - startTime.tv_sec) + 
+		           (endTime.tv_usec - startTime.tv_usec) / 1000000.0 ;
+		
+		
+		cerr<<" . Tables alpha has been computed" << endl;
+		
+
+		//Step 1(c)
+		//HR: backward method to compute: for all S \subset V RR(S)
+		RRFunc = new double[1 << nh];
+		
+		cerr<<" . To compute Table RR" << endl;
+		
+		gettimeofday(&startTime, &myTimeZone);
+		
+		compute_RR_Fast(nh, RRFunc, alpha);
+		//compute_RR_Iter(nh, RRFunc, alpha);
+		
+		gettimeofday(&endTime, &myTimeZone);		
+		RRFuncTime = (endTime.tv_sec - startTime.tv_sec) + 
+		           (endTime.tv_usec - startTime.tv_usec) / 1000000.0 ;
+		
+		//cerr<<"RRFunc[all] = "<<RRFunc[(1<<nh)-1]<<endl;
+		//fprintf(stderr, "RRFunc[all] = %18.8f\n", RRFunc[(1<<nh)-1]);
+		cerr<<" . Table RR computed." <<endl;
+
+
+		//HR: merge the function of opt 4 into here.
+		//write to exactPD.txt
+		//string directory_name = "./family_scores";
+		string str;
+		str.assign(Arguments::directoryName);
+		str.append("/");
+		str.append("exactPD.txt");
+
+		//FILE * fp_PD = fopen(str.c_str(), "a");
+		FILE * fp_PD = fopen(str.c_str(), "w");
+		if(fp_PD){
+			fprintf(fp_PD, "%18.8f\n", RRFunc[(1<<nh)-1]);
+			fclose(fp_PD);
+
+		}
+		else{
+			cerr <<"fopen exactPD.txt fails" << endl;
+
+		}
+		
+
+		//Step 1(d)
+		//HR: forward method to compute: for all S \subset V H(S)
+		
+		hFunc = new double[1 << nh];
+		
+		cerr<<" . To compute Table H" << endl;
+		
+		gettimeofday(&startTime, &myTimeZone);
+
+		compute_h_Fast(nh, hFunc, alpha);	
+		//compute_h_Iter(nh, hFunc, alpha);	
+		
+		gettimeofday(&endTime, &myTimeZone);
+		HFuncTime = (endTime.tv_sec - startTime.tv_sec) + 
+		           (endTime.tv_usec - startTime.tv_usec) / 1000000.0 ;
+		
+		
+		//cerr<<"hFunc[all] = "<<hFunc[(1<<nh)-1]<<endl;
+		//fprintf(stderr, "hFunc[all] = %18.8f\n", hFunc[(1<<nh)-1]);
+		cerr<<" . Table H computed" <<endl;
+
+			
+		//Step 1 (e)
+		KFunc = new double*[nh]; 
+		cerr<<" . To compute Table K" << endl; 
+		
+		gettimeofday(&startTime, &myTimeZone);
+		for(int i = 0; i < nh; i++){
+			//cerr<<" For v = " << i << endl;
+			KFunc[i] = new double [1<<nh];
+			compute_all_K_v(nh, KFunc[i], i, alpha);
+			
+		}
+		
+		gettimeofday(&endTime, &myTimeZone);	
+		KFuncTime = (endTime.tv_sec - startTime.tv_sec) + 
+		           (endTime.tv_usec - startTime.tv_usec) / 1000000.0 ;
+		
+		           
+		cerr<<" . Table K computed" <<endl;
+		
+	
+		// Step 1 (f): For all i \in V, for all Pa_i \subset V - {i} with |Pa_i| <= k, compute Gamma_i(Pa_i)
+		
+		double * Gamma = new double[1 << nh];
+		double * Gfb = new double[1 << nh];
+
+		GammaTime = 0.0;
+		step2Time = 0.0;
+
+		for (int v = 0; v < nh; v++){
+			//cerr<<" For v = " << v <<": " << endl;
+			
+			//start counting the GammaTime for each v
+			gettimeofday(&startTime, &myTimeZone);
+			
+			// Compute Gfb[]. 
+			for (int U = 0; U < (1<<nh); U++){				
+				//if v \in the binary repre of U
+				if ((U>>v) & 1){
+					Gfb[U] = LOG_ZERO;
+				}
+				else{
+
+					//Gfb[U] = hFunc[U] + KFunc[v][U];
+					if(KFunc[v][U] == LOG_ZERO){
+						Gfb[U] = LOG_ZERO;
+					}
+					//note that KFunc[v][U] == 0 is possible
+					else if(KFunc[v][U] <= 0){
+						Gfb[U] = hFunc[U] + KFunc[v][U];
+					}
+					else{
+						//Now if Gfb[U] > 0, then Gfb[U]
+				
+						Gfb[U] = -(hFunc[U] - KFunc[v][U]);
+					}
+				
+					//cerr<<" j = "<<j<<": ";
+					//print_set(cerr, S);
+					//cerr<<"; ";
+					//print_set(cerr, cS);
+					//cerr<<": "<<gfb[S];
+					//cerr<<endl;
+				}
+			}
+						
+			//cerr<< "Table Gfb has been computed" << endl;
+					
+			// Compute gamma_j() := gamma[].
+						
+			fdmtLogAddComp(Gfb, Gamma, nh, k);
+			
+			gettimeofday(&endTime, &myTimeZone);
+			 //end counting GammaTime for each v
+			GammaTime += (endTime.tv_sec - startTime.tv_sec) + 
+		           (endTime.tv_usec - startTime.tv_usec) / 1000000.0 ;
+		           
+			
+			//cerr<< "Table Gamma has been computed" << endl;
+						
+			//cerr<< " Gfb[0]: " <<Gfb[0]<<endl;
+			//cerr<< " Gamma[0]: " << Gamma[0]<<endl;
+			
+			
+			//Step 2
+			//cerr<<" . Incoming edges for node "<< v <<":";
+			// Loop over start-point nodes i.
+			
+			//start counting step2Time for each v
+			gettimeofday(&startTime, &myTimeZone);
+
+			for (int i = 0; i < nh; i++){
+				if (i == v) continue;
+				//cerr<<" "<< i;		
+				double log_prob_nume = eval_edge_mixIndegree(i,  v, Gamma, beta[v], nh, k);
+		
+				model->print_edge_prob(
+					cout, Vh[i], Vh[v], exp(log_prob_nume - RRFunc[(1<<nh)-1])); //HR: - gb[(1<<nh)-1] mean /L(v)
+							
+			}
+			
+
+			gettimeofday(&endTime, &myTimeZone);
+			//end counting step2Time for each v	
+			step2Time += (endTime.tv_sec - startTime.tv_sec) + 
+		           (endTime.tv_usec - startTime.tv_usec) / 1000000.0 ;
+		    	
+			//cerr<<endl;
+			
+		} 
+		
+		
+//		cout << "\n\n\nTime Statistics" << endl;
+//		cout << "betaTime = " << betaTime <<  endl;				
+//		cout << "alphaTime = " << alphaTime <<  endl;
+//		cout << "RRFuncTime = " << RRFuncTime <<  endl;
+//		cout << "HFuncTime = " << HFuncTime <<  endl;
+//		cout << "KFuncTime = " << KFuncTime <<  endl;		
+//				
+//		cout << "GammaTime = " << GammaTime <<  endl;
+//		cout << "step2Time = " << step2Time <<  endl;
+//		double totalTime = betaTime + alphaTime + RRFuncTime 
+//						+ HFuncTime + KFuncTime + GammaTime + step2Time;
+//		cout << "totalTime = " << totalTime <<  endl;
+				
+		
+		delete [] Gamma;
+		delete [] Gfb;
+
+		delete [] hFunc;
+		
+		delete [] RRFunc; 
+		
+		delete [] Eta_U;
+		
+		for (int j = 0; j < nh; j ++){
+			delete [] beta[j]; 
+			delete [] alpha[j];
+
+			delete [] KFunc[j]; 
+		
+		}
+		delete [] beta; 
+		delete [] alpha;
+
+		delete [] KFunc;
+		
+		
+		cerr<<" Edge probabilities now computed."<<endl; 
+		
+		return;
+
+	}
+	//HR: end mixIndegree
+	
+	
+	void compute_edge_probabilities_mixIndegreeNoLog(int h){
+		cerr<<"Mix with max in-degree method: " << endl;
+		cerr<<" Compute edge probabilities for Layer "<<h<<":"<<endl;
+		
+		
+		// Step 1: Compute beta[][];
+		// Step 2: Compute alpha[][];
+		int *Vh, *Vu; int nh, nu;
+		model->layer(h, &Vh, &nh);
+		model->upper_layers(h-1, &Vu, &nu);
+		
+		//Step 1(a) (b)
+		
+		beta = new double*[nh];
+		alpha = new double*[nh];
+		
+		k = model->max_indegree();
+		
+		cerr<<" . "<<nh<<" nodes"<<endl;
+
+		for (int j = 0; j < nh; j ++){
+
+			beta[j] = new double[1 << nh];
+					
+			//int i = Vh[j];
+			compute_beta(j, Vh, nh, Vu, nu);
+
+			alpha[j] = new double[1 << nh];	
+			compute_alpha(j, Vh, nh);
+				
+			cerr<<" . Tables beta and alpha computed for node "<<j<<"."<<endl; 
+		
+		}
+		
+		
+		//Step 1(c)
+		//HR: backward method to compute: for all S \subset V RR(S)
+		RRFunc = new double[1 << nh];
+		
+		cerr<<" . To compute Table RR" << endl;
+		
+		compute_RR_Fast(nh, RRFunc, alpha);
+		
+		cerr<<" . Table RR computed." <<endl;
+		
+		
+		//Step 1(d)
+		//HR: forward method to compute: for all S \subset V H(S)
+		
+		hFunc = new double[1 << nh];
+		
+		cerr<<" . To compute Table H" << endl;
+		
+		compute_h_Fast(nh, hFunc, alpha);	
+		
+		cerr<<" . Table H computed" <<endl;
+
+			
+		//Step 1 (e)
+		KFunc = new double*[nh]; 
+		cerr<<" . To compute Table K" << endl; 
+		for(int i = 0; i < nh; i++){
+			cerr<<" For v = " << i << endl;
+			KFunc[i] = new double [1<<nh];
+			compute_all_K_v(nh, KFunc[i], i, alpha);
+			
+		}
+		cerr<<" . Table K computed" <<endl;		
+		
+		// Step 2: Loop over end-point nodes v \in V
+		
+		//No Log transformation
+		double * Gamma = new double[1 << nh];
+		double * Gfb = new double[1 << nh];
+		ofstream ofNoLog("debugEngineNoLog.txt");
+		
+		for (int v = 0; v < nh; v++){
+			cerr<<" For v = " << v <<": " << endl;
+			// Compute Gfb[]. 
+			for (int U = 0; U < (1<<nh); U++){				
+				//if v \in the binary repre of U
+				if ((U>>v) & 1){
+					//Gfb[U] = LOG_ZERO;
+					//Gfb[U] = 0;
+					Gfb[U] = LOG_ZERO;//
+				}
+				else{
+					//Gfb[U] = hFunc[U] + KFunc[v][U];
+					
+					if(KFunc[v][U] == LOG_ZERO){
+						Gfb[U] = exp(hFunc[U]);
+					}
+					else if (KFunc[v][U] > 0){
+						Gfb[U] = - exp(hFunc[U] - KFunc[v][U]);
+						
+					}
+					else{
+						Gfb[U] = exp(hFunc[U] + KFunc[v][U]);
+					}
+					//
+					if(Gfb[U] == 0){
+						Gfb[U] = LOG_ZERO;
+					}
+					else{
+						Gfb[U] = log(Gfb[U]);
+					}
+					//
+										
+					//cerr<<" j = "<<j<<": ";
+					//print_set(cerr, S);
+					//cerr<<"; ";
+					//print_set(cerr, cS);
+					//cerr<<": "<<gfb[S];
+					//cerr<<endl;
+				}
+			}
+			cerr<< "Table Gfb has been computed" << endl;
+					
+			ofNoLog <<"For v = " << v <<": " << endl;
+			ofNoLog << "\nGfb: " << endl;
+			for(int index = 0; index < (1 << nh); index++){
+				ofNoLog << "Gfb[" << index << " ] =" << Gfb[index] << endl;
+			}
+			ofNoLog << endl;
+			
+			
+			// Compute gamma_j() := gamma[].
+			//fdmtNoLog(Gfb, Gamma, nh, k);
+			fdmt(Gfb, Gamma, nh, k);
+			
+			cerr<< "Table Gamma has been computed" << endl;
+			
+			cerr<< " Gamma[0]: " << Gamma[0]<<endl;
+			cerr<< " Gfb[0]: " <<Gfb[0]<<endl;
+			
+			cerr<<" . Incoming edges for node "<< v <<":";
+			// Loop over start-point nodes i.
+			for (int i = 0; i < nh; i++){
+				if (i == v) continue;
+				cerr<<" "<< i;		
+				double log_prob_nume = eval_edge_mixIndegree(i,  v, Gamma, beta[v], nh, k);
+		
+				model->print_edge_prob(
+					cout, Vh[i], Vh[v], exp(log_prob_nume - RRFunc[(1<<nh)-1])); //HR: - gb[(1<<nh)-1] mean /L(v)
+			
+			}
+			cerr<<endl;
+			
+		} 
+	
+		delete [] Gamma;
+		delete [] Gfb;
+
+		delete [] hFunc;
+		
+		delete [] RRFunc; 
+		
+		delete [] Eta_U;
+		
+		for (int j = 0; j < nh; j ++){
+			delete [] beta[j]; 
+			delete [] alpha[j];
+
+			delete [] KFunc[j]; 
+		
+		}
+		delete [] beta; 
+		delete [] alpha;
+
+		delete [] KFunc;
+				
+		cerr<<" Edge probabilities now computed."<<endl; 
+		
+		return;
+
+	}
+	
+	//HR: end mixIndegreeNoLog
+	
+	
+	// beta[j][T] := sum_W gamma[j][T \cup W] .
+	void compute_beta(int j, int *Vh, int nh, int *Vu, int nu){
+		//cerr<<"Compute beta, j = "<<j<<", i = "<< Vh[j];
+		//cerr<<", k = "<<k<<", nh = "<<nh<<":"<<endl;
+		
+		sub_init(0, 0, beta[j], MARK, 0, nh);
+
+		//cerr<<" Initialization done."<<endl;
+		
+		int *S = new int[k];		
+		sub_beta(-1, nh, beta[j], 0, S, Vh[j], Vu, nu, 0);
+		delete [] S;
+				
+	}// end void compute_beta()
+	
+	
+	// beta[j][T] := sum_W gamma[j][T \cup W] .
+	void compute_betaNume(int j, int *Vh, int nh, int *Vu, int nu, int uu, int vv){
+		//cerr<<"Compute betaNume, j = "<<j<<", i = "<< Vh[j];
+		
+		sub_init(0, 0, betaNume[j], MARK, 0, nh);
+		
+		//cerr<<" Initialization done."<<endl;
+
+		int *S = new int[k];
+		
+		//check whether uu == j
+		if(uu != j){
+			sub_beta(-1, nh, betaNume[j], 0, S, Vh[j], Vu, nu, 0);
+		}
+		else{
+			//cerr << "uu == j == " << uu << ": so call sub_betaNume()" << endl;
+			sub_betaNume(-1, nh, betaNume[j], 0, S, Vh[j], Vu, nu, 0, uu, vv);
+		}
+		
+		
+		
+		delete [] S;
+	}
+	
+	
+	void compute_betaInOut(int j, int *Vh, int nh, int *Vu, int nu){
+
+		//cerr << "call: sub_init(0, 0, betaInOut[j], MARK, 0, nh)" << endl;
+		sub_init(0, 0, betaInOut[j], MARK, 0, nh);
+		//cerr << "return: sub_init(0, 0, betaInOut[j], MARK, 0, nh)" << endl;
+
+		//cerr<<" Initialization done."<<endl;
+
+		int *S = new int[k];
+		
+		//cerr << "call: sub_betaInOut()" << endl;
+		
+		sub_betaInOut(-1, nh, betaInOut[j], 0, S, Vh[j], Vu, nu, 0);
+		//sub_beta(-1, nh, betaInOut[j], 0, S, Vh[j], Vu, nu, 0);
+		
+		//cerr << "return: sub_betaInOut()" << endl;
+
+		delete [] S;
+	
+	}//end of compute_betaInOut()
+	
+	
+
+	void sub_beta(int jprev, int nh, double *b, int d, int *S, int i, int *Vu, int nu, int T){
+		//cerr<<" S:"; print_nodes(cerr, S, d); 
+		//cerr<<"; T:"; print_nodes(cerr, T, Vu, nu); cerr<<endl;
+		
+		
+		double lb;	
+		if(Arguments::option < 1){
+		
+			//HR: for old prior for q(G_i)and new Dirichlet hyper-param
+			//used to compare rebel and out method		
+
+			//lb = model->log_prior(i, S, d) + model->log_lcpHR(i, S, d);
+			if(Arguments::ADtree == 0){
+				lb = model->log_prior(i, S, d) + model->log_lcpHR(i, S, d);
+			}
+			else{
+				lb = model->log_prior(i, S, d) + model->log_lcpHR_ADtree(i, S, d);
+			}
+		}
+		else if(Arguments::option >= 1) {					
+
+			//lb = 0 + model->log_lcpHR(i, S, d);
+			if(Arguments::ADtree == 0){
+				lb = 0 + model->log_lcpHR(i, S, d);
+			}
+			else{
+				lb = 0 + model->log_lcpHR_ADtree(i, S, d);
+			}
+		}
+
+		//LOGADD(b[T], lb);
+		logAdd_New(b[T], lb);
+		//
+		
+		if (d < k){
+			for (int j = jprev + 1; j < nu; j ++){	
+				if (Vu[j] != i){
+					S[d] = Vu[j];
+					
+					if (j < nh) {
+						sub_beta(j, nh, b, d+1, S, i, Vu, nu, T | (1 << j));
+					}
+					
+					else{
+						sub_beta(j, nh, b, d+1, S, i, Vu, nu, T);
+					}
+				}
+			}
+		}	
+	}
+	
+	                
+	void sub_betaNume(int jprev, int nh, double *b, int d, int *S, int i, int *Vu, int nu, int T, int uu, int vv){
+		//cerr<<" S:"; print_nodes(cerr, S, d); 
+		//cerr<<"; T:"; print_nodes(cerr, T, Vu, nu); cerr<<endl;
+		int vvInS = 0;
+	
+		for(int ind = 0; ind < d; ind++){
+			if(vv == S[ind]){
+				vvInS = 1;
+				break;
+			}
+		}
+		
+		if(vvInS == 1){
+			double lb;
+			if(Arguments::option < 1){
+				
+				//HR: for old prior for q(G_i)and new Dirichlet hyper-param
+				//used to compare rebel and out method
+
+				//lb = model->log_prior(i, S, d) + model->log_lcpHR(i, S, d);
+				if(Arguments::ADtree == 0){
+					lb = model->log_prior(i, S, d) + model->log_lcpHR(i, S, d);
+				}
+				else{
+					lb = model->log_prior(i, S, d) + model->log_lcpHR_ADtree(i, S, d);
+				}
+			}
+			else if(Arguments::option >= 1) {					
+				//HR: for 1 prior for q(G_i) and new Dirichlet hyper-param
+				//lb = 0 + model->log_lcpHR(i, S, d);
+				if(Arguments::ADtree == 0){
+					lb = 0 + model->log_lcpHR(i, S, d);
+				}
+				else{
+					lb = 0 + model->log_lcpHR_ADtree(i, S, d);
+				}
+				
+			}
+		
+			//double lb = model->log_prior(i, S, d) + model->log_lcp(i, S, d);
+			//double lb = 0 + model->log_lcpHR(i, S, d);
+
+			//LOGADD(b[T], lb);
+			logAdd_New(b[T], lb);
+		}
+		else{
+			//how to set? 0-no, MARK-no; log(0) = -inf = LOG_ZERO
+			//LOGADD(b[T], LOG_ZERO);
+			double tempLogB = LOG_ZERO;
+			logAdd_New(b[T], tempLogB);
+		}
+		
+
+		
+		if (d < k){
+			for (int j = jprev + 1; j < nu; j ++){	
+				if (Vu[j] != i){
+					S[d] = Vu[j];
+					
+					if (j < nh) {
+						sub_betaNume(j, nh, b, d+1, S, i, Vu, nu, T | (1 << j), uu, vv);
+					}
+					
+					else{
+						sub_betaNume(j, nh, b, d+1, S, i, Vu, nu, T, uu, vv);
+					}
+				}
+			}
+		}		
+	}
+	
+	
+
+	void getInOutFeatures(int no_vars){
+	
+		for(int i = 0; i < no_vars; i++){
+			inFeatureEdges[i] = 0;
+		}
+		for(int i = 0; i < no_vars; i++){
+			outFeatureEdges[i] = 0;
+		}
+			
+		FILE * fpIn = fopen(Arguments::inFeasFileName, "r");
+	
+		int fromNode;
+		int toNode;
+		//char c;
+		//int i=0;
+		while(!feof(fpIn)){
+			
+			fromNode = -1;
+			toNode = -1;
+			//c = -1;
+			
+			fscanf(fpIn,"%d->%d\n",&fromNode, &toNode);
+			
+			//cout << "fromNode = "<< fromNode << endl;
+			//cout << "toNode = "<< toNode << endl;
+	
+			//To guard against toNode == -1
+			if(toNode == -1){
+				break;
+			}
+			else{
+				inFeatureEdges[toNode] += (1 << fromNode);
+			}
+
+		}
+		
+		fclose(fpIn);
+		
+//		for(int i = 0; i < no_vars; i++){
+//			cout << "inFeatureEdges[" << i << "] " << inFeatureEdges[i] << endl; 
+//		}
+
+		
+		FILE *fp2 = fopen(Arguments::outFeasFileName, "r");
+
+		while(!feof(fp2)){
+
+			fromNode = -1;
+			toNode = -1;
+			
+			fscanf(fp2,"%d->%d\n",&fromNode, &toNode);
+			
+			//cout << "fromNode = "<< fromNode << endl;
+			//cout << "toNode = "<< toNode << endl;
+	
+			if(toNode == -1){
+				break;
+			}
+			else{
+				outFeatureEdges[toNode] += (1 << fromNode);
+			}
+			
+		
+		}
+		fclose(fp2);
+	
+//		for(int i = 0; i < no_vars; i++){
+//			cout << "outFeatureEdges[" << i << "] " << outFeatureEdges[i] << endl; 
+//		}
+
+	} //end of getInOutFeatures
+	
+	
+	void sub_betaInOut(int jprev, int nh, double *b, int d, int *S, int i, int *Vu, int nu, int T){
+//		cerr<< "Start sub_betaInOut()" << endl;
+//		cerr<<" S:"; print_nodes(cerr, S, d); 
+//		cerr<<" T: " << T << endl;
+//		cerr<<" d: " << d << endl;
+		//cerr<<"; T:"; print_nodes(cerr, T, Vu, nu); cerr<<endl;
+				
+		int compBetaNeeded = 0;
+		
+		//cerr << "inFeatureEdges[" << i << "] = " << inFeatureEdges[i] << endl;
+		//cerr << "outFeatureEdges[" << i << "] = " << outFeatureEdges[i] << endl;
+		
+		//if (each of inFeatureEdges[i] is in T ) && (none of outFeatureEdges[i] is in T )
+		if(((inFeatureEdges[i] & T) == inFeatureEdges[i]) && ((outFeatureEdges[i] & T) == 0) ){
+			compBetaNeeded = 1;		
+			//cerr << "inFeatureEdges[" << i << "] = " << inFeatureEdges[i] << endl;
+			//cerr << "outFeatureEdges[" << i << "] = " << outFeatureEdges[i] << endl;
+			//cerr << "T = " << T << endl;
+			//cerr<<" compBetaNeeded = 1;" << endl;
+			
+		}
+		
+		if(compBetaNeeded == 1){
+			double lb;
+			//Arguments::option must be 5
+			if(Arguments::option < 1){
+				
+				//HR: for old prior for q(G_i)and new Dirichlet hyper-param
+				//used to compare rebel and out method
+				//lb = model->log_prior(i, S, d) + model->log_lcpHR(i, S, d);
+				if(Arguments::ADtree == 0){
+					lb = model->log_prior(i, S, d) + model->log_lcpHR(i, S, d);
+				}
+				else{
+					lb = model->log_prior(i, S, d) + model->log_lcpHR_ADtree(i, S, d);
+				}
+			}
+			else if(Arguments::option >= 1) {					
+				//HR: for 1 prior for q(G_i) and new Dirichlet hyper-param
+				//cerr << "start: double lb = 0 + model->log_lcpHR(i, S, d)" << endl;
+				//lb = 0 + model->log_lcpHR(i, S, d);
+				if(Arguments::ADtree == 0){
+					lb = 0 + model->log_lcpHR(i, S, d);
+				}
+				else{
+					lb = 0 + model->log_lcpHR_ADtree(i, S, d);
+				}
+				//cerr << "end: double lb = 0 + model->log_lcpHR(i, S, d)" << endl;
+			}
+			
+		
+			//LOGADD(b[T], lb);
+			logAdd_New(b[T], lb);
+		}
+		else{
+			//LOGADD(b[T], LOG_ZERO);
+			double tempLogB = LOG_ZERO;
+			logAdd_New(b[T], tempLogB);
+		}
+
+		if (d < k){
+			for (int j = jprev + 1; j < nu; j ++){	
+				if (Vu[j] != i){
+					S[d] = Vu[j];
+					
+					if (j < nh) {						
+						sub_betaInOut(j, nh, b, d+1, S, i, Vu, nu, T | (1 << j));
+					}
+					
+					else{
+						sub_betaInOut(j, nh, b, d+1, S, i, Vu, nu, T);
+					}
+				}
+			}
+		}		
+	} //end of sub_betaInOut
+	
+	
+	void sub_init(int d, int S, double *a, double value, int ones, int nh){
+		//cerr<<" d: "<<d<<endl; 
+		a[S] = value;
+		
+		if (d < nh){
+			sub_init(d+1, S, a, value, ones, nh);
+
+			if (ones < k) sub_init(d+1, S | (1 << d), a, value, ones+1, nh);
+		}
+	}
+
+	//HR: From get_kbest_nets.cc in Top-k
+	//HR: add v itself into the binary repres, v posi should be 0
+	//Convert the parent set to the appropriate variable set
+	unsigned int parset2varset(int v, unsigned int set) {
+		unsigned int sinkleton = 1U << v;
+		unsigned int mask = sinkleton - 1;
+		unsigned int low = set & mask;
+		unsigned int high = set & ~mask;
+		return (high << 1) | low;
+	}
+
+
+	//HR: Add for Top-k inside void compute_edge_probabilities_mixIndegree(int h)
+	//HR: Use the Poster tool to compute the local scores for all the families of each variable (without max-indegree
+	//	restriction). So for each of n variables, there are 2^(n-1) family scores.
+	//	Then store them as file 0, 1, 2, ..., n-1 for variable 0, 1, ..., n-1.
+	void write_family_scores_to_files(int nh){
+		FILE* fout;
+		//nh is the number of variables
+		int num_of_vars = nh;
+		unsigned int num_of_parsets = 1U << (num_of_vars - 1);
+		//HR: for each variable
+		for (int v = 0; v < num_of_vars; v++) {
+			char str1[40];
+			sprintf(str1, "%d", v);
+			string str;
+			//string dirname = "./family_scores";
+			string dirname = Arguments::directoryName;
+			str.append(dirname);
+			str.append("/");
+			str.append(str1);
+
+			fout = fopen(str.c_str(), "wb");
+			unsigned int new_par_set;
+			for (unsigned int par_set = 0; par_set < num_of_parsets; par_set++) {
+				//HR: add v itself into the binary repres, v posi should be 0
+				new_par_set = parset2varset(v, par_set);
+				//This is fine.
+				//fwrite(beta[v] + new_par_set, sizeof(double), 1, fout);
+				//This is also fine.
+				fwrite(&(beta[v][new_par_set]), sizeof(double), 1, fout);
+
+			}
+			fclose(fout);
+
+		}
+//		//test
+//		//HR: for each variable
+//		FILE* fin;
+//		for (int v = 0; v < num_of_vars; v++) {
+//			char str1[40];
+//			sprintf(str1, "%d", v);
+//			string str;
+//			//string dirname = "./family_scores";
+//			string dirname = Arguments::directoryName;
+//			str.append(dirname);
+//			str.append("/");
+//			str.append(str1);
+//
+//			fin = fopen(str.c_str(), "rb");
+//			unsigned int new_par_set;
+//			for (unsigned int par_set = 0; par_set < num_of_parsets; par_set++) {
+//				//HR: add v itself into the binary repres, v posi should be 0
+//				new_par_set = parset2varset(v, par_set);
+//				double temp_family_score;
+//				fread(&temp_family_score, sizeof(double), 1, fin);
+//				if(temp_family_score != beta[v][new_par_set]){
+//					cerr << "temp_family_score = " << temp_family_score << endl;
+//					cerr << "beta[" << v << "][" << new_par_set << "] = " << beta[v][new_par_set] << endl;
+//					cerr << "Error: temp_family_score != beta["
+//							<< v << "][" << new_par_set << "]" << endl;
+//					exit(1);
+//				}
+//			}
+//			fclose(fin);
+//
+//		}
+//		//
+
+	}//write_family_scores_to_files(int nh)
+
+	
+	// alpha[j][S] = sum_T beta[j][T]  (...times the prior).
+	void compute_alpha(int j, int *Vh, int nh){
+		// Use fast truncated upward Möbius transform.
+		fumt(beta[j], alpha[j], nh, k); 
+	}
+	
+
+	void compute_alphaNume(int j, int *Vh, int nh){
+		// Use fast truncated upward Möbius transform.
+		fumt(betaNume[j], alphaNume[j], nh, k); 
+	}
+	
+
+	void compute_alphaInOut(int j, int *Vh, int nh){
+		// Use fast truncated upward Möbius transform.
+		fumt(betaInOut[j], alphaInOut[j], nh, k); 
+	}
+	
+	
+	void compute_g_forward(int nh){	
+		sub_gf(0, nh, 0);
+	
+	}
+	
+	
+	void compute_gNume_forward(int nh){	
+		sub_gfNume(0, nh, 0);
+	
+	}
+	
+
+	void sub_gf(int d, int nh, int S){
+		
+		if (d < nh){
+			sub_gf(d+1, nh, S);
+			sub_gf(d+1, nh, S | (1 << d)); 
+		}
+		else {
+			double sum = MARK; 
+			int T = S, J = 1;
+			
+			for (int j = 0; j < nh; j ++){
+				if (T & 1){
+					// Now S - J is a subset of S.
+					
+					double w = alpha[j][S - J] + gf[S - J];
+					//LOGADD(sum, w);
+					logAdd_New(sum, w);
+				} 
+					
+				T >>= 1; J <<= 1;
+			}
+			if (S == 0) 
+				gf[0] = 0; 
+			else 
+				gf[S] = sum;
+		}
+	}
+	
+	
+		void sub_gfNume(int d, int nh, int S){
+		
+		if (d < nh){
+			sub_gfNume(d+1, nh, S);
+			sub_gfNume(d+1, nh, S | (1 << d)); 
+		}
+		else {
+			double sum = MARK; 
+			int T = S, J = 1;
+			
+			for (int j = 0; j < nh; j ++){				
+				if (T & 1){
+					// Now S - J is a subset of S.
+					
+					double w = alphaNume[j][S - J] + gfNume[S - J];
+					//LOGADD(sum, w);
+					logAdd_New(sum, w);
+				} 
+	
+				T >>= 1; J <<= 1;
+			}
+			if (S == 0) 
+				gfNume[0] = 0; 
+			else 
+				gfNume[S] = sum;
+		}
+	}
+	
+	
+	
+	void compute_g_backward(int nh){
+		sub_gb(0, nh, 0);
+	
+	}
+	
+	
+	void sub_gb(int d, int nh, int S){
+		if (d < nh){
+			sub_gb(d+1, nh, S);
+			sub_gb(d+1, nh, S | (1 << d)); 
+		}
+		else {
+			double sum = MARK; 
+			int T = S, J = 1, complS = (1 << nh) - 1 - S;
+			for (int j = 0; j < nh; j ++){
+				if (T & 1){
+					// Now S - J is a subset of S.
+					double w = alpha[j][complS] + gb[S - J];
+					//LOGADD(sum, w);
+					logAdd_New(sum, w);
+				} 		
+				T >>= 1; J <<= 1;
+			}
+			if (S == 0) gb[0] = 0; else gb[S] = sum;
+		}
+	}
+	
+
+	double eval_edge(int i, int j, double *a, double *b, int nh, int k){
+		int T = 1 << i;  
+		return sub_eval_edge(-1, 1, T, i, j, a, b, nh, k);
+	}
+	
+
+	double sub_eval_edge(
+		int tprev, int d, int T, int i, int j, double *a, double *b, int nh, int k){
+		
+		//cerr<<" T:"; print_set(cerr, T); 
+		//cerr<<": "<<a[T]<<"; "<<b[T]<<endl;
+		
+		//if T, d = |G_v| = k	
+		if (d == k){
+			return a[T] + b[T];
+		}
+		
+		//if  T < k, can add more
+		double sum = a[T] + b[T];
+		for (int t = tprev + 1; t < nh; t ++){
+			if (t == i || t == j) continue;
+			
+			int Tnext = T | (1 << t);
+			double w = sub_eval_edge(t, d+1, Tnext, i, j, a, b, nh, k);
+			//LOGADD(sum, w);
+			logAdd_New(sum, w);
+		}
+		return sum;
+	}
+	
+	
+	double eval_edge_mixIndegree(int i, int j, double * Gamma, double * Beta_j, int nh, int k){
+		int T = 1 << i;  
+		return sub_eval_edge_mixIndegree(-1, 1, T, i, j, Gamma, Beta_j, nh, k);
+	}
+	
+	
+	double sub_eval_edge_mixIndegree(
+		int tprev, int d, int T, int i, int j, double * Gamma, double * Beta_j, int nh, int k){
+		
+		//cerr<<" T:"; print_set(cerr, T); 
+		//cerr<<": "<<a[T]<<"; "<<b[T]<<endl;
+		
+		//if T, d = |G_v| = k	
+		if (d == k){
+			double sumRes;
+			if(Beta_j[T] == MARK){
+				cerr<<"\n**** Beta_j[T] == MARK ";
+		   	}
+			
+			//return (Gamma[T] + Beta_j[T]);
+			if(Gamma[T] == LOG_ZERO){
+				sumRes = LOG_ZERO;
+			}
+					
+			else if(Gamma[T] <= 0){
+				sumRes = Beta_j[T] + Gamma[T];
+			}
+			else{
+				cerr<<"\n**** Gamma[T] > 0 ";
+				sumRes = - ( Beta_j[T] - Gamma[T] );
+
+			}
+			return sumRes;
+	
+		}
+		
+		//if  T < k, can add more
+		//double sum = Gamma[T] + Beta_j[T];
+		double sum;
+		if(Beta_j[T] == MARK){
+			cerr<<"\n**** Beta_j[T] == MARK ";
+		}
+		if(Gamma[T] == LOG_ZERO){
+				sum = LOG_ZERO;
+		}
+					
+		else if(Gamma[T] <= 0){
+			sum = Beta_j[T] + Gamma[T];
+		}
+		else{
+			cerr<<"\n**** Gamma[T] > 0 ";
+			sum = - ( Beta_j[T] - Gamma[T] );
+
+		}
+		
+	
+		for (int t = tprev + 1; t < nh; t ++){
+			if (t == i || t == j) continue;
+
+			int Tnext = T | (1 << t);
+			double w = sub_eval_edge_mixIndegree(t, d+1, Tnext, i, j, Gamma, Beta_j, nh, k);
+			logAddComp(sum, w);
+		}
+		return sum;
+	}
+	
+	
+	double eval_edge_mixIndegreeNoLog(int i, int j, double * Gamma, double * Beta_j, int nh, int k){
+		int T = 1 << i;  
+		return sub_eval_edge_mixIndegreeNoLog(-1, 1, T, i, j, Gamma, Beta_j, nh, k);
+	}
+	
+
+	double sub_eval_edge_mixIndegreeNoLog(
+		int tprev, int d, int T, int i, int j, double * Gamma, double * Beta_j, int nh, int k){		
+		//cerr<<" T:"; print_set(cerr, T); 
+		//cerr<<": "<<a[T]<<"; "<<b[T]<<endl;
+		
+		//if T, d = |G_v| = k	
+		if (d == k){
+			//Lose precision
+			//return (Gamma[T] * exp(Beta_j[T]));
+			double product_res;
+			//if Beta_j[T]  has not been initialized
+			if(Beta_j[T] == MARK){
+				cerr<<"***Beta_j[T]  has not been initialized" << endl;
+				product_res = 0;		
+			}
+			else{
+				if(Gamma[T] == 0){
+				 	product_res = exp(Beta_j[T]);
+				}
+				else if(Gamma[T] > 0){
+					product_res = exp(Beta_j[T] + log(Gamma[T]));
+				}
+				else{
+					product_res = - exp(Beta_j[T] + log(-Gamma[T]));
+				}
+				
+			}
+
+			return product_res;
+			
+		}
+		
+		//if  T < k, can add more
+		//double sum = Gamma[T] * exp(Beta_j[T]);
+		double sum;
+		double product_res;
+		
+			//if Beta_j[T]  has not been initialized
+			if(Beta_j[T] == MARK){
+				cerr<<"***Beta_j[T]  has not been initialized" << endl;
+				product_res = 0;		
+			}
+			else{
+				if(Gamma[T] == 0){
+				 	product_res = exp(Beta_j[T]);
+				}
+				else if(Gamma[T] > 0){
+					product_res = exp(Beta_j[T] + log(Gamma[T]));
+				}
+				else{
+					product_res = - exp(Beta_j[T] + log(-Gamma[T]));
+				}
+				
+			}
+			
+		sum = product_res;
+		for (int t = tprev + 1; t < nh; t ++){
+			if (t == i || t == j) continue;
+
+			int Tnext = T | (1 << t);
+			double w = sub_eval_edge_mixIndegreeNoLog(t, d+1, Tnext, i, j, Gamma, Beta_j, nh, k);
+			//LOGADD(sum, w);
+			sum += w;
+		}
+		return sum;
+	}
+	
+	
+	Model *model;
+	
+	double **alpha, **beta;
+	double **alphaNume, **betaNume;
+	
+	double *gf, *gb;
+	
+	double *gfNume;
+	int k;
+	
+	double **alphaInOut, **betaInOut;
+	int * inFeatureEdges; 
+	int * outFeatureEdges; 
+	
+	
+};
+
+
+
+#endif
diff --git a/sourcecodes/k-best/src/GenerateGraphs.sh b/sourcecodes/k-best/src/GenerateGraphs.sh
new file mode 100644
index 00000000..3427eb4d
--- /dev/null
+++ b/sourcecodes/k-best/src/GenerateGraphs.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+k=100
+rdir=./../iris3/resdir
+for ((  i = 0 ;  i < k;  i++  ))
+do
+  dot ${rdir}/dot_$i -Tps -o ${rdir}/dotRes_$i.ps
+done
\ No newline at end of file
diff --git a/sourcecodes/k-best/src/Model.h b/sourcecodes/k-best/src/Model.h
new file mode 100644
index 00000000..1ba7a0dd
--- /dev/null
+++ b/sourcecodes/k-best/src/Model.h
@@ -0,0 +1,1002 @@
+#ifndef MODEL_H
+#define MODEL_H
+
+#include<stdio.h>
+#include<stdlib.h>
+
+#include<iostream>
+#include<vector>
+#include<deque>
+#include<string>
+#include<fstream>
+#include<math.h>
+
+#include"Arguments.h"
+
+using namespace std;
+
+#include"UpdateHR2.h"
+
+#define MAX_COUNT 1000
+#define MAX_RQ 8*10000
+static double lr[MAX_RQ][MAX_COUNT]; 
+static double lr2[MAX_RQ][MAX_COUNT]; 
+
+//ofstream totalOf1("debugModelTotal1.txt");
+
+double log_gammaratio(int a, int z){
+	if(z >= MAX_COUNT  || a >= MAX_RQ){
+//		if(z >= MAX_COUNT){
+//			cerr << " Counts larger than " << MAX_COUNT << " occured. " << endl;
+//			cerr << " Increase MAX_COUNT. Exit now.\n"; 
+//			
+//		}
+//		else if(a >= MAX_RQ ){
+//			cerr << " a larger than " << MAX_RQ << " occured. " << endl;
+//			cerr << " Increase MAX_RQ. Exit now.\n";  
+//		} 
+//		
+//		exit(1); 		
+
+		double log_gam_res = 0;
+		//seperate 2 cases:
+		//if only z >= MAX_COUNT but a < MAX_RQ
+		if(a < MAX_RQ){
+			//can compute it faster based on lr
+			log_gam_res += lr[a][MAX_COUNT - 1];
+			for(int k = MAX_COUNT - 1; k <= z-1; k++){
+				log_gam_res += log(1.0/a + k);
+			}
+			
+		}
+		//o.w.: start from the beginning
+		else{
+			for(int k = 0; k <= z-1; k++){
+				log_gam_res += log(1.0/a + k);
+			}
+		}
+
+//		totalOf1 << "log_gam_res = "  << log_gam_res << endl << endl;
+		return log_gam_res;
+
+	}
+	else if (z < MAX_COUNT && a > 0){
+		return lr[a][z];
+	}
+	else if (z < MAX_COUNT && a < 0){
+		return lr2[-a][z];
+	}
+	else{
+		cerr << "Error: a = 0" << endl;
+		exit(1); 
+	}
+}
+
+
+double log_gammaratio(double z){
+	return 0.50 * log(M_PI) + (z - 0.50) * log(z) - z + 1.0 / (12 * z);  
+}
+
+template<class T> void printvec(ostream& f, const vector<T>& v){
+	int size= v.size();
+	int i;
+	for(i=0; i<size; i++){
+		f<<v.at(i)<<" ";
+	}
+	f<<endl;
+}
+template<class T> void printvecs(ostream& f, const vector<vector<T> >& v){
+	int size= v.size();
+	int i;
+	for(i=0; i<size; i++){
+		printvec(f, v.at(i));
+	}
+}
+
+
+void print_nodes(ostream& f, int *V, int n){
+	for (int j = 0; j < n; j ++){
+		f<<" "<<V[j];
+	}
+}
+
+void print_nodes(ostream& f, int T, int *V, int n){
+	int j = 0; 
+	while (T > 0){           
+		if (T & 1){
+			f<<" "<<V[j];
+		}
+		j ++;
+		
+		T >>= 1; 
+	}
+}
+void print_set(ostream& f, int T){
+	int j = 0; 
+	while (T > 0){
+		if (T & 1){
+			f<<" "<<j;
+		}
+		j ++;
+		T >>= 1;
+	}
+}
+
+
+// Reads and stores data.
+class Data{
+public:
+	Data(){}
+	~Data(){}
+	void init(){
+		read_data();
+		downcode();
+	}
+	void read_data(){
+		ifstream ifs(Arguments::datafile, ios::in);
+		if (!ifs){
+			fprintf(stderr, " Cannot read file %s.\n", Arguments::datafile);
+			exit(1);
+		}
+		fprintf(stderr, " Reading file %s...\n", Arguments::datafile);
+		
+		char* buffer= new char[10000];
+		ifs.getline(buffer, 10000);
+		char* pch= strtok(buffer,", \t");
+		while (pch != NULL){
+			string tempstring(pch);
+			//cerr << "Node = "<< tempstring << endl;
+			heads.push_back(tempstring);
+			pch = strtok(NULL, ", \t");
+        }
+		numattributes = heads.size();
+	
+		fprintf(stderr, " Heading read: %d attributes.\n", numattributes);
+	
+		dm.clear();
+		vector<int> temp;
+		while (true){
+			temp.clear();
+			ifs.getline(buffer, 10000);
+			pch = strtok(buffer,", \t");
+			while (pch != NULL){
+				temp.push_back(atoi(pch));
+				pch = strtok(NULL, ", \t");
+			}
+			if ((int)temp.size() != numattributes) break;
+			
+			dm.push_back(temp);
+			
+			if ((int)dm.size() >= atoi(Arguments::maxnumrecords)) break;
+		}
+		numrecords = dm.size();
+		fprintf(stderr, " Data read: %d lines.\n", numrecords); 
+		delete [] buffer;
+	}
+	void downcode(){
+		//fprintf(stderr, "downcode() starts. \n"); 
+		
+		int inuse[4096][256];
+		for (int v = 0; v < 255; v ++){
+			for (int i = 0; i < numattributes; i ++){
+				inuse[v][i] = -1;
+			}
+		}
+		//Purpose: For each i attribute, 
+		for (int t = 0; t < numrecords; t ++){
+			for (int i = 0; i < numattributes; i ++){
+				inuse[dm[t][i]][i] = 1;
+			}
+		}
+
+		//ofstream of1("debugDowncode.txt");
+		//of1 << "\n inuse check" << endl;
+		for (int v = 0; v < 30; v ++){			
+
+			
+//			for (int i = 0; i < numattributes; i++){
+//				of1 << " inuse[" << v << "][" << i << "] =" << inuse[v][i] << endl;
+//			}
+//			of1 << "\n";
+			
+
+         	/*
+         	FILE * fp1 = fopen("debug1.txt", "w");
+          	fprintf(fp1, "\n inuse check\n");
+          	for (int i = 0; i < numattributes; i++){
+				fprintf(fp1, " inuse[%d][%d] = %d\n", v, i, inuse[v][i]);
+			}
+                  fclose(fp1);
+ 			*/
+                  
+
+			/*
+      		fprintf(stderr, "\n inuse check\n");
+           	for (int i = 0; i < numattributes; i++){    	
+				fprintf(stderr, " inuse[%d][%d]=%d\n", v, i, inuse[v][i]);
+          	}
+			fprintf(stderr, "\n");
+			*/
+		}
+
+		arities.clear();
+
+		maxarity = 0;
+
+		for (int i = 0; i < numattributes; i ++){
+			int count = 0;
+			for (int v = 0; v < 255; v ++){
+				if (inuse[v][i] == 1){
+					inuse[v][i] = count ++;
+				}
+			}
+			arities.push_back(count);	
+			if (count > maxarity) maxarity = count;
+		}
+
+//      of1 << "maxarity = " << maxarity << endl;
+//		printvec(of1, arities);
+		
+		for (int t = 0; t < numrecords; t ++){
+			for (int i = 0; i < numattributes; i ++){
+				dm[t][i] = inuse[dm[t][i]][i];
+
+			}
+		}
+	}//end downcode()
+	
+	
+	int get_index(string s){
+		int i = 0;
+		while (i < (int)heads.size() && heads[i] != s){ i ++; }
+		return i;
+	}
+	void print_data(ostream & f){
+		for (int i = 0; i < numattributes; i ++){
+			f << " " << heads[i];
+		}
+		f << endl; 
+		for (int t = 0; t < numrecords; t ++){
+			for (int i = 0; i < numattributes; i ++){
+				f << " " << dm[t][i];
+			}
+			f << endl; 
+		}
+	}
+		
+	vector<string> heads;
+
+	vector< vector<int> > dm;
+
+	vector<int> arities;
+
+	int numattributes;
+
+	int numrecords;
+
+	int maxarity;
+};
+
+
+// NOTE: We assume that children come first, that is, 
+// V[0] is the grandest child and V[n-1] is the grandest parent.
+// Layers respectively from 0 to numlayers.
+// Note that this is reverse to the input ordering.
+class Layering{
+public:
+	Layering(){}
+	~Layering(){ delete [] V;}
+
+	void init(Data & data){
+		set_layers(data);
+		
+		//print_layers();
+	
+	}
+	void set_layers(Data & data){
+		
+//		ofstream of1("debugSet_layers.txt");
+	
+		V = new int[data.numattributes];
+		int j = 0;
+		cnh.clear(); nh.clear(); cnh.clear();
+		
+		if (Arguments::layeringfile[0] == '%'){
+			numlayers = 1;
+			int layersize = data.numattributes;			
+			nh.push_back(layersize);
+			cnh.push_back(j);
+			
+			for (int l = 0; l < layersize; l ++){
+				int i = j;
+				V[j++] = i;
+			}
+			
+			edgeswithin.clear();
+			edgeswithin.push_back(true);
+        	
+			return;
+		}
+	
+		parselayeringfile(Arguments::layeringfile, true);
+		numlayers = nodesinlayers.size();
+	
+		for (int h = numlayers-1; h >= 0; h --){
+			int layersize = nodesinlayers[h].size();
+			nh.push_back(layersize);
+			cnh.push_back(j);
+			for (int l = 0; l < layersize; l ++){
+				int i = data.get_index(nodesinlayers[h][l]);
+				V[j++] = i;
+			}
+		}
+	
+	}
+	void print_layers(){
+		for (int h = 0; h < numlayers; h ++){
+			cerr<<"Layer "<<h<<":";
+			for (int j = 0; j < nh[h]; j ++){
+				cerr<<" "<<V[cnh[h] + j];
+			}
+			cerr<<endl;
+		}
+	}
+	bool edges_within(int h){
+		return edgeswithin[numlayers - h - 1];
+	}	
+	void parselayeringfile(char *layerfilename, bool verbose){
+	
+		ifstream ifs(layerfilename, ios::in);
+		if( !ifs){
+			cerr<<"ERROR: The file '"<<layerfilename<<"' could not be opened\n";
+			cerr<<"Exiting\n";
+			exit(1);
+		}
+		if(verbose){
+			cerr<<"Reading layer file: '"<<layerfilename<<"'\n";
+		}
+
+		char* buffer= new char[10000];
+		char* pch;
+		int i;
+		char tempchar;
+		while(true){
+			ifs.getline(buffer,10000);
+			pch = strtok(buffer, ", \t");
+			vector<string> tempstringvec;	//will hold the tokenized line
+			while(pch != NULL){
+				string tempstring(pch);
+				tempstringvec.push_back(tempstring);
+				pch = strtok(NULL, ", \t");
+			}
+
+			if(tempstringvec.size() < 3){
+				cerr<<"   ERROR: in reading file '"<<layerfilename<<"'"<<endl;
+				cerr<<"          each line must be of the form:"<<endl;
+				cerr<<"          layername\t1/0\tn1 ... nn"<<endl;
+				cerr<<"          EXITING"<<endl;
+				exit(1);
+			}
+
+			layernames.push_back(tempstringvec.at(0));
+			if(tempstringvec.at(1) == "0"){
+				edgeswithin.push_back(0);
+			}
+			else if( tempstringvec.at(1) == "1"){
+				edgeswithin.push_back(1);
+			}
+			else{
+				cerr<<"   ERROR: in reading file '"<<layerfilename<<"'"<<endl;
+				cerr<<"          the values in the second column can either be '1' or '0'"<<endl;
+				cerr<<"          EXITING"<<endl;
+				exit(1);
+			}
+
+			vector<string> tempnodesinlayer;
+			for(i = 2; i < (int)tempstringvec.size();i ++){
+				tempnodesinlayer.push_back(tempstringvec.at(i));
+			}
+			nodesinlayers.push_back(tempnodesinlayer);
+
+			ifs>>tempchar;
+			ifs.putback(tempchar);
+			if(ifs.eof()){
+				break;
+			}
+		}
+		delete [] buffer;
+		buffer = 0;
+		pch = 0;
+		cerr.width(13);
+		cerr<<"Layer Name";
+		cerr.width(24);
+		cerr<<"Edges Within Allowed";
+		cerr.width(14);
+		cerr<<"Node Names"<<endl;
+		for(i = 0; i < (int)layernames.size(); i ++){
+			cerr.width(13);
+			cerr<<layernames.at(i);
+			cerr.width(15);
+			if(edgeswithin.at(i)){
+				cerr<<"true";
+			}
+			else{
+				cerr<<"false";
+			}
+			cerr<<"             ";
+			printvec(cerr, nodesinlayers.at(i));
+		}
+	}
+
+
+	vector<string> layernames; 
+	vector<bool> edgeswithin;
+	vector<vector<string> > nodesinlayers;
+	int *V;
+	int numlayers;
+	vector<int> nh;
+	vector<int> cnh;
+};
+
+
+
+// Blocks for computing sufficient statistics.
+class Tnode{
+public:
+	double pseudocount;
+	short int arity;
+	short int count;
+	short int depth;
+	Tnode** children;
+	
+	Tnode(const int a, const int d){
+		pseudocount = 1;
+		arity = a;
+		count = 0;
+		depth = d;
+		children = new Tnode*[arity];
+		for(int v = 0; v < arity; v ++){
+			children[v] = NULL;
+		}
+	}
+	~Tnode(){
+		for(int v = 0; v < arity; v ++){
+			if (children[v] != NULL){
+				delete children[v];
+			}
+		}
+		delete [] children;
+		//free_memory();
+	}
+	void free_memory(){
+		//cerr<<" Deleting d="<<depth<<" c="<<count<<endl;
+		
+		for(int v = 0; v < arity; v ++){
+			if (children[v] != NULL){
+				children[v]->free_memory();
+				delete children[v];
+			}
+		}
+		//delete [] children;
+	}
+	// Note: Actually S is not needed.
+	void update(vector<int> & S, vector<int> & u){
+		if (u.size() > 0){	
+			//int j = S[u.size()-1];			
+			int v = u[u.size()-1]; 
+			
+			u.pop_back();
+			if (children[v] == NULL){
+				//cerr<<" Creating d="<<depth<<" c="<<count<<endl;
+				
+				children[v] = new Tnode(arity, depth+1);
+			}
+			children[v]->update(S, u);
+		}
+		count ++;
+	}
+	void print(ostream & f){
+		f << "(" << count << ")" << endl;
+		for (int v = 0; v < arity; v ++){
+			if (children[v] != NULL){
+				for (int d = 0; d < depth; d ++) f << " "; 
+				f << " " << v << " ";
+				children[v]->print(f);
+			}
+		}
+	}
+	
+	double evaluate(int d, int a, int r){
+		double sum = 0;
+		
+		//if no parent, directly log[gamma(1+count) / gamma(1)  ] (1/a = 1/1 = 1)
+		if (depth == d){
+				sum = log_gammaratio(a, count);
+				//cerr << "count1: " << count << endl;
+
+		}
+		else if (depth <= d - 1){
+			for (int v = 0; v < arity; v ++){
+				if (children[v] != NULL){
+					double value = children[v]->evaluate(d, a, r);
+					sum += value;
+				}
+			}
+			if (depth == d - 1){
+				sum -= log_gammaratio(r, count);
+				//cerr << "count2: " << count << endl;
+
+			}
+		}
+		return sum;
+	}
+	
+
+	double evaluateHR(int d, int alpha_v_pa, int r){
+		//cerr << "start: root.evaluateHR(d ="
+		//<< d << ", alpha_v_pa=" << alpha_v_pa << ", r=" << r << ")" << endl;
+		double sum = 0;
+		
+		//if no parent, directly log[gamma(1+count) / gamma(1)  ] (1/a = 1/1 = 1)
+		if (depth == d){
+				//sum = log_gammaratio(a, count);
+				sum = log_gammaratio(alpha_v_pa, count);				
+				//cerr << "count1: " << count << endl;
+
+		}
+		else if (depth <= d - 1){
+			for (int v = 0; v < arity; v ++){
+				if (children[v] != NULL){
+					double value = children[v]->evaluateHR(d, alpha_v_pa, r);
+					sum += value;
+				}
+			}
+			if (depth == d - 1){
+				int alpha_pa = alpha_v_pa / r;
+
+				sum -= log_gammaratio(alpha_pa, count);
+//				totalOf1 << "\nalpha_pa: " << alpha_pa << endl;
+//				totalOf1 << "count2: " << count << endl;
+//				totalOf1 << "-log_gammaratio(alpha_pa, count) = " << -log_gammaratio(alpha_pa, count) << endl;
+				//cerr << "count2: " << count << endl;
+				
+			}
+		}
+		return sum;
+	}
+	
+};
+
+
+class Model{
+public:
+	Model(){}
+	~Model(){}
+
+	void makeADTree(vector< vector<int> > & dm, vector<int> & arities){
+		//Create dmIndex from dm, dmIndex stroes {0, 1, R-1}
+		vector<int> dmIndex;
+//		cout << "dm.size() = " << dm.size() << endl;
+		for(int i = 0; i < (int) dm.size(); i++){
+			dmIndex.push_back(i);
+		}
+//		cout << "dmIndex:" << endl;
+//		for(int i = 0; i < (int) dm.size(); i++){
+//			cout << "dmIndex[" << i << "] = "<< dmIndex[i] << endl;
+//		}
+		
+		//  M: the num of attr
+//		int M = dm[0].size();
+//		cout << "M = " << M << endl;
+		
+		//cout << "Start MakeADTree()" << endl;
+		//ADTreeNode * ADTreeNodeP1 = MakeADTree(0, dmIndex, dm, arities);
+		ADTreeNodeP1 = MakeADTree(0, dmIndex, dm, arities);
+   		//cout << "End MakeADTree()" << endl;
+
+		//cout << "Start PrintADTreeNode()" << endl;
+		//PrintADTreeNode(ADTreeNodeP1, 0, M, arities);
+		//cout << "End PrintADTreeNode()" << endl;
+		
+	}
+
+	void makeADTree(){
+		makeADTree(data.dm, data.arities);
+	}
+
+	void freeADTree(vector< vector<int> > & dm, vector<int> & arities){
+		int M = dm[0].size();
+		//cout << "M = " << M << endl;
+		//cout << "Start FreeADTreeNode()" << endl;
+		FreeADTreeNode(ADTreeNodeP1, M, arities);
+		//cout << "End FreeADTreeNode()" << endl;
+		
+	}
+	
+	void freeADTree(){
+		freeADTree(data.dm, data.arities);
+	}
+	
+
+	void MakeADContiTable(vector< vector<int> > & dm, vector<int> & arities){
+		cout << "\nStart MakeADContiTable(vector< vector<int> > & dm, vector<int> & arities)" << endl;
+		//  M: the num of attr
+		int M = dm[0].size();
+		cout << "M = " << M << endl;
+		
+		deque<int> inquiryAttrs;
+	
+		for(int i = 0; i < (int) inquiryAttrs.size(); i++){
+			cout << "inquiryAttrs[" << i << "] = " << inquiryAttrs[i] << endl;
+		}
+		
+		vector<int> givenAttrs;
+		
+		vector<int> givenVals;
+			
+		cout << "Call MakeContab() " << endl;
+		CondiContiTable resultTable = MakeContab(inquiryAttrs, ADTreeNodeP1, givenAttrs, givenVals, arities);
+		cout << "Return MakeContab() " << endl;
+		for(unsigned int i = 0; i < resultTable.contiTableCounts.size(); i++){
+			cout << "resultTable.contiTableCounts[" << i << "] = " << resultTable.contiTableCounts[i] << endl; 
+		}
+		
+		cout << "End MakeADContiTable(vector< vector<int> > & dm, vector<int> & arities)" << endl;
+
+		
+	} //end void MakeADContiTable()
+	
+	void MakeADContiTable(){
+		MakeADContiTable(data.dm, data.arities);
+	}
+	
+	vector<int> MakeADContiTable(deque<int> inquiryAttrs, vector< vector<int> > & dm, vector<int> & arities){
+		//cout << "\nStart MakeADContiTable(vector< vector<int> > & dm, vector<int> & arities)" << endl;
+		//  M: the num of attr
+		//int M = dm[0].size();
+		//cout << "M = " << M << endl;
+		
+		//deque<int> inquiryAttrs;
+		
+		//Full inquiry
+//		for(int i = 0; i < M; i++){
+//			inquiryAttrs.push_back(i);
+//		}
+		
+		
+//		for(int i = 0; i < (int) inquiryAttrs.size(); i++){
+//			cout << "inquiryAttrs[" << i << "] = " << inquiryAttrs[i] << endl;
+//		}
+		
+		vector<int> givenAttrs;
+		
+		vector<int> givenVals;
+			
+		//cout << "Call MakeContab() " << endl;
+		CondiContiTable resultTable = MakeContab(inquiryAttrs, ADTreeNodeP1, givenAttrs, givenVals, arities);
+		//cout << "Return MakeContab() " << endl;
+//		
+//		for(unsigned int i = 0; i < resultTable.contiTableCounts.size(); i++){
+//			cout << "resultTable.contiTableCounts[" << i << "] = " << resultTable.contiTableCounts[i] << endl; 
+//		}
+//		
+//		cout << "End MakeADContiTable(vector< vector<int> > & dm, vector<int> & arities)" << endl;
+		return resultTable.contiTableCounts;
+		
+	} //end vector<int> MakeADContiTable()
+	
+
+	
+	void init(){
+		data.init();
+		m = data.numrecords;
+		n = data.numattributes;
+
+		layering.init(data);
+			
+		for (int a = 1; a < MAX_RQ; a ++){
+			double aa = 1.0 / a;
+			lr[a][0] = 0; lr2[a][0] = 0;
+			
+			for (int k = 1; k < MAX_COUNT; k ++){
+				lr[a][k] = lr[a][k-1] + log(aa + k - 1);
+				lr2[a][k] = lr2[a][k-1] + log(a + k - 1);
+			}
+		}
+	
+	}
+	
+	
+	
+	
+	
+	
+	
+	void test(){
+		for (int i = 0; i < 1; i ++){
+			vector<int> T;
+			T.clear();			
+			T.push_back(1);			
+			T.push_back(2);
+			
+		}
+		exit(1);
+	}
+	
+	
+	void testHR(){
+		for (int i = 0; i < 1; i ++){
+			vector<int> T;
+			T.clear();
+			T.push_back(1);
+			T.push_back(2);
+			T.push_back(3);
+			T.push_back(4);
+			
+		}
+	} //end void testHR()
+	
+	
+	void testHR_ADtree(){
+		for (int i = 0; i < 1; i ++){
+			deque<int> T;
+			T.clear();
+			T.push_back(1);
+			T.push_back(2);
+			T.push_back(3);
+			T.push_back(4);
+			
+		}
+	} //end void testHR_ADtree()
+	
+	
+
+	//--- Interface functions --- below ----------
+	//
+	// Log of local conditional probability, log p(xi | xS).
+	double log_lcp(int i, vector<int> & T){
+		
+		return log_lcp_mult(i, T);
+	}
+	double log_lcp(int i, int *T, int d){
+		vector<int> TT;
+		for (int j = 0; j < d; j ++) TT.push_back(T[j]);
+		return log_lcp_mult(i, TT);
+	}
+	
+
+	double log_lcpHR(int i, vector<int> & T){
+		
+		return log_lcp_multHR(i, T);
+	}
+	
+	double log_lcpHR(int i, int *T, int d){
+		vector<int> TT;
+		for (int j = 0; j < d; j ++) TT.push_back(T[j]);
+		//cerr << "start log_lcp_multHR(i, TT)" << endl;
+		double result = log_lcp_multHR(i, TT);
+		return result;
+	}
+	
+	
+	double log_lcpHR_ADtree(int i, int *T, int d){
+		deque<int> TT;
+		for (int j = 0; j < d; j ++) TT.push_back(T[j]);
+		double result = log_lcp_multHR_ADtree(i, TT);
+		return result;
+	}
+	
+	
+	double log_prior(int i, int *T, int d){
+		return lr[1][d] + lr[1][n-1-d] - lr[1][n-1];
+	}
+	int num_layers(){
+		return layering.numlayers;
+	}
+	void layer(int h, int** Vh, int* nh){
+		*Vh = &(layering.V[layering.cnh[h]]);
+		*nh = layering.nh[h];
+	}
+	void upper_layers(int h, int** Vu, int* nu){//similar to above but upper means parent
+		if (h < layering.numlayers){
+			*Vu = &(layering.V[layering.cnh[h+1]]);
+			*nu = n - layering.cnh[h+1];
+		}
+		else{ *Vu = NULL; *nu = 0;}	
+	}
+	void lower_layers(int h, int **Vl, int *nl){//similar to above but lower means children
+		if (h > 0){
+			*Vl = layering.V;
+			*nl = layering.cnh[h];
+		}
+		else{ *Vl = NULL; *nl = 0;}
+	}
+	int max_indegree(){
+		return atoi(Arguments::maxindegree);
+	}
+	bool edges_within(int h){
+		return layering.edges_within(h);
+	}
+	int num_nodes(){
+		return n;
+	}
+	
+	void print_edge_prob(ostream& f, int i, int j, double p){
+		//f<<data.heads[i]<<" -> "<<data.heads[j]<<" "<<p<<endl; 
+		f<<data.heads[i]<<" -> "<<data.heads[j]<<" \t" <<p <<endl; 
+	} 
+	
+	//
+	//--- Interface functions --- above ----------	
+	
+	
+private:	
+	// Dirichlet-multinomial model
+	double log_lcp_mult(int i, vector<int> & T){
+		vector<int> S;
+
+		S.push_back(i);
+				
+		for (int k = 0; k < (int)T.size(); k ++){
+			S.push_back(T[k]);
+		}
+		
+		//cerr << " Evaluation yields: " << evaluate(S) << " , log_gammaratio(1, 2) = " 
+		//	<< log_gammaratio(1, 2) << " , a = " <<  data.arities[S[0]] << endl;
+		
+		return evaluate(S);	
+	}
+	
+	double evaluate(vector<int> & S){
+		
+		Tnode root(data.maxarity+1, 0);
+		vector<int> u;
+		
+		//for each record t 
+		for (int t = 0; t < m; t ++){
+			u.clear();
+			for (int k = 0; k < (int)S.size(); k ++){
+				int j = S[k];
+				u.push_back(data.dm[t][j]);
+			}
+			//cerr << t+1 << "th update: ";
+			
+			root.update(S, u);
+			//cerr << endl;
+			
+		}
+		//root.print(cerr);
+		
+	
+		return root.evaluate(S.size(), 1, -data.arities[S[0]]);
+		
+	}
+	
+
+	double log_lcp_multHR(int i, vector<int> & T){
+		vector<int> S;
+				
+		S.push_back(i);
+				
+		for (int k = 0; k < (int)T.size(); k ++){
+			S.push_back(T[k]);
+		}
+	
+		//cerr << " Evaluation yields: " << evaluate(S) << " , log_gammaratio(1, 2) = " 
+		//	<< log_gammaratio(1, 2) << " , a = " <<  data.arities[S[0]] << endl;
+		double result = evaluateHR(S);
+		return result;
+		
+			
+	}//end log_lcp_multHR()
+	
+
+	double log_lcp_multHR_ADtree(int i, deque<int> & T){
+		//totalOf1 << "Inside log_lcp_multHR()" << endl;
+		
+		double result2 = evaluateHR_ADtree(T);
+
+		int insertIndex = -1;
+		for(int k = 0; k < (int)T.size(); k++){
+			if(i < T[k]){
+				insertIndex = k;
+				break;
+			}
+		}
+		if(insertIndex == -1){
+			insertIndex = (int)T.size();
+		}
+
+		deque<int> S;
+		
+		for(int k = 0; k <= insertIndex - 1; k++){
+			S.push_back(T[k]);
+		}
+		S.push_back(i);
+		for(int k = insertIndex; k < (int)T.size(); k++){
+			S.push_back(T[k]);
+		}
+		
+		double result1 = evaluateHR_ADtree(S);
+		
+		//cerr << " Evaluation yields: " << evaluate(S) << " , log_gammaratio(1, 2) = " 
+		//	<< log_gammaratio(1, 2) << " , a = " <<  data.arities[S[0]] << endl;
+		double result = result1 - result2;
+		return result;
+				
+	}
+	
+	
+	// Dirichlet-multinomial model
+	double evaluateHR(vector<int> & S){
+		Tnode * root = new Tnode (data.maxarity+1, 0);
+		vector<int> u;
+		
+		//for each record t 
+		for (int t = 0; t < m; t ++){
+			u.clear();
+			for (int k = 0; k < (int)S.size(); k ++){
+				int j = S[k];
+				u.push_back(data.dm[t][j]);
+			}
+			//cerr << t+1 << "th update: ";
+
+			(*root).update(S, u);
+			//
+			//cerr << endl;
+			
+		}
+		//root.print(cerr);
+		
+		int alpha_v_pa = 1;
+		for(int index = 0; index < (int)S.size(); index++){
+			alpha_v_pa *= data.arities[S[index]];
+		}
+		int r = data.arities[S[0]];
+		//return root.evaluateHR(S.size(), alpha_v_pa, r);
+
+		double result = (*root).evaluateHR(S.size(), alpha_v_pa, r);
+		//totalOf1 << "    result of root.evaluateHR(" << S.size() <<", " 
+		//	<< alpha_v_pa << ", " << r << ") = " << result << endl;
+		delete root;
+		return result;
+		
+	} //end double evaluateHR(vector<int> & S)
+	
+
+	double evaluateHR_ADtree(deque<int> & S){
+
+		int alpha = 1;
+		for(int index = 0; index < (int)S.size(); index++){
+			alpha *= data.arities[S[index]];
+		}
+		
+		vector<int> countVec = MakeADContiTable(S, data.dm, data.arities);
+		
+		double sum = 0;
+		for(int i = 0; i < (int) countVec.size(); i++){
+			//totalOf1 << "countVec[" << i <<" ]" << countVec[i] << endl;
+			sum += log_gammaratio(alpha, countVec[i]);
+		}
+		
+//		totalOf1 << "evaluateHR_ADtree(deque<int> & S) ends" << endl;
+
+		return sum;
+		
+	} //end double evaluateHR_ADtree()
+	
+		
+	Data data;
+	int n;
+	int m;
+	Layering layering;	
+	
+	ADTreeNode * ADTreeNodeP1;
+	
+}; //end of class Model
+
+
+
+
+
+#endif
diff --git a/sourcecodes/k-best/src/UpdateHR.h b/sourcecodes/k-best/src/UpdateHR.h
new file mode 100644
index 00000000..19b93c1d
--- /dev/null
+++ b/sourcecodes/k-best/src/UpdateHR.h
@@ -0,0 +1,1652 @@
+#include<stdio.h>
+#include<stdlib.h>
+#include"math.h"
+
+#include"Arguments.h"
+#include"Model.h"
+#include"Engine.h"
+
+
+#define LOGADD_NEW(logA, logB) if(logA == MARK) logA = logB; else if (logA == LOG_ZERO) logA = logB; else if (logB == LOG_ZERO) logA = logA; else logA = logA + log(1+exp(logB-logA));
+    	
+//#define LOGMINUS(la,lb) if(la>8e99||lb-la>100) la=lb;else la+=log(1-exp(lb-la));
+
+#define LOGMINUS_NEW(logA, logB) if(logA == MARK) logA = logB; else if (logA == LOG_ZERO) logA = logB; else if (logB == LOG_ZERO) logA = logA; else logA = logA + log(1-exp(logB-logA));
+
+#define epsilon 1.0e5
+
+bool logSpecValEquals(double logX, double logSpecVal){
+	return (logX >= logSpecVal - epsilon && logX <= logSpecVal + epsilon);
+}
+
+//call by reference to the original value
+//the log sum result is stored in logA
+//replace LOGADD_NEW(logA, logB)
+//Pre: if neither logA nor logB is MARK/LOG_ZERO, then logA < 0 && logB < 0
+void logAdd_New(double & logA, double & logB){
+	    //if(logA == MARK){
+	    if(logSpecValEquals(logA, MARK)){
+    		logA = logB;
+    	}
+    	//else if (logA == LOG_ZERO){
+    	else if (logSpecValEquals(logA, LOG_ZERO)){
+    		logA = logB;
+    	}
+    	//else if(logB == MARK){
+    	else if(logSpecValEquals(logB, MARK)){
+    		logA = logA;
+    	}
+    	//else if(logB == LOG_ZERO){
+    	else if(logSpecValEquals(logB, LOG_ZERO)){
+    		logA = logA;
+    	}
+    	//Nither logA nor logB is MARK/LOG_ZERO
+    	//logA < 0 && logB < 0
+    	else{
+    		//1.1
+			//Gaurd logB-logA <= 100 to avoid that exp(logB-logA) go to inf
+    		if(logB - logA <= 100 ){
+    			logA = logA + log( 1 + exp(logB-logA) );
+
+    		} 
+    		//1.2		
+    		//if logB - logA > 100, then logB > 100 + logA so that B is much bigger than A (B > e^100 * A)
+    		//    So (A + B) almost = B 
+    		else{
+    			//logA = logB; 
+	    		//The following is the real formula,; but it is almost same as //logA = logB; 
+	    		logA = logB + log( exp(logA - logB) + 1);
+    		}
+    		
+    	}
+}// end of void logAdd_New(double & logA, double & logB)
+
+//Pre:
+//  (logA != MARK) and (if logB != LOG_ZERO then logA !=LOG_ZERO) and (logA < 0); (i.e. logA has been assigned some value)
+//  if logB != MARK/LOG_ZERO, then logA >= logB
+
+void logMinus_New(double & logA, double & logB){
+	    //if(logA == MARK){
+	    if(logSpecValEquals(logA, MARK)){
+    		cerr << "Error: logMinus_New(double & logA, double & logB): logA == MARK\n"; 
+    		exit(1);
+    	}
+    	//else if (logA == LOG_ZERO && logB != LOG_ZERO){
+    	else if (logSpecValEquals(logA, LOG_ZERO) && ! logSpecValEquals(logB, LOG_ZERO)){
+    		cerr << "Error: logMinus_New(double & logA, double & logB): logA == LOG_ZERO && logB != LOG_ZERO\n"; 
+    		exit(1);
+    	}
+    	//else if(logB == MARK){
+    	else if(logSpecValEquals(logB, MARK)){
+    		logA = logA;
+    	}
+    	//else if(logB == LOG_ZERO){
+    	else if(logSpecValEquals(logB, LOG_ZERO)){
+    		logA = logA;
+    	}
+    	//Nither logA nor logB is MARK/LOG_ZERO
+    	//logA >= logB
+    	else{
+    		if(logA == logB){
+    			logA = LOG_ZERO;
+    		}
+    		//logA > logB
+    		else{
+    			if(logA > logB){
+    				logA = logA + log(1 - exp(logB-logA));
+    			}
+    			//if logA < logB
+    			//Note: this is the case which only occurs in 
+    			//	sub_h_Fast_Details() and sub_RR_Fast_Details() for the testing; it should not happen generally
+    			else{
+    				cerr << "Warning: logMinus_New(double & logA, double & logB): logA < logB" << endl;
+    				logA = -( logB + log(1 - exp(logA-logB)) );
+    			}
+
+    			
+    		}
+    		
+    	}
+} // end of void logMinus_New(double & logA, double & logB)
+
+
+//Add: modified from void logMinus_New(double & logA, double & logB)
+
+//Only for void sub_RR_Fast_TSize() and void sub_h_Fast_TSize()
+//Pre:
+//  (logA != MARK) and 
+//  (logB != MARK) and 
+//   both logA >= logB and logA < logB are allowed
+// Post:
+//	if logA < logB, then return LOG_ZERO bound
+//  ow, return the correctly exact answer
+void logMinus_New_NonnegRes(double & logA, double & logB){
+	    //if(logA == MARK){
+	    if(logSpecValEquals(logA, MARK)){
+    		cerr << "Error: logMinus_New_NonnegRes(double & logA, double & logB): logA == MARK\n"; 
+    		exit(1);
+    	}
+    	//else if(logB == MARK){
+    	else if(logSpecValEquals(logB, MARK)){
+    		cerr << "Error: logMinus_New_NonnegRes(double & logA, double & logB): logB == MARK\n"; 
+    		exit(1);
+    	}
+    	//else if(logB == LOG_ZERO){
+    	else if(logSpecValEquals(logB, LOG_ZERO)){
+    		logA = logA;
+    	}
+    	//Nither logA nor logB is MARK/LOG_ZERO
+    	//logA >= logB
+    	else{
+    		if(logA == logB){
+    			logA = LOG_ZERO;
+    		}
+    		//logA > logB
+    		else{
+    			if(logA > logB){
+    				logA = logA + log(1 - exp(logB-logA));
+    			}
+    			//if logA < logB, return LOG_ZERO as the bound
+    			//Note: this is the case which only occurs in 
+    			//	sub_h_Fast_TSize() and sub_RR_Fast_TSize();
+    			else{
+    				logA = LOG_ZERO;
+    			}
+	
+    		}
+    		
+    	}
+} // end of void logMinus_New_NonnegRes(double & logA, double & logB)
+
+
+//call by reference to the original value
+//the log sum result is stored in logA
+void logAddComp(double & logA, double & logB){
+
+    	//if(logA == MARK){
+	    if(logSpecValEquals(logA, MARK)){
+    		logA = logB;
+    	}
+    	//else if (logA == LOG_ZERO){
+    	else if (logSpecValEquals(logA, LOG_ZERO)){
+    		logA = logB;
+    	}
+    	//else if(logB == MARK){
+    	else if(logSpecValEquals(logB, MARK)){
+    		logA = logA;
+    	}
+    	//else if(logB == LOG_ZERO){
+    	else if(logSpecValEquals(logB, LOG_ZERO)){
+    		logA = logA;
+    	}
+    	
+    	
+    	//Nither logA nor logB is MARK/LOG_ZERO
+    	else{
+    		//1
+    		if(logA < 0 && logB < 0 ){
+    			//1.1
+				//Gaurd logB-logA <= 100 to avoid that exp(logB-logA) go to inf
+	    		if(logB - logA <= 100 ){
+	    			logA = logA + log( 1 + exp(logB-logA) );
+	
+	    		} 
+	    		//1.2		
+	    		//if logB - logA > 100, then logB > 100 + logA so that B is much bigger than A (B > e^100 * A)
+	    		//    So (A + B) almost = B 
+	    		else{
+	    			//logA = logB; 
+		    		//The following is the real formula,; but it is almost same as //logA = logB; 
+		    		logA = logB + log( exp(logA - logB) + 1);
+	    		}
+    		}
+    		
+    		//2
+    		else if(logA > 0 && logB > 0){
+    			//always make exp(.): . > 0
+    			if(-logB + logA <= 100){
+    				//2.1
+    				logA = -( -logA + log( 1 + exp(-logB+logA) ) );
+    			} 			
+    			else{
+    				//2.2
+    				logA = -( -logB + log( 1 + exp(-logA+logB) ) );
+    			}
+    			
+    		}
+    		//3
+    		else if(logA < 0 && logB > 0){
+    			//3.1
+    			if(logA + logB > 0){   	
+    				if(logA + logB <= 100){
+    					//3.1.2
+    					logA = -logB + log( exp(logA + logB) - 1 );
+    				}	
+    				else{
+    					//3.1.1
+    					logA = logA + log( 1 - exp(-logB-logA) );
+    				}	
+	
+    			}
+    			//3.2
+    			else if(logA + logB < 0){
+    				if(-logA - logB <= 100){
+    					//3.2.2
+    					logA = -( logA + log( exp(-logB-logA)  - 1) );
+    				}
+    				else{
+    					//3.2.1
+    					logA = - ( -logB + log(1 - exp(logA+logB) ) );
+    				}
+
+    			}
+    			//3.3
+    			else{
+    				logA = LOG_ZERO;
+    			}
+    		}
+    		//4
+    		else if(logA > 0 && logB < 0){
+    			//4.1
+    			if(logA + logB > 0){
+    				if(logA + logB <= 100){
+    					//4.1.2
+    					logA = -logA + log( exp(logB+logA) - 1);
+    				}
+    				else{
+    					//4.1.1
+    					logA = logB + log( 1 - exp(-logA-logB) );
+    				}
+    				
+    			}
+    			//4.2
+    			else if(logA + logB < 0){
+    				if(-logA-logB <= 100){
+    					//4.2.2
+    					logA = -( logB + log( exp(-logA-logB) - 1) );
+    				}
+    				else{
+    					//4.2.1
+    					logA = -( -logA + log(1 - exp(logB+logA)) );
+    				}
+	
+    			}
+    			//4.3
+    			else{
+    				logA = LOG_ZERO;
+    			}			
+    		}
+		
+    	}
+	
+} // end of void logAddComp(double & logA, double & logB)
+
+    	
+    	
+//#include <vector>
+
+//forward
+double * hFunc;
+double * hFuncNume;
+
+
+//backward
+//AA_S = new double [S+1];
+double * AA_S;
+
+double * RRFunc;
+double * RRFuncNume;
+
+
+//mixIndegree
+double * Eta_U;
+double ** KFunc;
+
+//In_Out
+double * RRFuncInOut;
+
+//ofstream totalOfMixEta("debugEngineMixForEta_U.txt");
+
+void printIntArr(int * TSet, int leng){
+		for(int ind = 0; ind < leng; ind++){
+			cout << "Set[" << ind << "]=" << TSet[ind] << endl;
+		}	
+}
+
+
+int binIntLen(int S){
+	int SSetLen = 0;
+
+	while(S > 0){ 
+		if(S & 1){
+			SSetLen++;
+			
+		}
+		S >>= 1;
+	}
+	return SSetLen;
+	
+}
+
+
+void binIntToDecIntArr(int S, int ones, int *SSet){
+	int posFromLeft = 0;
+	int ind = 0;
+	while(S > 0){ 
+		if(S & 1){
+			SSet[ind++] = posFromLeft;
+			
+		}
+		S >>= 1;
+		posFromLeft++;
+	}
+	//printIntArr(SSet, ones);
+	
+}
+
+
+
+//HR: Compute F(S, T)
+double compute_f(int nh, int S, int T, int sizeofT, int *TSet, double * h, double ** alpha){
+	
+
+	double result_f = MARK;
+	double result_h = h[S-T];
+	//LOGADD(result_f, result_h);
+	result_f = result_h;
+	if (result_f == LOG_ZERO){
+		return result_f;
+	}
+
+	
+	for(int index = 0; index < sizeofT; index++){
+		int j = TSet[index];
+		double result_A = alpha[j][S-T];
+		//result_f += result_A;
+		if (result_A == LOG_ZERO){
+			return LOG_ZERO;
+		}
+		else{
+			result_f += result_A;
+		}
+	}
+	return result_f;
+}
+
+
+//HR: Compute: \sum_{k=1}^{|S|} (-1)^{k+1} \sum{T \subset S, |T|=k} F(S,T)
+void rec_compute_sum_F_S_T(
+	int d,
+	int nh, 
+	int S, 
+	int ones, 
+	int * SSet, 
+	int T,
+	int sizeofT,
+	int * TSet,
+	double * h, 
+	double ** alpha, 
+	double & sumOdd, 
+	double & sumEven)
+{
+
+	if(d < nh){	
+		rec_compute_sum_F_S_T(d+1, nh, S, ones, SSet, T, sizeofT, TSet, h, alpha, sumOdd, sumEven);
+		
+		//the binary repre of S has 1 in d'th position (starting from 0) from right
+		if(((S>>d) & 1) == 1){
+			TSet[sizeofT] = d;
+			rec_compute_sum_F_S_T(d+1, nh, S, ones, SSet, (T | (1<<d)), (sizeofT + 1), TSet, h, alpha, sumOdd, sumEven);
+		}
+	}
+	else{
+		if(sizeofT == 0){
+			//|T| == 0 does not count
+			return;
+			
+		}
+		else{	
+			double result_F = compute_f(nh, S, T, sizeofT, TSet, h, alpha);
+			//sizeofT is odd
+			if(sizeofT % 2 == 1){				
+				logAdd_New(sumOdd, result_F);
+				//LOGADD_NEW(sumOdd, result_F);
+			}
+			else{
+				logAdd_New(sumEven, result_F);
+				//LOGADD_NEW(sumEven, result_F);
+			}
+			
+		}
+		
+	}
+} // end rec_compute_sum_F_S_T()
+
+	
+//HR: Compute: \sum_{k=1}^{|S|} (-1)^{k+1} \sum{T \subset S, |T|=k} F(S,T)
+void compute_sum_F_S_T(int nh, int S, int ones, int * SSet, double * h, double ** alpha, double & sumOdd, double & sumEven){
+	//TSet's length is set to be SSet's length: it is fine since each TSetLen is set accordingly to each subset T;
+	int * TSet = new int[ones];
+	rec_compute_sum_F_S_T(0, nh, S, ones, SSet, 0, 0, TSet, h, alpha, sumOdd, sumEven);
+	delete[] TSet;
+	
+} // end compute_sum_F_S_T()
+
+
+void sub_h_Fast(int d, int nh, int S, int ones, int * SSet, double * h, double ** alpha){
+	if(d < nh){
+		
+		//this kind of ordering in the recursion is crucial; 
+		//it guarantee when you want to compute one S, all its subsets have already been computed
+		sub_h_Fast(d+1, nh, S, ones, SSet, h, alpha);
+		
+		SSet[ones] = d;
+		sub_h_Fast(d+1, nh, S|(1<<d), (ones+1), SSet, h, alpha);
+	}
+	//d == nh
+	else{
+		//S = 0 means that S is the empty set; 
+		if(S == 0){
+			h[0] = 0; //log(1) = 0;
+			//cout << "h[0] = 0" << endl;
+			//cout << endl;
+			return;
+
+		}
+		
+		//if S > 0
+		double sumOdd = MARK;
+		double sumEven = MARK;
+		
+		
+		compute_sum_F_S_T(nh, S, ones, SSet, h, alpha, sumOdd, sumEven);
+		
+		//if sumEven has been assigned some value instead of MARK
+		if(sumEven != MARK){
+			logMinus_New(sumOdd, sumEven);
+			//LOGMINUS_NEW(sumOdd, sumEven);
+		}
+						
+		h[S] = sumOdd;
+		//cout << "h[" << S << "] = "  << h[S] << endl;
+		//cout << endl;
+
+	}
+} // end sub_h_Fast()
+
+
+//HR:
+//	Compute h
+void compute_h_Fast(int nh, double * h, double ** alpha){
+	int * SSet = new int[nh];
+	
+	sub_h_Fast(0, nh, 0, 0, SSet, h, alpha);
+	
+	delete [] SSet;
+	
+} // end compute_h_Fast()
+
+
+
+
+
+//HR: Compute: \sum_{k=1}^{|S|} (-1)^{k+1} \sum{T \subset S, |T|=k} F(S,T)
+void compute_sum_F_S_T_Iter(int nh, int S, double * h, double ** alpha, double & sumOdd, double & sumEven){
+	
+	//all the subsets T of S, expect that T = 0 (empty set)
+	for(int T = 1; T <= S; T++){
+		//if T is the subset of S
+		if((S|T) == S){
+			
+			int TSetLen = binIntLen(T);
+			int * TSet = new int[TSetLen];
+			binIntToDecIntArr(T, TSetLen, TSet);
+			
+			double result_F = compute_f(nh, S, T, TSetLen, TSet, h, alpha);
+			//sizeofT is odd
+			if(TSetLen % 2 == 1){				
+				logAdd_New(sumOdd, result_F);
+				//LOGADD_NEW(sumOdd, result_F);
+			}
+			else{
+				logAdd_New(sumEven, result_F);
+				//LOGADD_NEW(sumEven, result_F);
+			}
+			
+			delete[] TSet;
+	
+		}
+	
+	}
+	
+}
+
+
+//HR:
+//	Compute h by iteration instead of recursion
+void compute_h_Iter(int nh, double * h, double ** alpha){
+	
+	//
+	h[0] = 0;
+
+	//h[S]: S: from 1 to (1<<nh)-1
+	for(int S = 1; S < (1<<nh); S++){
+		
+		double sumOdd = MARK;
+		double sumEven = MARK;
+		
+		//int ones = binIntLen(S);
+		//cout << "\nones = " << ones << endl;
+		//int * SSet = new int[ones];
+		//binIntToDecIntArr(S, ones, SSet);
+		//compute_sum_F_S_T(nh, S, ones, SSet, h, alpha, sumOdd, sumEven);
+		compute_sum_F_S_T_Iter(nh, S, h, alpha, sumOdd, sumEven);
+		
+		//if sumEven has been assigned some value instead of MARK
+		if(sumEven != MARK){
+			logMinus_New(sumOdd, sumEven);
+			//LOGMINUS_NEW(sumOdd, sumEven);
+		}
+						
+		h[S] = sumOdd;
+	}
+	
+}
+
+
+void rec_compute_AA_S(
+	int d,
+	int nh,
+	int S,
+	int ones, //leng of SSet
+    int * SSet,
+    int T,
+    int sizeofT,
+    int * TSet,
+    double * AA_S,
+    double ** alpha
+){
+
+	if(d < nh){	
+		rec_compute_AA_S(d+1, nh, S, ones, SSet, T, sizeofT, TSet, AA_S, alpha);
+		
+		//the binary repre of S has 1 in d'th position (starting from 0) from right
+		if(((S>>d) & 1) == 1){
+			TSet[sizeofT] = d;
+			rec_compute_AA_S(d+1, nh, S, ones, SSet, (T | (1<<d)), (sizeofT + 1), TSet, AA_S, alpha);
+		}
+	}
+	else{
+		if(T == 0){
+			//cout << "\nT == 0" << endl;
+			
+			AA_S[T] = 0;
+			
+			//cout << "AA_S[" << T << "]=" << AA_S[T] << endl;
+			//cout << endl;
+		}
+		else{
+			//TSet[0]: the right most element
+			//T - (1<<TSet[0]): the binary repre of the the left most biggest 
+			//                 subset of T (including all the elements of T except the right most element)
+			//(1<<nh) - 1 - S: V - S
+			//AA_S[T - (1<<TSet[0])] must have been computed
+			
+			//cout << "\nT = " << T << endl;
+			//cout << "sizeofT = " << sizeofT << endl;
+			//printIntArr(TSet, sizeofT);
+			//cout << "alpha[" << TSet[0] << "][" << (1<<nh) - 1 - S << "] = " 
+			//     << alpha[TSet[0]][(1<<nh) - 1 - S] << endl;
+			//cout << "AA_S[" << T - (1<<TSet[0]) << "] = " << AA_S[T - (1<<TSet[0])] << endl;
+			
+			//AA_S[T] = alpha[TSet[0]][(1<<nh) - 1 - S] + AA_S[T - (1<<TSet[0])];
+			
+			if(alpha[TSet[0]][(1<<nh) - 1 - S] == LOG_ZERO){
+				AA_S[T] = LOG_ZERO;
+			}
+			else{
+				AA_S[T] = alpha[TSet[0]][(1<<nh) - 1 - S] + AA_S[T - (1<<TSet[0])];
+			}
+			
+			
+			//cout << "AA_S[" << T << "]=" << AA_S[T] << endl;
+			//cout << endl;
+		}
+		
+	}
+
+
+}
+
+
+
+//	Given S \subset V,
+//  Compute all T \subset S: AA_S(T) at one time
+void compute_AA_S(
+	int nh,
+	int S,
+	int ones, //leng of SSet
+    int * SSet,
+    double * AA_S,
+    double ** alpha
+){
+	int * TSet = new int[ones];
+	rec_compute_AA_S(0, nh, S, ones, SSet, 0, 0, TSet, AA_S, alpha);
+	delete[] TSet;
+	
+}
+
+
+//	Given S \subset V,
+//  Compute all T \subset S: AA_S(T) at one time
+void compute_AA_S_Iter(
+	int nh,
+	int S,
+	//int ones, //leng of SSet
+    //int * SSet,
+    double * AA_S,
+    double ** alpha
+){
+
+    AA_S[0] = 0;
+    
+	//all the subsets T of S, expect that T = 0 (empty set)
+	for(int T = 1; T <= S; T++){
+		//if T is the subset of S
+		if((S|T) == S){
+			
+			int TSetLen = binIntLen(T);
+			int * TSet = new int[TSetLen];
+			binIntToDecIntArr(T, TSetLen, TSet);
+			
+			//TSet[TSetLen-1]: the left most element
+			//T - (1<<TSet[TSetLen-1]): the binary repre of the the right most biggest 
+			//                 subset of T (including all the elements of T except the left most element)
+			//(1<<nh) - 1 - S: V - S
+			//AA_S[T - (1<<TSet[TSetLen-1])] must have been computed
+			
+			AA_S[T] = alpha[TSet[TSetLen-1]][(1<<nh) - 1 - S] + AA_S[T - (1<<TSet[TSetLen-1])];
+			
+			delete[] TSet;
+	
+		}
+	
+	}
+	
+}
+
+
+
+
+//HR: Compute RF(S, T)
+double compute_RF(int nh, int S, int T, int sizeofT, int *TSet, double * RR, double ** alpha){
+	
+	double result_RF = MARK;
+	double result_RR = RR[S-T];
+	//LOGADD(result_f, result_h);
+	result_RF = result_RR;
+	if (result_RF == LOG_ZERO){
+		return result_RF;
+	}
+
+	//AA_S has been computed
+	if(AA_S[T] == LOG_ZERO){
+		return LOG_ZERO;
+	}
+	else{
+		result_RF += AA_S[T];
+	}
+	
+	return result_RF;
+}
+
+
+
+//HR: Compute: \sum_{k=1}^{|S|} (-1)^{k+1} \sum{T \subset S, |T|=k} RF(S,T)
+void rec_compute_sum_RF_S_T(
+	int d,
+	int nh, 
+	int S, 
+	int ones, 
+	int * SSet, 
+	int T,
+	int sizeofT,
+	int * TSet,
+	double * RR, 
+	double ** alpha, 
+	double & sumOdd, 
+	double & sumEven)
+{
+
+	if(d < nh){	
+		rec_compute_sum_RF_S_T(d+1, nh, S, ones, SSet, T, sizeofT, TSet, RR, alpha, sumOdd, sumEven);
+		
+		//the binary repre of S has 1 in d'th position (starting from 0) from right
+		if(((S>>d) & 1) == 1){
+			TSet[sizeofT] = d;
+			rec_compute_sum_RF_S_T(d+1, nh, S, ones, SSet, (T | (1<<d)), (sizeofT + 1), TSet, RR, alpha, sumOdd, sumEven);
+		}
+	}
+	else{
+		if(sizeofT == 0){
+			//|T| == 0 does not count
+			return;
+			
+		}
+		else{	
+			double result_RF = compute_RF(nh, S, T, sizeofT, TSet, RR, alpha);
+			//sizeofT is odd
+			if(sizeofT % 2 == 1){				
+				logAdd_New(sumOdd, result_RF);
+				//LOGADD_NEW(sumOdd, result_RF);
+			}
+			else{
+				logAdd_New(sumEven, result_RF);
+				//LOGADD_NEW(sumEven, result_RF);
+			}
+			
+		}
+		
+	}
+} // end rec_compute_sum_RF_S_T()
+
+	
+
+
+//HR: Compute: \sum_{k=1}^{|S|} (-1)^{k+1} \sum{T \subset S, |T|=k} RF(S,T)
+void compute_sum_RF_S_T(int nh, int S, int ones, int * SSet, double * RR, double ** alpha, double & sumOdd, double & sumEven){
+	
+	int * TSet = new int[ones];
+	rec_compute_sum_RF_S_T(0, nh, S, ones, SSet, 0, 0, TSet, RR, alpha, sumOdd, sumEven);
+	delete[] TSet;
+	
+} // end compute_sum_RF_S_T()
+
+
+void sub_RR_Fast(int d, int nh, int S, int ones, int * SSet, double * RR, double ** alpha){
+	if(d < nh){
+		sub_RR_Fast(d+1, nh, S, ones, SSet, RR, alpha);
+		
+		SSet[ones] = d;
+		sub_RR_Fast(d+1, nh, S|(1<<d), (ones+1), SSet, RR, alpha);
+	}
+	//d == nh
+	else{
+		//S = 0 means that S is the empty set; 
+		if(S == 0){
+			RR[0] = 0; //log(1) = 0;
+			//cout << "R[0] = 0" << endl;
+			//cout << endl;
+			return;
+
+		}
+		
+		//For given S, for all T \subset S, Compute AA_S[T]
+		AA_S = new double [S+1];
+		compute_AA_S(nh, S, ones, SSet, AA_S, alpha);	
+		//compute_AA_S_Iter(nh, S, AA_S, alpha);		
+		
+		double sumOdd = MARK;
+		double sumEven = MARK;
+		
+		
+		compute_sum_RF_S_T(nh, S, ones, SSet, RR, alpha, sumOdd, sumEven);
+			
+		//if sumEven has been assigned some value instead of MARK
+		if(sumEven != MARK){
+			logMinus_New(sumOdd, sumEven);
+			//LOGMINUS_NEW(sumOdd, sumEven);
+		}
+	
+		RR[S] = sumOdd;
+		delete[] AA_S;
+
+	}
+} // end sub_RR_Fast()
+
+
+
+
+
+
+
+//HR:
+//	Compute RR
+void compute_RR_Fast(int nh, double * RR, double ** alpha){
+	int * SSet = new int[nh];
+	
+	sub_RR_Fast(0, nh, 0, 0, SSet, RR, alpha);
+	
+	delete[] SSet;
+	
+} // end compute_RR_Fast()
+
+
+//HR: Compute: \sum_{k=1}^{|S|} (-1)^{k+1} \sum{T \subset S, |T|=k} RF(S,T)
+void rec_compute_sum_RF_S_T_TSize(
+	int d,
+	int nh, 
+	int S, 
+	int ones, 
+	int * SSet, 
+	int T,
+	int sizeofT,
+	int * TSet,
+	double * RR, 
+	double ** alpha, 
+	double & sumOdd, 
+	double & sumEven,
+	int TSize)
+{
+
+	if(d < nh){	
+		rec_compute_sum_RF_S_T_TSize(d+1, nh, S, ones, SSet, T, sizeofT, TSet, RR, alpha, sumOdd, sumEven, TSize);
+		
+		//the binary repre of S has 1 in d'th position (starting from 0) from right
+		if(((S>>d) & 1) == 1){
+			TSet[sizeofT] = d;
+			rec_compute_sum_RF_S_T_TSize(d+1, nh, S, ones, SSet, (T | (1<<d)), (sizeofT + 1), TSet, RR, alpha, sumOdd, sumEven, TSize);
+		}
+	}
+	else{
+		if(sizeofT == 0){
+			//|T| == 0 does not count
+			return;
+			
+		}
+		//HR: new for *_TSize
+		else if(sizeofT <= TSize){
+		//else{	
+			double result_RF = compute_RF(nh, S, T, sizeofT, TSet, RR, alpha);
+			//sizeofT is odd
+			if(sizeofT % 2 == 1){				
+				logAdd_New(sumOdd, result_RF);
+				//LOGADD_NEW(sumOdd, result_RF);
+			}
+			else{
+				logAdd_New(sumEven, result_RF);
+				//LOGADD_NEW(sumEven, result_RF);
+			}
+			
+		}
+		
+	}
+} // end rec_compute_sum_RF_S_T_TSize()
+
+
+//HR: Compute: \sum_{k=1}^{|S|} (-1)^{k+1} \sum{T \subset S, |T|=k} RF(S,T)
+void compute_sum_RF_S_T_TSize(int nh, int S, int ones, int * SSet, double * RR, double ** alpha, double & sumOdd, double & sumEven, int TSize){
+	
+	int * TSet = new int[ones];
+	rec_compute_sum_RF_S_T_TSize(0, nh, S, ones, SSet, 0, 0, TSet, RR, alpha, sumOdd, sumEven, TSize);
+	delete[] TSet;
+	
+	
+}// end compute_sum_RF_S_T_TSize()
+
+
+
+void sub_RR_Fast_TSize(int d, int nh, int S, int ones, int * SSet, double * RR, double ** alpha, int TSize){
+	if(d < nh){
+		sub_RR_Fast_TSize(d+1, nh, S, ones, SSet, RR, alpha, TSize);
+		
+		SSet[ones] = d;
+		sub_RR_Fast_TSize(d+1, nh, S|(1<<d), (ones+1), SSet, RR, alpha, TSize);
+	}
+	//d == nh
+	else{
+		//S = 0 means that S is the empty set; 
+		if(S == 0){
+			RR[0] = 0; //log(1) = 0;
+			//cout << "R[0] = 0" << endl;
+			//cout << endl;
+			return;
+
+		}
+		
+		//For given S, for all T \subset S, Compute AA_S[T]
+		AA_S = new double [S+1];
+		compute_AA_S(nh, S, ones, SSet, AA_S, alpha);	
+		//compute_AA_S_Iter(nh, S, AA_S, alpha);		
+		
+		double sumOdd = MARK;
+		double sumEven = MARK;
+		
+		
+		compute_sum_RF_S_T_TSize(nh, S, ones, SSet, RR, alpha, sumOdd, sumEven, TSize);
+		
+		
+		//if sumEven has been assigned some value instead of MARK
+		if(sumEven != MARK){
+			logMinus_New_NonnegRes(sumOdd, sumEven);
+			//logMinus_New(sumOdd, sumEven);
+			//LOGMINUS_NEW(sumOdd, sumEven);
+		}
+	
+		RR[S] = sumOdd;
+		delete[] AA_S;
+
+	}
+}// end sub_RR_Fast_TSize()
+
+
+//HR:
+//	Compute RR
+void compute_RR_Fast_TSize(int nh, double * RR, double ** alpha, int TSize){
+	int * SSet = new int[nh];
+	
+	sub_RR_Fast_TSize(0, nh, 0, 0, SSet, RR, alpha, TSize);
+	 
+	delete[] SSet;
+	
+} // end compute_RR_Fast_TSize()
+
+
+
+void rec_compute_sum_F_S_T_Details(
+	int d,
+	int nh, 
+	int S, 
+	int ones, 
+	int * SSet, 
+	int T,
+	int sizeofT,
+	int * TSet,
+	double * h, 
+	double ** alpha, 
+	double & sumOdd, 
+	double & sumEven,
+	double * FSum)
+{
+
+	if(d < nh){	
+		rec_compute_sum_F_S_T_Details(d+1, nh, S, ones, SSet, T, sizeofT, TSet, h, alpha, sumOdd, sumEven, FSum);
+		
+		//the binary repre of S has 1 in d'th position (starting from 0) from right
+		if(((S>>d) & 1) == 1){
+			TSet[sizeofT] = d;
+			rec_compute_sum_F_S_T_Details(d+1, nh, S, ones, SSet, (T | (1<<d)), (sizeofT + 1), TSet, h, alpha, sumOdd, sumEven, FSum);
+		}
+	}
+	else{
+		if(sizeofT == 0){
+			//|T| == 0 does not count
+			return;
+			
+		}
+		else{	
+			double result_F = compute_f(nh, S, T, sizeofT, TSet, h, alpha);
+			//sizeofT is odd
+			if(sizeofT % 2 == 1){				
+				logAdd_New(sumOdd, result_F);
+				//LOGADD_NEW(sumOdd, result_F);
+				
+			}
+			else{
+				logAdd_New(sumEven, result_F);
+				//LOGADD_NEW(sumEven, result_F);
+			}
+			
+			//FSum[sizeofT - 1] stores the sum_{T \subset S, |T| = sizeofT} F(S,T)
+			logAdd_New(FSum[sizeofT - 1], result_F);
+			//LOGADD_NEW(sumEven, result_F);
+			
+			
+			
+		}
+		
+	}
+}
+
+	
+
+void compute_sum_F_S_T_Details(int nh, int S, int ones, int * SSet, double * h, double ** alpha, double & sumOdd, double & sumEven, double * FSum){
+	//TSet's length is set to be SSet's length: it is fine since each TSetLen is set accordingly to each subset T;
+	int * TSet = new int[ones];
+	rec_compute_sum_F_S_T_Details(0, nh, S, ones, SSet, 0, 0, TSet, h, alpha, sumOdd, sumEven, FSum);
+	delete[] TSet;
+	
+	
+}
+
+
+void sub_h_Fast_Details(int d, int nh, int S, int ones, int * SSet, double * h, double ** alpha, double * FSum){
+	if(d < nh){
+		
+		//this kind of ordering in the recursion is crucial; 
+		//it guarantee when you want to compute one S, all its subsets have already been computed
+		sub_h_Fast_Details(d+1, nh, S, ones, SSet, h, alpha, FSum);
+		
+		SSet[ones] = d;
+		sub_h_Fast_Details(d+1, nh, S|(1<<d), (ones+1), SSet, h, alpha, FSum);
+	}
+	//d == nh
+	else{
+		//S = 0 means that S is the empty set; 
+		if(S == 0){
+			h[0] = 0; //log(1) = 0;
+			//cout << "h[0] = 0" << endl;
+			//cout << endl;
+			return;
+
+		}
+		
+		//if S > 0
+		double sumOdd = MARK;
+		double sumEven = MARK;
+		
+		if(S < (1 << nh) - 1 ){
+			compute_sum_F_S_T(nh, S, ones, SSet, h, alpha, sumOdd, sumEven);
+		}
+		//S == (1 << nh) - 1
+		else{
+			compute_sum_F_S_T_Details(nh, S, ones, SSet, h, alpha, sumOdd, sumEven, FSum);
+		}
+		
+		
+		//if sumEven has been assigned some value instead of MARK
+		if(sumEven != MARK){
+			logMinus_New(sumOdd, sumEven);
+			//LOGMINUS_NEW(sumOdd, sumEven);
+		}
+						
+		h[S] = sumOdd;
+		//cout << "h[" << S << "] = "  << h[S] << endl;
+		//cout << endl;
+
+	}
+}
+
+
+void compute_h_Fast_Details(int nh, double * h, double ** alpha, double * FSum){
+	int * SSet = new int[nh];
+	
+	sub_h_Fast_Details(0, nh, 0, 0, SSet, h, alpha, FSum);
+	
+	delete [] SSet;
+	
+}
+
+
+
+//HR: Compute: \sum_{k=1}^{|S|} (-1)^{k+1} \sum{T \subset S, |T|=k} F(S,T)
+void rec_compute_sum_F_S_T_TSize(
+	int d,
+	int nh, 
+	int S, 
+	int ones, 
+	int * SSet, 
+	int T,
+	int sizeofT,
+	int * TSet,
+	double * h, 
+	double ** alpha, 
+	double & sumOdd, 
+	double & sumEven,
+	int TSize)
+{
+
+	if(d < nh){	
+		rec_compute_sum_F_S_T_TSize(d+1, nh, S, ones, SSet, T, sizeofT, TSet, h, alpha, sumOdd, sumEven, TSize);
+		
+		//the binary repre of S has 1 in d'th position (starting from 0) from right
+		if(((S>>d) & 1) == 1){
+			TSet[sizeofT] = d;
+			rec_compute_sum_F_S_T_TSize(d+1, nh, S, ones, SSet, (T | (1<<d)), (sizeofT + 1), TSet, h, alpha, sumOdd, sumEven, TSize);
+		}
+	}
+	else{
+		if(sizeofT == 0){
+			//|T| == 0 does not count
+			return;
+			
+		}
+		//else {	
+		//HR: new for *_TSize
+		else if(sizeofT <= TSize){
+			double result_F = compute_f(nh, S, T, sizeofT, TSet, h, alpha);
+			//sizeofT is odd
+			if(sizeofT % 2 == 1){		
+			//if(sizeofT % 2 == 1 && sizeofT <= TSize){			
+				logAdd_New(sumOdd, result_F);
+				//LOGADD_NEW(sumOdd, result_F);
+			}
+			else{
+			//else if(sizeofT % 2 == 0 && sizeofT <= TSize){
+				logAdd_New(sumEven, result_F);
+				//LOGADD_NEW(sumEven, result_F);
+			}
+			
+		}
+		
+	}
+} // end rec_compute_sum_F_S_T_TSize()
+
+
+
+//HR: Compute: \sum_{k=1}^{|S|} (-1)^{k+1} \sum{T \subset S, |T|=k} F(S,T)
+void compute_sum_F_S_T_TSize(int nh, int S, int ones, int * SSet, double * h, double ** alpha, double & sumOdd, double & sumEven, int TSize){
+	//TSet's length is set to be SSet's length: it is fine since each TSetLen is set accordingly to each subset T;
+	int * TSet = new int[ones];
+	rec_compute_sum_F_S_T_TSize(0, nh, S, ones, SSet, 0, 0, TSet, h, alpha, sumOdd, sumEven, TSize);
+	delete[] TSet;
+	
+	
+}
+
+
+void sub_h_Fast_TSize(int d, int nh, int S, int ones, int * SSet, double * h, double ** alpha, int TSize){
+	if(d < nh){
+		
+		//this kind of ordering in the recursion is crucial; 
+		//it guarantee when you want to compute one S, all its subsets have already been computed
+		sub_h_Fast_TSize(d+1, nh, S, ones, SSet, h, alpha, TSize);
+		
+		SSet[ones] = d;
+		sub_h_Fast_TSize(d+1, nh, S|(1<<d), (ones+1), SSet, h, alpha, TSize);
+	}
+	//d == nh
+	else{
+		//S = 0 means that S is the empty set; 
+		if(S == 0){
+			h[0] = 0; //log(1) = 0;
+			//cout << "h[0] = 0" << endl;
+			//cout << endl;
+			return;
+
+		}
+		
+		//if S > 0
+		double sumOdd = MARK;
+		double sumEven = MARK;
+		
+		
+		compute_sum_F_S_T_TSize(nh, S, ones, SSet, h, alpha, sumOdd, sumEven, TSize);
+		
+		//if sumEven has been assigned some value instead of MARK
+		if(sumEven != MARK){
+			logMinus_New_NonnegRes(sumOdd, sumEven);
+			//logMinus_New(sumOdd, sumEven);
+			//LOGMINUS_NEW(sumOdd, sumEven);
+		}
+						
+		h[S] = sumOdd;
+		//cout << "h[" << S << "] = "  << h[S] << endl;
+		//cout << endl;
+
+	}
+} // end sub_h_Fast_TSize()
+
+
+//HR:
+//	Compute h
+
+void compute_h_Fast_TSize(int nh, double * h, double ** alpha, int TSize){
+	int * SSet = new int[nh];
+	
+	sub_h_Fast_TSize(0, nh, 0, 0, SSet, h, alpha, TSize);
+	
+	delete [] SSet;
+	
+} // end compute_h_Fast_TSize()
+
+
+
+
+void rec_compute_sum_RF_S_T_Details(
+	int d,
+	int nh, 
+	int S, 
+	int ones, 
+	int * SSet, 
+	int T,
+	int sizeofT,
+	int * TSet,
+	double * RR, 
+	double ** alpha, 
+	double & sumOdd, 
+	double & sumEven,
+	double * RFSum)
+{
+
+	if(d < nh){	
+		rec_compute_sum_RF_S_T_Details(d+1, nh, S, ones, SSet, T, sizeofT, TSet, RR, alpha, sumOdd, sumEven, RFSum);
+		
+		//the binary repre of S has 1 in d'th position (starting from 0) from right
+		if(((S>>d) & 1) == 1){
+			TSet[sizeofT] = d;
+			rec_compute_sum_RF_S_T_Details(d+1, nh, S, ones, SSet, (T | (1<<d)), (sizeofT + 1), TSet, RR, alpha, sumOdd, sumEven, RFSum);
+		}
+	}
+	else{
+		if(sizeofT == 0){
+			//|T| == 0 does not count
+			return;
+			
+		}
+		else{	
+			double result_RF = compute_RF(nh, S, T, sizeofT, TSet, RR, alpha);
+			//sizeofT is odd
+			if(sizeofT % 2 == 1){				
+				logAdd_New(sumOdd, result_RF);
+				//LOGADD_NEW(sumOdd, result_RF);
+			}
+			else{
+				logAdd_New(sumEven, result_RF);
+				//LOGADD_NEW(sumEven, result_RF);
+			}
+			//RFSum[sizeofT - 1] stores the sum_{T \subset S, |T| = sizeofT} RF(S,T)
+			logAdd_New(RFSum[sizeofT - 1], result_RF);
+			//LOGADD_NEW(RFSum[sizeofT - 1], result_RF);
+			
+		}
+		
+	}
+}
+
+
+
+void compute_sum_RF_S_T_Details(int nh, int S, int ones, int * SSet, double * RR, double ** alpha, double & sumOdd, double & sumEven, double * RFSum){
+	
+	int * TSet = new int[ones];
+	rec_compute_sum_RF_S_T_Details(0, nh, S, ones, SSet, 0, 0, TSet, RR, alpha, sumOdd, sumEven, RFSum);
+	delete[] TSet;
+	
+	
+}
+
+
+
+void sub_RR_Fast_Details(int d, int nh, int S, int ones, int * SSet, double * RR, double ** alpha, double * RFSum){
+	if(d < nh){
+		sub_RR_Fast_Details(d+1, nh, S, ones, SSet, RR, alpha, RFSum);
+		
+		SSet[ones] = d;
+		sub_RR_Fast_Details(d+1, nh, S|(1<<d), (ones+1), SSet, RR, alpha, RFSum);
+	}
+	//d == nh
+	else{
+		//S = 0 means that S is the empty set; 
+		if(S == 0){
+			RR[0] = 0; //log(1) = 0;
+			//cout << "R[0] = 0" << endl;
+			//cout << endl;
+			return;
+
+		}
+		
+		//For given S, for all T \subset S, Compute AA_S[T]
+		AA_S = new double [S+1];
+		compute_AA_S(nh, S, ones, SSet, AA_S, alpha);	
+		//compute_AA_S_Iter(nh, S, AA_S, alpha);		
+		
+		double sumOdd = MARK;
+		double sumEven = MARK;
+		
+		if(S < (1 << nh) - 1 ){
+			compute_sum_RF_S_T(nh, S, ones, SSet, RR, alpha, sumOdd, sumEven);
+		}
+		//if S == (1 << nh) - 1
+		else{
+			compute_sum_RF_S_T_Details(nh, S, ones, SSet, RR, alpha, sumOdd, sumEven, RFSum);
+		}
+		
+
+		
+		//if sumEven has been assigned some value instead of MARK
+		if(sumEven != MARK){
+			logMinus_New(sumOdd, sumEven);
+			//LOGMINUS_NEW(sumOdd, sumEven);
+		}
+	
+		RR[S] = sumOdd;
+		delete[] AA_S;
+
+	}
+}
+
+
+
+
+void compute_RR_Fast_Details(int nh, double * RR, double ** alpha, double * RFSum){
+	int * SSet = new int[nh];
+	
+	sub_RR_Fast_Details(0, nh, 0, 0, SSet, RR, alpha, RFSum);
+	
+	delete[] SSet;
+	
+}
+
+
+
+
+
+
+
+
+//HR: Compute: \sum_{k=1}^{|S|} (-1)^{k+1} \sum{T \subset S, |T|=k} RF(S,T)
+void compute_sum_RF_S_T_Iter(int nh, int S, double * RR, double ** alpha, double & sumOdd, double & sumEven){
+	
+	//all the subsets T of S, expect that T = 0 (empty set)
+	for(int T = 1; T <= S; T++){
+		//if T is the subset of S
+		if((S|T) == S){
+			
+			int TSetLen = binIntLen(T);
+			int * TSet = new int[TSetLen];
+			binIntToDecIntArr(T, TSetLen, TSet);
+
+			double result_RF = compute_RF(nh, S, T, TSetLen, TSet, RR, alpha);
+			//sizeofT is odd
+			if(TSetLen % 2 == 1){				
+				logAdd_New(sumOdd, result_RF);
+				//LOGADD_NEW(sumOdd, result_RF);
+			}
+			else{
+				logAdd_New(sumEven, result_RF);
+				//LOGADD_NEW(sumEven, result_RF);
+			}
+			
+			delete[] TSet;
+		}
+
+	}
+
+}
+
+//HR:
+//	Compute RR
+void compute_RR_Iter(int nh, double * RR, double ** alpha){
+	
+	
+	RR[0] = 0; //log(1) = 0;
+	
+	//RR[S]: S: from 1 to (1<<nh)-1
+	for(int S = 1; S < (1<<nh); S++){
+		//For given S, for all T \subset S, Compute AA_S[T]
+		AA_S = new double [S+1];
+		//compute_AA_S(nh, S, ones, SSet, AA_S, alpha);	
+		compute_AA_S_Iter(nh, S, AA_S, alpha);		
+		
+		double sumOdd = MARK;
+		double sumEven = MARK;
+				
+		compute_sum_RF_S_T_Iter(nh, S, RR, alpha, sumOdd, sumEven);
+		
+		//if sumEven has been assigned some value instead of MARK
+		if(sumEven != MARK){
+			logMinus_New(sumOdd, sumEven);
+			//LOGMINUS_NEW(sumOdd, sumEven);
+		}
+	
+		RR[S] = sumOdd;
+		//cout << "RR[" << S << "] = "  << h[S] << endl;
+		//cout << endl;
+
+		delete[] AA_S;
+		
+	}
+	
+}
+
+
+	
+	
+//	Given v \in V, given U \subset V-{v},
+//  Compute all T \subset (V-{v}-U) = TMax: Eta_U(T) at one time
+void rec_compute_Eta_U(
+	int d,
+	int nh,
+	int TMax,
+	int TMaxSetLen, //leng of SSet
+    int * TMaxSet,
+    int U,
+    int T,
+    int sizeofT,
+    int * TSet,
+    double * Eta_U,
+    double ** alpha
+){
+
+	if(d < nh){	
+		rec_compute_Eta_U(d+1, nh, TMax, TMaxSetLen, TMaxSet, U, T, sizeofT, TSet, Eta_U, alpha);
+		
+		//the binary repre of S has 1 in d'th position (starting from 0) from right
+		if(((TMax>>d) & 1) == 1){
+			TSet[sizeofT] = d;
+			rec_compute_Eta_U(d+1, nh, TMax, TMaxSetLen, TMaxSet, U, (T | (1<<d)), (sizeofT + 1), TSet, Eta_U, alpha);
+		}
+	}
+	else{
+		if(T == 0){
+			//cout << "\nT == 0" << endl;
+			
+			Eta_U[T] = 0;
+			
+			//cout << "AA_S[" << T << "]=" << AA_S[T] << endl;
+			//cout << endl;
+		}
+		else{
+	
+			Eta_U[T] = alpha[TSet[0]][U] + Eta_U[T - (1<<TSet[0])];
+			
+		}
+		
+	}
+
+
+}
+
+
+//	Given v \in V, given U \subset V-{v},
+//  Compute all T \subset (V-{v}-U) = TMax: Eta_U(T) at one time
+void compute_Eta_U(
+	int nh,
+	int TMax,
+	int TMaxSetLen, 
+    int * TMaxSet,
+    int U,
+    double * Eta_U,
+    double ** alpha
+){
+	int * TSet = new int[TMaxSetLen];
+	rec_compute_Eta_U(0, nh, TMax, TMaxSetLen, TMaxSet, U, 0, 0, TSet, Eta_U, alpha);
+	delete[] TSet;
+	
+}
+
+
+//	Given v \in V, given U \subset V-{v},
+//  Compute K_v(U)
+void rec_compute_K_v(
+	int d,
+	int nh,
+	int TMax,
+	int TMaxSetLen, //leng of SSet
+    int * TMaxSet,
+    int U,
+    int T,
+    int sizeofT,
+    int * TSet,
+    double * Eta_U,
+    double * K_v,
+    double ** alpha,
+    double & sumOdd,
+    double & sumEven
+){
+	if(d < nh){	
+		rec_compute_K_v(d+1, nh, TMax, TMaxSetLen, TMaxSet, U, T, sizeofT, TSet, Eta_U, K_v, alpha, sumOdd, sumEven);
+		
+		//the binary repre of S has 1 in d'th position (starting from 0) from right
+		if(((TMax>>d) & 1) == 1){
+			TSet[sizeofT] = d;
+			rec_compute_K_v(d+1, nh, TMax, TMaxSetLen, TMaxSet, U, (T | (1<<d)), (sizeofT + 1), TSet, Eta_U, K_v, alpha, sumOdd, sumEven);
+		}
+	}
+	else{
+			double abs_result = RRFunc[TMax - T] + Eta_U[T];
+			//sizeofT is odd
+			if(sizeofT % 2 == 1){				
+				logAdd_New(sumOdd, abs_result);
+				//LOGADD_NEW(sumOdd, abs_result);
+			}
+			else{
+				logAdd_New(sumEven, abs_result);
+				//LOGADD_NEW(sumEven, abs_result);
+			}
+		
+	}	
+	
+}
+
+
+
+//	Given v \in V, given U \subset V-{v},
+//  Compute K_v(U)
+void compute_K_v(
+	int nh,
+	double * K_v,
+	int v, 
+	int U,
+	int USetLen, 
+    int * USet,
+    double * Eta_U,
+    double ** alpha
+)
+
+
+{
+	//TMax = V - {v} - U
+	int TMax = (1 << nh) - 1 - (1 << v) - U;
+	int TMaxSetLen = nh - 1 - USetLen;
+	int * TMaxSet = new int[TMaxSetLen];
+	binIntToDecIntArr(TMax, TMaxSetLen, TMaxSet);
+	
+	//compute Eta_U
+	Eta_U = new double [TMax+1];
+	compute_Eta_U(nh, TMax, TMaxSetLen, TMaxSet, U, Eta_U, alpha);
+	
+//	totalOfMixEta << "\nEta_U U == " << U << ":" << endl;
+//	for(int index = 0; index < TMax+1; index++){
+//		totalOfMixEta << "Eta_U[" << index << "] = " << Eta_U[index] << endl;
+//	}
+	 
+	
+	
+	double result_K_v;
+	
+	double sumOdd = MARK;
+	double sumEven = MARK;
+	
+	int * TSet = new int[TMaxSetLen];
+	rec_compute_K_v(0, nh, TMax, TMaxSetLen, TMaxSet, U, 0, 0, TSet, Eta_U, K_v, alpha, sumOdd, sumEven);
+	
+	
+
+	// sum of itmes of Even sizeofT must have been assigned some value, since |T| = 0 must exist
+	// sum of itmes of odd sizeofT must have been assigned some value could be not assigned so that it is still MARK
+	if(sumOdd == MARK){
+		result_K_v = sumEven;	
+	}
+	else{
+		//if sum of itmes of Even sizeofT > sum of itmes of odd sizeofT, so that log(sumEven) > log(sumOdd) 
+		if(sumEven > sumOdd){
+			logMinus_New(sumEven, sumOdd);
+			//LOGMINUS_NEW(sumEven, sumOdd);
+			//result_K_v is log(prob) < 0
+			result_K_v = sumEven;
+		}
+		else if(sumEven == sumOdd){
+			//cerr<<"\n******Original K_v is zero!" << endl;
+			result_K_v = LOG_ZERO;
+		}
+		else{
+			//cerr<<"\n******Original K_v is negetive!" << endl;
+			logMinus_New(sumOdd, sumEven);
+			//LOGMINUS_NEW(sumOdd, sumEven);
+			//use result_K_v > 0 to represent negative prob
+			result_K_v = - sumOdd;
+			//cerr<<"K_v[" << U << "]" << result_K_v << endl;
+		}
+	}
+	K_v[U] = result_K_v;	
+	
+	delete[] TSet;
+	
+	delete[] Eta_U;			
+	
+
+}
+
+
+void init_all_K_v(int d, int S, double * K_v, double value, int ones, int nh){
+		//cerr<<" d: "<<d<<endl; 
+	
+	if (d < nh){
+		init_all_K_v(d+1, S, K_v, value, ones, nh);
+			
+		//HR: ones means the num of 1 bits, represeting the num of parents
+		//HR: S | (1 << d) reprents the S could have 1 bit in the d'th if current S does not have
+		//HR: if (ones < k) 
+		init_all_K_v(d+1, S | (1 << d), K_v, value, ones+1, nh);
+	}
+	else{
+		K_v[S] = value;
+		
+	}
+}
+	
+
+void rec_compute_all_K_v(
+	int d,
+	int nh,
+	int UMax,
+	int UMaxSetLen, //leng of SSet
+    int * UMaxSet,
+    int U,
+    int USetLen,
+    int * USet,
+    double * K_v,
+    int v,
+    double ** alpha
+){
+	if(d < nh){	
+		rec_compute_all_K_v(d+1, nh, UMax, UMaxSetLen, UMaxSet, U, USetLen, USet, K_v, v, alpha);
+		
+		//the binary repre of S has 1 in d'th position (starting from 0) from right
+		if(((UMax>>d) & 1) == 1){
+			USet[USetLen] = d;
+			rec_compute_all_K_v(d+1, nh, UMax, UMaxSetLen, UMaxSet, (U | (1<<d)), (USetLen + 1), USet, K_v, v, alpha);
+		}
+	}
+	else{			
+		compute_K_v(nh, K_v, v, U, USetLen, USet, Eta_U, alpha);
+	
+	}	
+	
+}
+
+
+void compute_all_K_v(
+	int nh,
+	double * K_v,
+	int v, 
+    double ** alpha
+){
+	
+	init_all_K_v(0, 0, K_v, LOG_ZERO, 0, nh);
+	
+	//UMax = V - {v} 
+	int UMax = (1 << nh) - 1 - (1 << v);
+	int UMaxSetLen = nh - 1;
+	int * UMaxSet = new int[UMaxSetLen];
+	binIntToDecIntArr(UMax, UMaxSetLen, UMaxSet);
+	
+	int * USet = new int[UMaxSetLen];
+	rec_compute_all_K_v(0, nh, UMax, UMaxSetLen, UMaxSet, 0, 0, USet, K_v, v, alpha);
+	
+	delete[] USet;
+	
+}
+
+
diff --git a/sourcecodes/k-best/src/UpdateHR2.h b/sourcecodes/k-best/src/UpdateHR2.h
new file mode 100644
index 00000000..c7deefe8
--- /dev/null
+++ b/sourcecodes/k-best/src/UpdateHR2.h
@@ -0,0 +1,511 @@
+#include<stdio.h>
+#include<stdlib.h>
+
+#include<iostream>
+#include<vector>
+#include<deque>
+#include<string>
+#include<fstream>
+#include<math.h>
+
+#include"Arguments.h"
+#include"Model.h"
+
+using namespace std;
+
+
+struct ADTreenode{
+	int count;
+	
+	//i.e. start attr which = *;
+	int startVaryNodeInd;
+	
+	//struct ADVarynode * ADVaryNodePs[];
+	struct ADVarynode ** ADVaryNodePs;
+};
+
+typedef struct ADTreenode ADTreeNode;
+
+struct ADVarynode{
+	//Represent Vary Index
+	int index;
+	
+	int mcv;
+	
+	//struct ADTreenode * ADTreeNodePs[];
+	struct ADTreenode ** ADTreeNodePs;
+	
+};
+
+typedef struct ADVarynode ADVaryNode;
+
+
+typedef struct {
+	//the count for each arrangment of contiTableAttrs
+	//contiTableCounts.size() == the product of the arity of each element in contiTableAttrs
+	//do not explicitly record the whole contiTable
+	vector<int> contiTableCounts;
+	
+	//invariant: in the decreasing order
+	vector<int> contiTableAttrs;
+	
+	//condiAttrs.size() == condiVals.size()
+	//invariant: in the increasing order
+	vector<int> condiAttrs;
+	vector<int> condiVals;
+	
+	//invariant: contiTableAttrs.size() + condiAttrs.size() == the whole original inquiry length
+	//			finally: condiAttrs.size() == 0
+} CondiContiTable;
+
+
+
+
+
+ADTreeNode * MakeADTree(int, vector<int> &, vector< vector<int> > &, vector<int> &);
+ADVaryNode * MakeVaryNode(int, vector<int> &, vector< vector<int> > &, vector<int> &);
+void PrintADTreeNode(ADTreeNode *, int, const int, vector<int> &);
+void PrintADVaryNode(ADVaryNode *, int, const int, vector<int> &);
+void FreeADTreeNode(ADTreeNode *, const int, vector<int> &);
+void FreeADVaryNode(ADVaryNode *, const int, vector<int> &);
+
+
+CondiContiTable MakeContab(deque<int>, ADTreeNode *, 
+		vector<int> &, vector<int> &, const vector<int> &);
+		
+void MinusContab(CondiContiTable &, CondiContiTable *, int, int);
+
+void ConcatContab(CondiContiTable *, int, int, CondiContiTable &);
+
+		
+
+
+
+//HR:
+//	a_i is in {0, ..., M-1}
+//  dm: the data matrix: R * M
+//  dmIndex: initially stores {0, 1, ..., R - 1}, it is just the light-weight index for dm
+//  arities: stores the arity of each attr
+//  could use vector<int> & dmIndex instead of vector<int> dmIndex
+ADTreeNode * MakeADTree(int a_i, vector<int> & dmIndex, vector< vector<int> > & dm, vector<int> & arities){
+	//M = num of attr
+	int M = dm[0].size();
+	
+	ADTreeNode * ADTreeNodeP1 = (ADTreeNode *) malloc(sizeof(ADTreeNode));
+	ADTreeNodeP1->count = dmIndex.size();
+	ADTreeNodeP1->startVaryNodeInd = a_i;
+	//base
+	if(a_i >= M){
+		ADTreeNodeP1->ADVaryNodePs = NULL;
+	}
+	else{
+		ADTreeNodeP1->ADVaryNodePs = (ADVaryNode **) malloc(sizeof(ADVaryNode*) * 
+	                              (M - 1 - a_i + 1));
+	}
+	for(int a_j = a_i; a_j <= M-1; a_j++){
+		ADTreeNodeP1->ADVaryNodePs[a_j - a_i] = MakeVaryNode(a_j, dmIndex, dm, arities);
+	}
+	return ADTreeNodeP1;
+	                              
+}//end ADTreeNode * MakeADTree()
+
+
+
+//HR:
+//	a_i is in {0, ..., M-1}
+//  dm: the data matrix: R * M
+//  dmIndex: initially stores {0, 1, ..., R - 1}
+//  arities: stores the arity of each attr
+//  could use vector<int> & dmIndex instead of vector<int> dmIndex
+ADVaryNode * MakeVaryNode(int a_i, vector<int> & dmIndex, vector< vector<int> > & dm, vector<int> & arities){
+	ADVaryNode * ADVaryNodeP1 = (ADVaryNode *) malloc(sizeof(ADVaryNode));
+	ADVaryNodeP1->index = a_i;
+	int n_i = arities[a_i];//may be used as global var
+	ADVaryNodeP1->ADTreeNodePs = (ADTreeNode **) malloc(sizeof(ADTreeNode *) * n_i);
+	vector<int> dmIndexSub[n_i];
+	for(unsigned int j = 0; j <= dmIndex.size() - 1; j++){
+		int v = dm[dmIndex[j]][a_i];
+		dmIndexSub[v].push_back(dmIndex[j]);
+	}
+	ADVaryNodeP1->mcv = 0;
+	int maxCount = dmIndexSub[0].size();
+	for(int j = 1; j <= n_i - 1; j++){
+		if((int) dmIndexSub[j].size() > maxCount){
+			maxCount = dmIndexSub[j].size();
+			ADVaryNodeP1->mcv = j;
+		}
+	}
+	for(int j = 0; j <= n_i - 1; j++){
+		if(dmIndexSub[j].size() == 0 || j == ADVaryNodeP1->mcv){
+			ADVaryNodeP1->ADTreeNodePs[j] = NULL;
+		}
+		else{
+			ADVaryNodeP1->ADTreeNodePs[j] = MakeADTree(a_i+1, dmIndexSub[j], dm, arities);
+		}
+	}
+	//not necessary in fact
+	//dmIndex.clear();
+	//HR: Neither necessary nor correct
+	//delete dmIndex;
+	return ADVaryNodeP1;
+	
+	
+}//end ADVaryNode * MakeVaryNode()
+
+
+//HR:
+//  ADTreeNodeP1: pointers to the ADTreeNode
+//  level: starting from 0 
+//  M: the num of attr
+//  arities: stores the arity of each attr 
+//  initial call: PrintADTreeNode(ADTreeNodeP1, 0, M, arities) in Model.h
+//  pre-order to print the ADtree
+void PrintADTreeNode(ADTreeNode * ADTreeNodeP1, int level, const int M, vector<int> & arities){
+	string strSpace = "";
+	for(int i = 0; i < level; i++){
+		strSpace += "  ";
+	}
+	cout << strSpace << "ADTreeNode" << endl;
+	cout << strSpace << "Count = " << ADTreeNodeP1->count << endl;
+	cout << strSpace << "startVaryNodeInd = " << ADTreeNodeP1->startVaryNodeInd << endl;
+	if(ADTreeNodeP1->ADVaryNodePs == NULL){
+		return;
+	}
+	else{
+		for(int i = 0; i < M - 1 - ADTreeNodeP1->startVaryNodeInd + 1; i++){
+			PrintADVaryNode(ADTreeNodeP1->ADVaryNodePs[i], level+1, M, arities);
+		}
+	}
+} //end void PrintADTreeNode()
+
+
+//HR:
+//  ADVaryNodeP1: pointers to the ADVaryNode
+//  level: starting from 0 
+//  M: the num of attr
+//  arities: stores the arity of each attr 
+//  pre-order to print the ADtree
+void PrintADVaryNode(ADVaryNode * ADVaryNodeP1, int level, const int M, vector<int> & arities){
+	string strSpace = "";
+	for(int i = 0; i < level; i++){
+		strSpace += "  ";
+	}
+	cout << strSpace << "ADVaryNode" << endl;
+	cout << strSpace << "index = " << ADVaryNodeP1->index << endl;
+	cout << strSpace << "mcv = " << ADVaryNodeP1->mcv << endl;
+	int n_i = arities[ADVaryNodeP1->index]; //may be changed to global var
+	for(int j = 0; j <= n_i - 1; j++){
+		if(j == ADVaryNodeP1->mcv){
+			cout << strSpace << "  mcv" << endl;		
+		}
+		else if(ADVaryNodeP1->ADTreeNodePs[j] == NULL){
+			cout << strSpace << "  NULL" << endl;
+		}
+		else{
+			PrintADTreeNode(ADVaryNodeP1->ADTreeNodePs[j], level+1, M, arities);
+		}
+	}
+
+}//end void PrintADVaryNode()
+
+
+
+//HR:
+//  ADTreeNodeP1: pointers to the ADTreeNode
+//  M: the num of attr
+//  arities: stores the arity of each attr 
+//  initial call: FreeADTreeNode(ADTreeNodeP1, M, arities) in Model.h
+//  pre-order to free the ADtree
+void FreeADTreeNode(ADTreeNode * ADTreeNodeP1, const int M, vector<int> & arities){
+
+	if(ADTreeNodeP1->ADVaryNodePs != NULL){
+		for(int i = 0; i < M - 1 - ADTreeNodeP1->startVaryNodeInd + 1; i++){
+			FreeADVaryNode(ADTreeNodeP1->ADVaryNodePs[i], M, arities);
+		}
+		free(ADTreeNodeP1->ADVaryNodePs);
+	}
+
+	free(ADTreeNodeP1);
+}  //end void FreeADTreeNode()
+
+
+//HR:
+//  ADVaryNodeP1: pointers to the ADVaryNode
+//  M: the num of attr
+//  arities: stores the arity of each attr 
+//  pre-order to free the ADtree
+void FreeADVaryNode(ADVaryNode * ADVaryNodeP1, const int M, vector<int> & arities){
+
+	int n_i = arities[ADVaryNodeP1->index]; //may be changed to global var
+	for(int j = 0; j <= n_i - 1; j++){
+		if(j == ADVaryNodeP1->mcv){
+			;		
+		}
+		else if(ADVaryNodeP1->ADTreeNodePs[j] == NULL){
+			;
+		}
+		else{
+			FreeADTreeNode(ADVaryNodeP1->ADTreeNodePs[j], M, arities);
+		}
+	}
+	free(ADVaryNodeP1->ADTreeNodePs);
+	free(ADVaryNodeP1);
+
+}//end void FreeADVaryNode()
+
+
+
+//Error: if use ofstream of1 instead of ofstream & of1
+//In file included from Model.h:19,
+//                 from main.cc:6:
+//UpdateHR2.h: In copy constructor `std::basic_ios<char, std::char_traits<char> >::basic_ios(const std::basic_ios<char, std::char_traits<char> >&)':
+///usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/ios_base.h:781: error: `std::ios_base::ios_base(const std::ios_base&)' is private
+//UpdateHR2.h:220: error: within this context
+//UpdateHR2.h: In copy constructor `std::basic_filebuf<char, std::char_traits<char> >::basic_filebuf(const std::basic_filebuf<char, std::char_traits<char> >&)':
+///usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../include/c++/3.4.6/streambuf:769: error: `std::basic_streambuf<_CharT, _Traits>::basic_streambuf(const std::basic_streambuf<_CharT, _Traits>&) [with _CharT = char, _Traits = std::char_traits<char>]' is private
+//UpdateHR2.h:220: error: within this context
+//UpdateHR2.h: In function `void print_CondiContiTable(CondiContiTable&, std::ofstream)':
+//UpdateHR2.h:220: error:   initializing argument 2 of `void print_vec(std::vector<int, std::allocator<int> >, std::ofstream)'
+
+
+void print_vec(vector<int> & vec1, ofstream & of1){
+	for(int i = 0; i < (int) vec1.size(); i++){
+		of1 << vec1[i] << " ";
+	}
+	of1 << endl;
+}
+
+void print_deque(deque<int> & v1, ofstream & of1){
+	for(int i = 0; i < (int) v1.size(); i++){
+		of1 << v1[i] << " ";
+	}
+	of1 << endl;
+}
+
+void print_CondiContiTable(CondiContiTable & ccTable1, ofstream & of1){
+	of1 << "ccTable1.contiTableCounts: " << endl;
+	print_vec(ccTable1.contiTableCounts, of1);
+	
+	of1 << "ccTable1.contiTableAttrs: " << endl;
+	print_vec(ccTable1.contiTableAttrs, of1);
+	
+	of1 << "ccTable1.condiAttrs: " << endl;
+	print_vec(ccTable1.condiAttrs, of1);
+	
+	of1 << "ccTable1.condiVals: " << endl;
+	print_vec(ccTable1.condiVals, of1);
+	
+}
+
+
+
+void print_vec(vector<int> & vec1){
+	for(int i = 0; i < (int) vec1.size(); i++){
+		cout << vec1[i] << " ";
+	}
+	cout << endl;
+}
+
+
+void print_deque(deque<int> & v1){
+	for(int i = 0; i < (int) v1.size(); i++){
+		cout << v1[i] << " ";
+	}
+	cout << endl;
+}
+
+void print_CondiContiTable(CondiContiTable & ccTable1){
+	cout << "ccTable1.contiTableCounts: " << endl;
+	print_vec(ccTable1.contiTableCounts);
+	
+	cout << "ccTable1.contiTableAttrs: " << endl;
+	print_vec(ccTable1.contiTableAttrs);
+	
+	cout << "ccTable1.condiAttrs: " << endl;
+	print_vec(ccTable1.condiAttrs);
+	
+	cout << "ccTable1.condiVals: " << endl;
+	print_vec(ccTable1.condiVals);
+	
+}
+
+
+
+//HR: 
+//	inquiryAttrs: {a_i_1, ..., a_i_n}
+//	ADNP: The current pointer to ADTreeNode
+//	givenAttrs, givenVals explicilty record the meaning of ADNP
+//	{b_i_1, ..., b_i_m} = {value_b_i_1, .. value_b_i_m}
+//	pre:
+//	inquiryAttrs is in the increasing order
+//	givenAttrs is in the increasing order
+CondiContiTable MakeContab(deque<int> inquiryAttrs, ADTreeNode * ADNP, 
+		vector<int> & givenAttrs, vector<int> & givenVals, const vector<int> & arities){
+			
+//	cout << "\nMakeContab()" << endl;
+//	cout << "inquiryAttrs" << endl;
+//	print_deque(inquiryAttrs);
+//	cout << "givenAttrs" << endl;
+//	print_vec(givenAttrs);
+//	cout << "givenVals" << endl;
+//	print_vec(givenVals);
+	
+	
+	
+	
+	//base 1
+	if(ADNP == NULL){
+		CondiContiTable bottomTable;
+		
+		//base 1.1
+		//if(inquiryAttrs.size() == 0){
+		if(inquiryAttrs.empty()){
+			bottomTable.contiTableCounts.push_back(0);
+			//bottomTable.contiTableAttrs is empty
+			bottomTable.condiAttrs = givenAttrs;
+			bottomTable.condiVals = givenVals;
+			
+			//cout << "//base 1.1: if(ADNP == NULL) and if(inquiryAttrs.empty())" << endl;
+			//print_CondiContiTable(bottomTable);
+			
+		}
+		//base 1.2
+		//if(inquiryAttrs.size() > 0)
+		else{
+			int rowNum = 1;
+			for(unsigned int i = 0; i < inquiryAttrs.size(); i++){
+				//Note: I explicitly write inquiryAttrs[inquiryAttrs.size() - 1 - i ] instead of 
+				//	inquiryAttrs[i] because this is really the ordering to create the whole contiTable
+				int lastAttr = inquiryAttrs[inquiryAttrs.size() - 1 - i ];
+				rowNum *= arities[lastAttr];
+				
+				bottomTable.contiTableAttrs.push_back(lastAttr);
+			}		
+			bottomTable.condiAttrs = givenAttrs;
+			bottomTable.condiVals = givenVals;
+			
+			for(int i = 0; i < rowNum; i++){
+				bottomTable.contiTableCounts.push_back(0);
+			}
+			
+			//cout << "//base 1.2: if(ADNP == NULL) and if(!inquiryAttrs.empty())" << endl;
+			//print_CondiContiTable(bottomTable);
+		}
+		
+		
+		
+		return bottomTable;
+		
+	}// end if(ADNP == NULL)
+	
+	//base 2
+	else if (inquiryAttrs.empty()){
+		CondiContiTable bottomTable;
+		bottomTable.contiTableCounts.push_back(ADNP->count);
+		//bottomTable.contiTableAttrs is empty
+		bottomTable.condiAttrs = givenAttrs;
+		bottomTable.condiVals = givenVals;
+		
+		//cout << "//base 2: if(ADNP != NULL) and if(inquiryAttrs.empty())" << endl;
+		//print_CondiContiTable(bottomTable);
+			
+		return bottomTable;
+	}
+	else{
+		int a_i_1 = inquiryAttrs.front();
+		int VNIndex = a_i_1 - ADNP->startVaryNodeInd;
+		ADVaryNode * VNP = ADNP->ADVaryNodePs[VNIndex];
+		int mcv = VNP->mcv;
+		int n_i_1 = arities[a_i_1];
+		CondiContiTable CTs[n_i_1];
+		
+		//delete the 1st element a_i_1 of inquiryAtts, will never use the 1st element a_i_1 again
+		//but does not allow the sub_program to delete more elements, so use deque<int> inquiryAttrs instead of deque<int> & inquiryAttrs
+		//vector<int> & givenAttrs, vector<int> & givenVals can be used because the sub_program will change but then restore it
+		inquiryAttrs.pop_front();
+		
+		for(int k = 0; k < n_i_1; k++){
+			if(k != mcv){
+				ADTreeNode * ADNP_k = VNP -> ADTreeNodePs[k];
+
+				vector<int> newGivenAttrs = givenAttrs;
+				newGivenAttrs.push_back(a_i_1);
+				vector<int> newGivenVals = givenVals;
+				newGivenVals.push_back(k);
+				CTs[k] = MakeContab(inquiryAttrs, ADNP_k, newGivenAttrs, newGivenVals, arities);
+				
+			}
+		}
+		CondiContiTable sumCTs = MakeContab(inquiryAttrs, ADNP, givenAttrs, givenVals, arities);
+		MinusContab(sumCTs, CTs, n_i_1, mcv);
+		
+		CondiContiTable result;
+		ConcatContab(CTs, n_i_1, a_i_1, result);
+		
+		//cout << "//non-base: " << endl;
+		//print_CondiContiTable(result);
+		
+		return result;
+	}
+	
+}// end CondiContiTable MakeContab()
+
+
+void MinusContab(CondiContiTable & sumCTs, CondiContiTable * CTs, int n_i_1, int mcv){
+	CTs[mcv].contiTableCounts = sumCTs.contiTableCounts;
+	CTs[mcv].contiTableAttrs = sumCTs.contiTableAttrs;
+	for(unsigned int i = 0; i < CTs[mcv].contiTableCounts.size(); i++){
+		for(int k = 0; k < n_i_1; k++){
+			if(k != mcv){
+				CTs[mcv].contiTableCounts[i] -= CTs[k].contiTableCounts[i];
+			}
+		}
+	}
+	//assume arities of each attr >=2
+	if(mcv != 0){
+		CTs[mcv].condiAttrs = CTs[0].condiAttrs;
+		CTs[mcv].condiVals = CTs[0].condiVals;
+	}
+	else{
+		CTs[mcv].condiAttrs = CTs[1].condiAttrs;
+		CTs[mcv].condiVals = CTs[1].condiVals;
+	}
+	CTs[mcv].condiVals.pop_back();
+	CTs[mcv].condiVals.push_back(mcv);
+	
+} //end void MinusContab()
+
+
+void ConcatContab(CondiContiTable * CTs, int n_i_1, int a_i_1, CondiContiTable & concatedTable){
+	for(int i = 0; i < n_i_1; i++){
+		//for each i, CTs[i].contiTableCounts.size() is the same
+		for(unsigned int j = 0; j < CTs[i].contiTableCounts.size(); j++){
+			concatedTable.contiTableCounts.push_back(CTs[i].contiTableCounts[j]);
+		}
+	}
+	
+	//check: a_i_1 == CTs[0].condiAttrs.back();
+	if(a_i_1 != CTs[0].condiAttrs.back()){
+		cout << "Error: a_i_1 != CTs[0].condiAttrs.back()" << endl;
+		cout << "a_i_1 = " << a_i_1 << endl;
+		cout << "CTs[0].condiAttrs.back() = " << CTs[0].condiAttrs.back() << endl;
+	}
+	
+	//move a_i_1 from the end of CTs[0].condiAttrs to the end of concatedTable.contiTableAttrs
+	concatedTable.contiTableAttrs = CTs[0].contiTableAttrs;
+	concatedTable.contiTableAttrs.push_back(a_i_1);
+	
+	concatedTable.condiAttrs = CTs[0].condiAttrs;
+	concatedTable.condiAttrs.pop_back();
+	
+	concatedTable.condiVals = CTs[0].condiVals;
+	concatedTable.condiVals.pop_back();
+	
+} //end void ContatContab()
+
+
+		
+
+
+
+
diff --git a/sourcecodes/k-best/src/arcToNet.cc b/sourcecodes/k-best/src/arcToNet.cc
new file mode 100644
index 00000000..b071baab
--- /dev/null
+++ b/sourcecodes/k-best/src/arcToNet.cc
@@ -0,0 +1,233 @@
+#include <iostream>
+#include <fstream>
+#include <iomanip>
+//#include "varpar.h"
+#include <stdlib.h>
+#include <math.h>
+#include <list>
+#include <stdio.h>
+#include <vector>
+//#include "cfg.h"
+#include <string.h>
+#include <cmath>
+//HR
+//#define EPSILON 0.001
+#define EPSILON 0.00001
+
+
+//HR: Add for hash_set
+#if __GNUC__ < 3 && __GNUC__ >= 2 && __GNUC_MINOR__ >= 95
+# include <hash_set>
+# include <functional>
+# define gnu_namespace std
+#elif __GNUC__ >= 3
+# include <ext/hash_set>
+# if __GNUC_MINOR__ == 0
+# include <functional>
+# define gnu_namespace std
+# else
+# include <ext/functional>
+# define gnu_namespace __gnu_cxx
+# endif
+#else
+# include <hash_set.h>
+# include <functional.h>
+# define gnu_namespace std
+#endif
+using namespace gnu_namespace;
+#include <set>
+//
+
+
+using namespace std;
+
+
+//HR: add from Engine.h in BayesNw
+#define MARK 9e99
+#define LOG_ZERO -1e101
+//#define LOGMINUS_NEW(logA, logB) if(logA == MARK) logA = logB; else if (logA == LOG_ZERO) logA = logB; else if (logB == LOG_ZERO) logA = logA; else logA = logA + log(1-exp(logB-logA));
+//HR: add from UpdateHR.h in BayesNw to deal with the problem in sum = 0 in comp_post()
+//call by reference to the original value
+//the log sum result is stored in logA
+//may change double into long double; no, use double
+void logAddComp(double & logA, double & logB){
+	    if(logA == MARK){
+    		logA = logB;
+    	}
+    	else if (logA == LOG_ZERO){
+    		logA = logB;
+    	}
+    	else if(logB == MARK){
+    		logA = logA;
+    	}
+    	else if(logB == LOG_ZERO){
+    		logA = logA;
+    	}
+    	//Nither logA nor logB is MARK/LOG_ZERO
+    	else{
+    		//1
+    		if(logA < 0 && logB < 0 ){
+    			logA = logA + log( 1 + exp(logB-logA) );
+    		}
+    		//2
+    		else if(logA > 0 && logB > 0){
+    			//always make exp(.): . > 0
+    			//2.1
+    			if(logA >= logB){
+    				logA = -( -logA + log( 1 + exp(-logB+logA) ) );
+    			}
+    			//2.2
+    			else{
+    				logA = -( -logB + log( 1 + exp(-logA+logB) ) );
+    			}
+    			
+    		}
+    		//3
+    		else if(logA < 0 && logB > 0){
+    			//3.1
+    			if(logA + logB > 0){   				
+    				//logA = logA + log( 1 - exp(-logB-logA) );
+    				logA = -logB + log( exp(logA + logB) - 1 );
+    				
+    			}
+    			//3.2
+    			else if(logA + logB < 0){
+    				logA = -( logA + log( exp(-logB-logA)  - 1) );
+    			}
+    			//3.3
+    			else{
+    				logA = LOG_ZERO;
+    			}
+    		}
+    		//4
+    		else if(logA > 0 && logB < 0){
+    			//4.1
+    			if(logA + logB > 0){
+    				logA = -logA + log( exp(logB+logA) - 1);
+    			}
+    			//4.2
+    			else if(logA + logB < 0){
+    				//logA = -( -logA + log(1 - exp(logB+logA)) );
+    				logA = -( logB + log( exp(-logA-logB) - 1) );
+    				
+    			}
+    			//4.3
+    			else{
+    				logA = LOG_ZERO;
+    			}			
+    		}
+		
+    	}
+	
+}
+
+
+//HR: Add
+//Will be used for checking edges-based feasure for Engineer in BayesNW
+void arcToNet(char * inFeasFileName, char* outFeasFileName){
+
+	cout << "inFeasFileName: " << inFeasFileName << endl;
+	
+	cout << "outFeasFileName: " << outFeasFileName << endl;
+	
+	int MAX_VAR_NUM = 32;
+	
+	int inFeatureEdges[MAX_VAR_NUM];
+	for(int i = 0; i < MAX_VAR_NUM; i++){
+		inFeatureEdges[i] = 0;
+	}
+	
+	string str;
+	str.assign(inFeasFileName);
+	
+  
+	FILE* fp = fopen(str.c_str(), "r");
+
+	int fromNode;
+	int toNode;
+	//int i=0;
+	while(!feof(fp)){
+		char c;
+		fromNode = -1;
+		toNode = -1;
+
+		fscanf(fp,"%d",&fromNode);
+		fscanf(fp,"%d",&toNode);
+		fscanf(fp,"%c",&c);
+		
+		cout << "fromNode = "<< fromNode << endl;
+		cout << "toNode = "<< toNode << endl;
+
+		inFeatureEdges[toNode] += (1 << fromNode);
+
+
+		
+	}
+	fclose(fp);
+	int no_var = toNode;
+	
+	for(int i = 0; i < MAX_VAR_NUM; i++){
+		cout << "inFeatureEdges[" << i << "] " << inFeatureEdges[i] << endl; 
+	}
+	
+	
+	int outFeatureEdges[MAX_VAR_NUM];
+	for(int i = 0; i < MAX_VAR_NUM; i++){
+		outFeatureEdges[i] = 0;
+	}
+	
+	string str2;
+	str2.assign(outFeasFileName);
+	
+  
+	fp=fopen(str2.c_str(), "r");
+
+	//int fromNode;
+	//int toNode;
+	//int i=0;
+	while(!feof(fp)){
+		char c;
+		fromNode = -1;
+		toNode = -1;
+
+		fscanf(fp,"%d",&fromNode);
+		fscanf(fp,"%d",&toNode);
+		fscanf(fp,"%c",&c);
+		
+		cout << "fromNode = "<< fromNode << endl;
+		cout << "toNode = "<< toNode << endl;
+
+		outFeatureEdges[toNode] += (1 << fromNode);
+
+
+		
+	}
+	fclose(fp);
+	//int no_var = toNode;
+	
+	
+	for(int i = 0; i < MAX_VAR_NUM; i++){
+		cout << "outFeatureEdges[" << i << "] " << outFeatureEdges[i] << endl; 
+	}
+	
+	
+	
+	
+}
+
+	
+
+//HR:F
+int main(int argc, char* argv[]){
+	
+	if (argc!=3){
+    	cout << "Please type the correct format: arcToNet inFeatureFileName outFeatureFileName\n" << endl;
+        return 1;
+    }
+      
+     arcToNet(argv[1], argv[2]);
+		
+}
+	
+
+
diff --git a/sourcecodes/k-best/src/arcs2dot.c b/sourcecodes/k-best/src/arcs2dot.c
new file mode 100644
index 00000000..12f48158
--- /dev/null
+++ b/sourcecodes/k-best/src/arcs2dot.c
@@ -0,0 +1,60 @@
+#include "cfg.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#define BUFSIZE (1024)
+
+void arcs2dot(char* vdfile, char* arcfile, char* dotfile)
+{
+  char buffer[BUFSIZE];
+  FILE* dotf = strcmp(dotfile,"-") ? fopen(dotfile, "w") : stdout;
+
+  fprintf(dotf, "digraph Bene {\n");
+  fprintf(dotf, "  /*@@@BEFORE_ALL@@@*/\n"); 
+  
+  {/* read vdfile to get names of variables */
+
+    FILE* vdf  = fopen(vdfile, "r");
+    int v;
+    fprintf(dotf, "  /*@@@BEFORE_NODES@@@*/\n"); 
+    for(v=0; NULL != fgets(buffer, BUFSIZE, vdf); ++v){
+      char* token = strtok(buffer, "\t\r\n");
+      fprintf(dotf, "  V%d [label=\"%s\" /*@@@NODE_ATTS@@@*/];\n", v, token);
+    }
+    fprintf(dotf, "  /*@@@AFTER_NODES@@@*/\n"); 
+    fclose(vdf);
+  }
+
+  {
+
+    int from, to;
+    FILE* arcf = strcmp(arcfile,"-") ? fopen(arcfile, "r") : stdin;
+
+    fprintf(dotf, "  /*@@@BEFORE_EDGES@@@*/\n"); 
+    while(2 == fscanf(arcf, "%d %d", &from, &to)){
+      fprintf(dotf, "  V%d -> V%d /*@@@EDGE_ATTS@@@*/;\n", from, to);
+    }
+    fprintf(dotf, "  /*@@@AFTER_EDGES@@@*/\n"); 
+
+    fclose(arcf);
+  }
+  
+  fprintf(dotf, "  /*@@@AFTER_ALL@@@*/\n"); 
+  fprintf(dotf, "}\n"); 
+  fclose(dotf);
+}
+
+int main(int argc, char* argv[])
+{
+
+  if (argc!=4) {
+    fprintf(stderr, "Usage: arcs2dot vdfile arcfile dotfile\n");
+    return 1;
+  }
+
+  arcs2dot(argv[1], argv[2], argv[3]);
+
+  return 0;
+}
diff --git a/sourcecodes/k-best/src/buildk.sh b/sourcecodes/k-best/src/buildk.sh
new file mode 100644
index 00000000..9bd06a3e
--- /dev/null
+++ b/sourcecodes/k-best/src/buildk.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+if [ ${1:-UNIX} == "WIN" ]; then
+    CC="i586-mingw32msvc-gcc"
+    EXT=".exe"
+else
+    CC=gcc
+fi
+
+D=g++
+
+#CFLAGS="-Wextra -g -ansi -pedantic"
+#CFLAGS="-Wall -O3 -g -pg"
+CFLAGS="-Wall  -O3"
+
+$CC $CFLAGS -c -o files.o files.c
+$CC $CFLAGS -c -o varpar.o varpar.c
+
+$CC $CFLAGS -o get_local_scores$EXT files.c reg.c ilogi.c ls_XIC.c ls_NML.c ls_BDe.c ls_LOO.c get_local_scores.c -lm
+$CC $CFLAGS -o split_local_scores$EXT split_local_scores.c files.o
+$CC $CFLAGS -o reverse_local_scores$EXT reverse_local_scores.c files.o
+$D -o get_kbest_parents$EXT get_kbest_parents.cc 
+$D -o get_kbest_nets$EXT get_kbest_nets.cc 
diff --git a/sourcecodes/k-best/src/buildk_poster.sh b/sourcecodes/k-best/src/buildk_poster.sh
new file mode 100644
index 00000000..a9964f8a
--- /dev/null
+++ b/sourcecodes/k-best/src/buildk_poster.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+
+D=g++
+
+
+$D -o get_kbest_parents$EXT get_kbest_parents.cc 
+$D -o get_kbest_nets$EXT get_kbest_nets.cc 
+
diff --git a/sourcecodes/k-best/src/cfg.h b/sourcecodes/k-best/src/cfg.h
new file mode 100644
index 00000000..15e3fe89
--- /dev/null
+++ b/sourcecodes/k-best/src/cfg.h
@@ -0,0 +1,9 @@
+#ifndef __CFG_H_
+#define __CFG_H_
+
+#define MAX_NOF_VARS (32)
+#define LARGEST_SET(NOF_VARS) ((NOF_VARS)==MAX_NOF_VARS?(varset_t)~0:(1U<<(NOF_VARS))-1)
+typedef unsigned int varset_t;
+typedef double score_t;
+
+#endif
diff --git a/sourcecodes/k-best/src/clean.sh b/sourcecodes/k-best/src/clean.sh
new file mode 100644
index 00000000..3db60eb5
--- /dev/null
+++ b/sourcecodes/k-best/src/clean.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+rm -f get_local_scores split_local_scores reverse_local_scores \
+   get_best_parents get_best_sinks get_best_order get_best_net \
+   score_net score_nets net2parents parents2arcs arcs2dot \
+   *.exe *.o *~
diff --git a/sourcecodes/k-best/src/comp_pHat_D.cc b/sourcecodes/k-best/src/comp_pHat_D.cc
new file mode 100644
index 00000000..fc789912
--- /dev/null
+++ b/sourcecodes/k-best/src/comp_pHat_D.cc
@@ -0,0 +1,213 @@
+#include <iostream>
+#include <fstream>
+#include <iomanip>
+//#include "varpar.h"
+#include <stdlib.h>
+#include <math.h>
+#include <list>
+#include <stdio.h>
+#include <vector>
+//#include "cfg.h"
+#include <string.h>
+#include <cmath>
+//HR
+//#define EPSILON 0.001
+#define EPSILON 0.00001
+
+
+//HR: Add for hash_set
+#if __GNUC__ < 3 && __GNUC__ >= 2 && __GNUC_MINOR__ >= 95
+# include <hash_set>
+# include <functional>
+# define gnu_namespace std
+#elif __GNUC__ >= 3
+# include <ext/hash_set>
+# if __GNUC_MINOR__ == 0
+# include <functional>
+# define gnu_namespace std
+# else
+# include <ext/functional>
+# define gnu_namespace __gnu_cxx
+# endif
+#else
+# include <hash_set.h>
+# include <functional.h>
+# define gnu_namespace std
+#endif
+using namespace gnu_namespace;
+#include <set>
+//
+
+
+using namespace std;
+
+
+//HR: add from Engine.h in BayesNw
+#define MARK 9e99
+#define LOG_ZERO -1e101
+//#define LOGMINUS_NEW(logA, logB) if(logA == MARK) logA = logB; else if (logA == LOG_ZERO) logA = logB; else if (logB == LOG_ZERO) logA = logA; else logA = logA + log(1-exp(logB-logA));
+//HR: add from UpdateHR.h in BayesNw to deal with the problem in sum = 0 in comp_post()
+//call by reference to the original value
+//the log sum result is stored in logA
+//may change double into long double; no, use double
+void logAddComp(double & logA, double & logB){
+	    if(logA == MARK){
+    		logA = logB;
+    	}
+    	else if (logA == LOG_ZERO){
+    		logA = logB;
+    	}
+    	else if(logB == MARK){
+    		logA = logA;
+    	}
+    	else if(logB == LOG_ZERO){
+    		logA = logA;
+    	}
+    	//Nither logA nor logB is MARK/LOG_ZERO
+    	else{
+    		//1
+    		if(logA < 0 && logB < 0 ){
+    			logA = logA + log( 1 + exp(logB-logA) );
+    		}
+    		//2
+    		else if(logA > 0 && logB > 0){
+    			//always make exp(.): . > 0
+    			//2.1
+    			if(logA >= logB){
+    				logA = -( -logA + log( 1 + exp(-logB+logA) ) );
+    			}
+    			//2.2
+    			else{
+    				logA = -( -logB + log( 1 + exp(-logA+logB) ) );
+    			}
+    			
+    		}
+    		//3
+    		else if(logA < 0 && logB > 0){
+    			//3.1
+    			if(logA + logB > 0){   				
+    				//logA = logA + log( 1 - exp(-logB-logA) );
+    				logA = -logB + log( exp(logA + logB) - 1 );
+    				
+    			}
+    			//3.2
+    			else if(logA + logB < 0){
+    				logA = -( logA + log( exp(-logB-logA)  - 1) );
+    			}
+    			//3.3
+    			else{
+    				logA = LOG_ZERO;
+    			}
+    		}
+    		//4
+    		else if(logA > 0 && logB < 0){
+    			//4.1
+    			if(logA + logB > 0){
+    				logA = -logA + log( exp(logB+logA) - 1);
+    			}
+    			//4.2
+    			else if(logA + logB < 0){
+    				//logA = -( -logA + log(1 - exp(logB+logA)) );
+    				logA = -( logB + log( exp(-logA-logB) - 1) );
+    				
+    			}
+    			//4.3
+    			else{
+    				logA = LOG_ZERO;
+    			}			
+    		}
+		
+    	}
+	
+}
+
+
+//HR: Add
+//Update from comp_post
+void comp_pHat(){
+	//double logSum = -450.491; //iris	
+	double logSum = -9418.56; //tic
+	
+	//double logSum = -637.91; //zoo
+	
+	cerr << "logSum = " << logSum << endl;
+	
+	//double truelogP = -450.491; //iris
+	double truelogP = -9418.29; //tic
+	
+	//double truelogP = -619.502; //zoo
+	
+	cerr << "truelogP = " << truelogP << endl;
+	
+	int sampleSize = 1000;
+	
+	long double post[sampleSize];
+	double relaLogScore[sampleSize];
+	
+	double sumPost[sampleSize];
+
+	string str;
+	char str1[32];
+
+	FILE *fp = fopen("netpost" ,"r");
+	int i = 0;
+	
+	
+		
+
+	while(!feof(fp) && i < sampleSize){
+			char c;
+			fscanf(fp,"%Lg",&post[i]);
+			//cout << " post[" << i << "] = " << post[i] << endl;
+			fscanf(fp,"%c",&c);		
+			i++;
+	}
+	
+	for(int j = 0; j < sampleSize; j++){
+		relaLogScore[j] = log(post[j]) + logSum;
+		//cout << " relaLogScore[" << i << "] = " << relaLogScore[j] << endl;
+	}
+	//cout << " relaLogScore[" << 1 << "] = " << relaLogScore[1] << endl;
+	//cout << " relaLogScore[" << 2 << "] = " << relaLogScore[2] << endl;
+	
+	for(int j = 0; j < sampleSize; j++){
+		sumPost[j] = LOG_ZERO;
+	}
+	
+	for(int j = 0; j < sampleSize; j++){
+		for(int k = 0; k <= j; k++){
+			logAddComp(sumPost[j], relaLogScore[k]);
+		}
+		//cout << " sumPost[" << j << "] = " << sumPost[j] << endl;
+	}
+	
+	double DRatio[sampleSize];
+	
+	
+	for(int j = 0; j < sampleSize; j++){	
+		DRatio[j] =  exp( sumPost[j] - truelogP ) * 100;
+		//cout << "" << DRatio[j] << endl;	
+	}
+	
+	double GRatio[sampleSize];
+	for(int j = 0; j < sampleSize; j++){	
+		GRatio[j] =  post[0]/post[j];
+		//cout << "" << GRatio[j] << endl;	
+	}
+	
+	cout << "\n\nDRatio\t GRatio" << endl;
+	for(int j = 0; j < sampleSize; j++){	
+		cout << "" << DRatio[j] << "\t " << GRatio[j] << endl;	
+	}
+}
+
+	
+
+//HR:F
+int main(int argc, char* argv[]){
+	comp_pHat();
+		
+}
+	
+
+
diff --git a/sourcecodes/k-best/src/data.sh b/sourcecodes/k-best/src/data.sh
new file mode 100644
index 00000000..d775b92a
--- /dev/null
+++ b/sourcecodes/k-best/src/data.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+binpath=`dirname $0`
+
+if [ $# -ne 4 ]; then
+    echo Usage: data2net.sh vdfile datafile score resultdir 1>&2
+    exit 1
+fi
+
+vdfile=$1;    shift 
+datafile=$1;  shift
+score=$1;     shift
+rdir=$1;      shift
+
+mkdir -p $rdir
+nof_vars=`cat $vdfile | wc -l`
+
+START=$(date +%s)
+$binpath/get_best_parents     $nof_vars ${rdir}
+$binpath/get_best_sinks       $nof_vars ${rdir} ${rdir}/sinks
+$binpath/get_best_order       $nof_vars ${rdir}/sinks ${rdir}/ord
+$binpath/get_best_net         $nof_vars ${rdir} ${rdir}/ord ${rdir}/net
+$binpath/score_net            ${rdir}/net ${rdir}
+END=$(date +%s)
+DIFF=$(( $END - $START ))
+echo "Best network took $DIFF seconds"
+
diff --git a/sourcecodes/k-best/src/data2net.sh b/sourcecodes/k-best/src/data2net.sh
new file mode 100644
index 00000000..3bc5d133
--- /dev/null
+++ b/sourcecodes/k-best/src/data2net.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+binpath=`dirname $0`
+
+if [ $# -ne 4 ]; then
+    echo Usage: data2net.sh vdfile datafile score resultdir 1>&2
+    exit 1
+fi
+
+vdfile=$1;    shift 
+datafile=$1;  shift
+score=$1;     shift
+rdir=$1;      shift
+
+mkdir -p $rdir
+nof_vars=`cat $vdfile | wc -l`
+
+START=$(date +%s)
+$binpath/get_local_scores $vdfile $datafile $score 1 0 ${rdir}/res
+$binpath/split_local_scores   $nof_vars ${rdir}
+$binpath/reverse_local_scores $nof_vars ${rdir}
+END=$(date +%s)
+DIFF=$(( $END - $START ))
+echo "Local score took $DIFF seconds"
+
+START=$(date +%s)
+$binpath/get_best_parents     $nof_vars ${rdir}
+$binpath/get_best_sinks       $nof_vars ${rdir} ${rdir}/sinks
+$binpath/get_best_order       $nof_vars ${rdir}/sinks ${rdir}/ord
+$binpath/get_best_net         $nof_vars ${rdir} ${rdir}/ord ${rdir}/net
+$binpath/score_net            ${rdir}/net ${rdir}
+END=$(date +%s)
+DIFF=$(( $END - $START ))
+echo "Best network took $DIFF seconds"
+
diff --git a/sourcecodes/k-best/src/data2netk.sh b/sourcecodes/k-best/src/data2netk.sh
new file mode 100644
index 00000000..e20f12c9
--- /dev/null
+++ b/sourcecodes/k-best/src/data2netk.sh
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+binpath=`dirname $0`
+
+if [ $# -ne 5 ]; then
+    echo Usage: data2net.sh vdfile datafile score resultdir k 1>&2
+    exit 1
+fi
+
+vdfile=$1;    shift 
+datafile=$1;  shift
+score=$1;     shift
+rdir=$1;      shift
+k=$1;shift
+
+mkdir -p $rdir
+nof_vars=`cat $vdfile | wc -l`
+
+START=$(date +%s%N)
+$binpath/get_local_scores $vdfile $datafile $score 1 0 ${rdir}/res
+#HR
+echo "get_local_scores is done."
+$binpath/split_local_scores   $nof_vars ${rdir}
+#HR
+echo "split_local_scores is done."
+$binpath/reverse_local_scores $nof_vars ${rdir}
+#HR
+echo "reverse_local_scores is done."
+END=$(date +%s%N)
+#DIFF=$(( $END - $START ))
+DIFF1=$(( $END - $START ))
+echo "Local score took $DIFF1 seconds"
+
+#the above is the same as original bene
+
+START=$(date +%s%N)
+$binpath/get_kbest_parents $nof_vars ${rdir} $k
+#HR
+END=$(date +%s%N)
+#DIFF=$(( $END - $START ))
+DIFF2=$(( $END - $START ))
+echo "get_kbest_parents is done."
+echo "get_kbest_parents took $DIFF2 seconds"
+
+START=$(date +%s%N)
+$binpath/get_kbest_nets $nof_vars ${rdir} $k
+#HR
+END=$(date +%s%N)
+#DIFF=$(( $END - $START ))
+DIFF3=$(( $END - $START ))
+echo "get_kbest_nets is done."
+echo "get_kbest_nets took $DIFF3 seconds"
+
+DIFF=`expr $DIFF1 + $DIFF2 + $DIFF3`
+echo "total process took $DIFF seconds"
diff --git a/sourcecodes/k-best/src/data2netk_poster.sh b/sourcecodes/k-best/src/data2netk_poster.sh
new file mode 100644
index 00000000..6b3a34ca
--- /dev/null
+++ b/sourcecodes/k-best/src/data2netk_poster.sh
@@ -0,0 +1,56 @@
+#!/bin/bash
+
+binpath=`dirname $0`
+
+if [ $# -ne 4 ]; then
+    echo Usage: data2net.sh datafile resultdir k 1>&2
+    exit 1
+fi
+
+datafile=$1;  shift
+#score=$1;     shift
+rdir=$1;      shift
+k=$1;shift
+n=$1;shift
+
+nof_vars=`head -1 $datafile|wc -w`
+echo "The number of variables is $nof_vars."
+
+#HR:
+if [ "$n" -eq 0 ]
+then
+    maxindegree=`expr $nof_vars - 1`
+else
+    maxindegree=$n
+fi
+
+#maxindegree=`expr $nof_vars - 1`
+echo "maxindegree is $maxindegree."
+
+#HR:
+nof_instances=`cat $datafile | wc -l`
+#delete the header and type
+nof_instances=`expr $nof_instances - 2`
+echo "The number of instances is $nof_instances."
+
+
+START=$(date +%s%N)
+$binpath/get_kbest_parents $nof_vars ${rdir} $k
+#HR
+END=$(date +%s%N)
+#DIFF=$(( $END - $START ))
+DIFF2=$(( $END - $START ))
+echo "get_kbest_parents is done."
+echo "get_kbest_parents took $DIFF2 n-seconds."
+
+START=$(date +%s%N)
+$binpath/get_kbest_nets $nof_vars ${rdir} $k
+#HR
+END=$(date +%s%N)
+#DIFF=$(( $END - $START ))
+DIFF3=$(( $END - $START ))
+echo "get_kbest_nets is done."
+echo "get_kbest_nets took $DIFF3 n-seconds."
+
+DIFF=`expr $DIFF1 + $DIFF2 + $DIFF3`
+echo "The total process took $DIFF n-seconds."
diff --git a/sourcecodes/k-best/src/data2netk_poster.sh.bk b/sourcecodes/k-best/src/data2netk_poster.sh.bk
new file mode 100644
index 00000000..6b3a34ca
--- /dev/null
+++ b/sourcecodes/k-best/src/data2netk_poster.sh.bk
@@ -0,0 +1,56 @@
+#!/bin/bash
+
+binpath=`dirname $0`
+
+if [ $# -ne 4 ]; then
+    echo Usage: data2net.sh datafile resultdir k 1>&2
+    exit 1
+fi
+
+datafile=$1;  shift
+#score=$1;     shift
+rdir=$1;      shift
+k=$1;shift
+n=$1;shift
+
+nof_vars=`head -1 $datafile|wc -w`
+echo "The number of variables is $nof_vars."
+
+#HR:
+if [ "$n" -eq 0 ]
+then
+    maxindegree=`expr $nof_vars - 1`
+else
+    maxindegree=$n
+fi
+
+#maxindegree=`expr $nof_vars - 1`
+echo "maxindegree is $maxindegree."
+
+#HR:
+nof_instances=`cat $datafile | wc -l`
+#delete the header and type
+nof_instances=`expr $nof_instances - 2`
+echo "The number of instances is $nof_instances."
+
+
+START=$(date +%s%N)
+$binpath/get_kbest_parents $nof_vars ${rdir} $k
+#HR
+END=$(date +%s%N)
+#DIFF=$(( $END - $START ))
+DIFF2=$(( $END - $START ))
+echo "get_kbest_parents is done."
+echo "get_kbest_parents took $DIFF2 n-seconds."
+
+START=$(date +%s%N)
+$binpath/get_kbest_nets $nof_vars ${rdir} $k
+#HR
+END=$(date +%s%N)
+#DIFF=$(( $END - $START ))
+DIFF3=$(( $END - $START ))
+echo "get_kbest_nets is done."
+echo "get_kbest_nets took $DIFF3 n-seconds."
+
+DIFF=`expr $DIFF1 + $DIFF2 + $DIFF3`
+echo "The total process took $DIFF n-seconds."
diff --git a/sourcecodes/k-best/src/datak.sh b/sourcecodes/k-best/src/datak.sh
new file mode 100644
index 00000000..8ae66439
--- /dev/null
+++ b/sourcecodes/k-best/src/datak.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+binpath=`dirname $0`
+
+if [ $# -ne 5 ]; then
+    echo Usage: data2net.sh vdfile datafile score resultdir k 1>&2
+    exit 1
+fi
+
+vdfile=$1;    shift 
+datafile=$1;  shift
+score=$1;     shift
+rdir=$1;      shift
+k=$1;		shift
+
+mkdir -p $rdir
+nof_vars=`cat $vdfile | wc -l`
+START=$(date +%s)
+$binpath/get_kbest_parents $nof_vars ${rdir} $k
+$binpath/get_kbest_nets $nof_vars ${rdir} $k
+END=$(date +%s)
+DIFF=$(( $END - $START ))
+echo "Top k took $DIFF seconds"
diff --git a/sourcecodes/k-best/src/drawgraph.sh b/sourcecodes/k-best/src/drawgraph.sh
new file mode 100644
index 00000000..a0f59c88
--- /dev/null
+++ b/sourcecodes/k-best/src/drawgraph.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+k=$1
+rdir=$2
+for ((  i = 0 ;  i < k;  i++  ))
+do
+	${rdir}/../../src/arcs2dot ${rdir}/../iris.vd ${rdir}/$arc$i ${rdir}/dot_$i 
+done
+
diff --git a/sourcecodes/k-best/src/files.c b/sourcecodes/k-best/src/files.c
new file mode 100644
index 00000000..3227f63c
--- /dev/null
+++ b/sourcecodes/k-best/src/files.c
@@ -0,0 +1,59 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "files.h"
+
+int nof_digits(int n)
+{
+  int c=0;
+  do {
+    c += 1;
+    n /= 10;
+  } while(n);
+  return c;
+}
+
+int nof_lines(char* filename) {
+  int nof_lines = 0;
+  FILE* f = fopen(filename,"r");
+  int c = 0;
+  while(EOF != (c=fgetc(f)))
+    if(c=='\n') ++nof_lines;
+  fclose(f);
+  return nof_lines;
+}
+
+char* create_fn(char* dirname, int i, char* ext)
+{  char* fn = malloc((strlen(dirname)+1+nof_digits(i)+strlen(ext)+1)
+		     *sizeof(char));
+  sprintf(fn,"%s/%d%s", dirname,i,ext);
+  return fn;
+}
+
+FILE* open_file(char* dirname, int i, char* ext, char* mode)
+{
+  FILE* f;
+  char* fn = create_fn(dirname, i, ext);
+  sprintf(fn,"%s/%d%s", dirname,i,ext);
+  f = fopen(fn, mode);
+  free(fn);
+  return f;
+}
+
+FILE** open_files(int nof_vars, char* dirname, char* ext, char* mode)
+{
+  FILE** files = malloc(nof_vars * sizeof(FILE*));
+  int i;
+  for(i=0; i<nof_vars; ++i){
+    files[i] = open_file(dirname, i, ext, mode);
+  }
+  return files;
+}
+
+void free_files(int nof_vars, FILE** files){
+  int i;
+  for(i=0; i<nof_vars; ++i) fclose(files[i]);
+  free(files);
+}
+
diff --git a/sourcecodes/k-best/src/files.h b/sourcecodes/k-best/src/files.h
new file mode 100644
index 00000000..f11dd09e
--- /dev/null
+++ b/sourcecodes/k-best/src/files.h
@@ -0,0 +1,12 @@
+#ifndef __FILES_H__
+#define __FILES_H__
+
+#include <stdio.h>
+
+int    nof_lines(char* filename);
+char*  create_fn(char* dirname, int i, char* ext);
+FILE*  open_file(char* dirname, int i, char* ext, char* mode);
+FILE** open_files(int nof_vars, char* dirname, char* ext, char* mode);
+void   free_files(int nof_vars, FILE** files);
+
+#endif
diff --git a/sourcecodes/k-best/src/files.o b/sourcecodes/k-best/src/files.o
new file mode 100644
index 00000000..33f376d3
--- /dev/null
+++ b/sourcecodes/k-best/src/files.o
Binary files differdiff --git a/sourcecodes/k-best/src/get_best_net.c b/sourcecodes/k-best/src/get_best_net.c
new file mode 100644
index 00000000..5ed6ebfb
--- /dev/null
+++ b/sourcecodes/k-best/src/get_best_net.c
@@ -0,0 +1,63 @@
+#include "cfg.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "files.h"
+#include "varpar.h"
+
+void get_best_net(int nof_vars, char* ordfile, FILE** bpsfiles, varset_t* net)
+{
+  FILE* ordf = fopen(ordfile,"r");
+  varset_t parcands = 0;
+  int i;
+  for(i=0;i<nof_vars; ++i){
+    varset_t parset;
+    int v;
+//    printf("Parcands = %u",parcands);
+
+    fscanf(ordf, "%d", &v);
+  //  printf("  v= %d",v);
+    fseek(bpsfiles[v], varset2parset(v,parcands)*sizeof(varset_t), SEEK_SET);
+    fread(&parset, sizeof(varset_t), 1, bpsfiles[v]);
+   // printf("Parset =%u ",parset);
+    parcands |= 1U<<v;
+   // printf("Parcands = %u",parcands);
+    net[v] = parset2varset(v, parset);
+   // printf("net %d = %u",v,net[v]);
+  }
+  fclose(ordf);
+}
+
+
+int main(int argc, char* argv[])
+{
+
+  if (argc!=5) {
+    fprintf(stderr, "Usage: get_best_net nof_vars dirname ordfile netfile\n");
+    return 1;
+  }
+  
+  {
+    int nof_vars = atoi(argv[1]);
+
+    varset_t* net    = malloc(nof_vars*sizeof(varset_t));
+    FILE** files = open_files(nof_vars, argv[2],".bps", "rb");
+    get_best_net(nof_vars, argv[3], files, net);
+    free_files(nof_vars, files);
+
+    {
+      FILE* netf = fopen(argv[4],"w");
+      int i;
+      for (i=0;i<nof_vars;++i){
+	fprintf(netf, "%u\n", net[i]);
+      }
+      fclose(netf);
+    }
+
+    free(net);
+  }
+    
+  return 0;
+}
diff --git a/sourcecodes/k-best/src/get_best_order.c b/sourcecodes/k-best/src/get_best_order.c
new file mode 100644
index 00000000..232956aa
--- /dev/null
+++ b/sourcecodes/k-best/src/get_best_order.c
@@ -0,0 +1,54 @@
+#include "cfg.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+void get_best_order(int nof_vars, char* sinkfile, char* ord)
+{
+  FILE* sinkf = fopen(sinkfile, "rb");
+  varset_t  set = LARGEST_SET(nof_vars);
+ // printf("\n\n\nset = %u",set);
+  int i;
+  for(i=nof_vars-1; i>=0;--i){
+    char sink;
+	//	printf("\n\n\n\nset =%u",set);
+    fseek(sinkf, set, SEEK_SET);
+		
+    fread(&sink, sizeof(char), 1, sinkf);
+//		printf("  sink = %d",sink);
+    ord[i] = sink;
+
+    set ^= 1U<<sink;
+  //  printf("   new set = %u",set);
+  }
+  fclose(sinkf);
+}
+
+
+int main(int argc, char* argv[])
+{
+
+  if (argc!=4) {
+    fprintf(stderr, "Usage: get_best_net nof_vars sinkfile ordfile\n");
+    return 1;
+  }
+
+  {
+    int nof_vars = atoi(argv[1]);
+    char* ord = malloc(nof_vars*sizeof(char));
+
+    get_best_order(nof_vars, argv[2], ord);
+
+    {
+      FILE* ordf  = fopen(argv[3],  "w");
+      int i;
+      for(i=0;i<nof_vars;++i){
+	fprintf(ordf, "%d%c", ord[i], i==nof_vars-1 ? '\n' : ' ');
+      }
+      fclose(ordf);
+    }
+  }
+
+  return 0;
+}
diff --git a/sourcecodes/k-best/src/get_best_parents.c b/sourcecodes/k-best/src/get_best_parents.c
new file mode 100644
index 00000000..8562a271
--- /dev/null
+++ b/sourcecodes/k-best/src/get_best_parents.c
@@ -0,0 +1,114 @@
+#include "cfg.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "files.h"
+
+
+void get_best_parents(int nof_vars, char* dirname) {
+//printf("I'm here!!!");
+
+  varset_t nof_parsets = 1U<<(nof_vars-1);
+  int i;
+//  FILE* fp;
+  score_t*  scores = malloc(nof_parsets*sizeof(score_t));
+  varset_t* bsps   = malloc(nof_parsets*sizeof(varset_t));
+// fp = fopen("/home/grad/lram/RA stuff/check/src/out.txt","w");
+
+  for(i=0;i<nof_vars; ++i){
+    
+    { /* READ SCORES FOR i */
+      FILE* fin = open_file(dirname, i, "", "rb");
+      fread(scores, sizeof(score_t), nof_parsets, fin);
+  //    fp = fopen("out.txt","a");
+// fp = fopen("out.txt","a");
+    //  fprintf(fp,"\n\nLocal Scores for Var %d:",i);
+     // for(j=0;j<nof_parsets;j++)
+     // {
+       //  fprintf(fp,"%8.10f\n ",scores[j]);
+    //  }
+
+      fclose(fin);
+    }
+
+    
+    { /* FIND BEST PARENTS AND THEIR SCORES IN EACH SET FOR i */
+
+      varset_t ps;
+
+      for(ps=0; ps<nof_parsets; ++ps){
+	varset_t psel = 1U;
+
+	bsps[ps] = ps;
+	for(psel=1; psel<nof_parsets; psel <<= 1){
+	  if (ps & psel){
+	    varset_t subset = ps^psel;
+	    if (scores[subset] >= scores[ps]){
+	      scores[ps] = scores[subset];
+	      bsps[ps]   = bsps[subset];
+	    }
+	  }
+	}
+      }
+    }
+    
+    
+    { /* WRITE BEST PARENTS FOR i */
+
+      FILE* fout = open_file(dirname, i, ".bps", "wb");
+      fwrite(bsps, sizeof(varset_t), nof_parsets, fout);
+
+//fprintf(fp,"\n\nBest parent sets for var %d",i);
+ //for(j=0;j<nof_parsets;j++)
+   //   {
+     //    fprintf(fp,"%u ",bsps[j]);
+      //}
+
+
+
+
+      fclose(fout);
+    }
+
+    { /* WRITE BEST SCORES FOR i */
+
+      FILE* fout = open_file(dirname, i, ".bss", "wb");
+      fwrite(scores, sizeof(score_t), nof_parsets, fout);
+
+//fprintf(fp,"\n\nBest score for var %d",i);
+ //for(j=0;j<nof_parsets;j++)
+   //   {
+     //    fprintf(fp,"%g ",scores[j]);
+      //}
+
+
+
+
+      fclose(fout);
+    }
+  }
+//fclose(fp);
+  free(bsps);
+  free(scores);
+}
+
+
+int main(int argc, char* argv[])
+{
+//FILE *fp=fopen("/home/grad/lram/RA stuff/try/src/kd4.log", "w+");
+//fprintf(stdout, "loose kutty");
+//fclose(fp);
+  if (argc!=3) {
+    fprintf(stderr, "Usage: best_parents nof_vars dirname\n");
+    return 1;
+  }
+
+  {
+    int nof_vars = atoi(argv[1]);
+    get_best_parents(nof_vars, argv[2]);
+  }
+
+  return 0;
+}
diff --git a/sourcecodes/k-best/src/get_best_sinks.c b/sourcecodes/k-best/src/get_best_sinks.c
new file mode 100644
index 00000000..4d83d217
--- /dev/null
+++ b/sourcecodes/k-best/src/get_best_sinks.c
@@ -0,0 +1,78 @@
+#include "cfg.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "files.h"
+
+void get_best_sinks(int nof_vars, FILE** files, char* sinkfile)
+{
+
+  FILE* sinkf        = fopen(sinkfile, "wb");
+FILE *fp = fopen("/home/grad/lram/RA stuff/check/src/sinks.txt","w");
+  
+score_t* scores    = malloc((1U<<nof_vars) * sizeof(score_t));
+  score_t best_score = 0.0;
+
+  varset_t varset;
+  for(varset=0; varset < (1U<<nof_vars); ++varset){
+//    printf("\n\n\nVarset %u",varset);
+    int sink;
+    char best_sink = -1;
+
+    for(sink=0; sink<nof_vars; ++sink){ /* could use ffs */
+  //    printf("\nTry Sink %d",sink);
+      varset_t sinkleton = 1U<<sink;
+
+      if (varset & sinkleton) {
+//printf("  True!!");
+	score_t new_score = scores[varset & ~sinkleton];
+
+//printf("New score = %f + ",new_score);
+//printf("Scores[ %d ] +",varset & ~sinkleton);
+
+	score_t par_score;
+	fread(&par_score, sizeof(score_t), 1, files[sink]);
+//printf(" New score + %f",par_score);
+//printf(" Score is [%d .bss,???] ",sink);
+	new_score += par_score;
+	if (best_sink == -1 || best_score < new_score){
+//printf("This is better than previous");
+	  best_score = new_score;
+	  best_sink  = sink;
+
+	}
+      }
+    }
+    
+    scores[varset] = best_score;
+
+    fwrite(&best_sink, sizeof(char), 1, sinkf);
+
+fprintf(fp,"Best score: %f",best_score);
+fprintf(fp,"Best sink: %d", best_sink);
+  }
+
+  free(scores);
+  fclose(sinkf);
+}
+
+
+int main(int argc, char* argv[])
+{
+
+  if (argc!=4) {
+    fprintf(stderr, "Usage: get_best_net nof_vars dirname sinkfile\n");
+    return 1;
+  }
+  
+  {
+    int nof_vars = atoi(argv[1]);
+    FILE** files = open_files(nof_vars, argv[2],".bss", "rb");
+    get_best_sinks(nof_vars, files, argv[3]);
+    free_files(nof_vars, files);
+  }
+  
+  return 0;
+}
diff --git a/sourcecodes/k-best/src/get_kbest_nets b/sourcecodes/k-best/src/get_kbest_nets
new file mode 100644
index 00000000..032b1a33
--- /dev/null
+++ b/sourcecodes/k-best/src/get_kbest_nets
Binary files differdiff --git a/sourcecodes/k-best/src/get_kbest_nets.cc b/sourcecodes/k-best/src/get_kbest_nets.cc
new file mode 100644
index 00000000..9aafe83c
--- /dev/null
+++ b/sourcecodes/k-best/src/get_kbest_nets.cc
@@ -0,0 +1,1552 @@
+#include <iostream>
+#include <fstream>
+#include <iomanip>
+//#include "varpar.h"
+#include <stdlib.h>
+#include <math.h>
+#include <list>
+#include <stdio.h>
+#include <vector>
+#include "cfg.h"
+#include <string.h>
+#include <cmath>
+//HR
+//#define EPSILON 0.001
+#define EPSILON 0.00001
+
+
+//HR: Add for hash_set
+#if __GNUC__ < 3 && __GNUC__ >= 2 && __GNUC_MINOR__ >= 95
+# include <hash_set>
+# include <functional>
+# define gnu_namespace std
+#elif __GNUC__ >= 3
+# include <ext/hash_set>
+# if __GNUC_MINOR__ == 0
+# include <functional>
+# define gnu_namespace std
+# else
+# include <ext/functional>
+# define gnu_namespace __gnu_cxx
+# endif
+#else
+# include <hash_set.h>
+# include <functional.h>
+# define gnu_namespace std
+#endif
+using namespace gnu_namespace;
+#include <set>
+//
+
+
+using namespace std;
+
+
+#define MARK 9e99
+#define LOG_ZERO -1e101
+
+//HR: add from UpdateHR.h to deal with the problem in sum = 0 in comp_post()
+//call by reference to the original value
+//the log sum result is stored in logA
+
+#define epsilon 1.0e5
+
+bool logSpecValEquals(double logX, double logSpecVal){
+	return (logX >= logSpecVal - epsilon && logX <= logSpecVal + epsilon);
+}
+
+void logAddComp(double & logA, double & logB){
+
+    	//if(logA == MARK){
+	    if(logSpecValEquals(logA, MARK)){
+    		logA = logB;
+    	}
+    	//else if (logA == LOG_ZERO){
+    	else if (logSpecValEquals(logA, LOG_ZERO)){
+    		logA = logB;
+    	}
+    	//else if(logB == MARK){
+    	else if(logSpecValEquals(logB, MARK)){
+    		logA = logA;
+    	}
+    	//else if(logB == LOG_ZERO){
+    	else if(logSpecValEquals(logB, LOG_ZERO)){
+    		logA = logA;
+    	}
+    	
+    	
+    	//Neither logA nor logB is MARK/LOG_ZERO
+    	else{
+    		//1
+    		if(logA < 0 && logB < 0 ){
+    			//1.1
+				//Gaurd logB-logA <= 100 to avoid that exp(logB-logA) go to inf
+	    		if(logB - logA <= 100 ){
+	    			logA = logA + log( 1 + exp(logB-logA) );
+	
+	    		} 
+	    		//1.2		
+	    		//if logB - logA > 100, then logB > 100 + logA so that B is much bigger than A (B > e^100 * A)
+	    		//    So (A + B) almost = B 
+	    		else{
+	    			//logA = logB; 
+		    		//The following is the real formula,; but it is almost same as //logA = logB; 
+		    		logA = logB + log( exp(logA - logB) + 1);
+	    		}
+    		}
+    		
+    		//2
+    		else if(logA > 0 && logB > 0){
+    			//always make exp(.): . > 0
+    			if(-logB + logA <= 100){
+    				//2.1
+    				logA = -( -logA + log( 1 + exp(-logB+logA) ) );
+    			} 			
+    			else{
+    				//2.2
+    				logA = -( -logB + log( 1 + exp(-logA+logB) ) );
+    			}
+    			
+    		}
+    		//3
+    		else if(logA < 0 && logB > 0){
+    			//3.1
+    			if(logA + logB > 0){   	
+    				if(logA + logB <= 100){
+    					//3.1.2
+    					logA = -logB + log( exp(logA + logB) - 1 );
+    				}	
+    				else{
+    					//3.1.1
+    					logA = logA + log( 1 - exp(-logB-logA) );
+    				}	
+	
+    			}
+    			//3.2
+    			else if(logA + logB < 0){
+    				if(-logA - logB <= 100){
+    					//3.2.2
+    					logA = -( logA + log( exp(-logB-logA)  - 1) );
+    				}
+    				else{
+    					//3.2.1
+    					logA = - ( -logB + log(1 - exp(logA+logB) ) );
+    				}
+
+    			}
+    			//3.3
+    			else{
+    				logA = LOG_ZERO;
+    			}
+    		}
+    		//4
+    		else if(logA > 0 && logB < 0){
+    			//4.1
+    			if(logA + logB > 0){
+    				if(logA + logB <= 100){
+    					//4.1.2
+    					logA = -logA + log( exp(logB+logA) - 1);
+    				}
+    				else{
+    					//4.1.1
+    					logA = logB + log( 1 - exp(-logA-logB) );
+    				}
+    				
+    			}
+    			//4.2
+    			else if(logA + logB < 0){
+    				if(-logA-logB <= 100){
+    					//4.2.2
+    					logA = -( logB + log( exp(-logA-logB) - 1) );
+    				}
+    				else{
+    					//4.2.1
+    					logA = -( -logA + log(1 - exp(logB+logA)) );
+    				}
+	
+    			}
+    			//4.3
+    			else{
+    				logA = LOG_ZERO;
+    			}			
+    		}
+		
+    	}
+	
+} // end of void logAddComp(double & logA, double & logB)c
+
+
+
+//HR: Note: The whole program supposes that max no. of vars = 32 and hardcord 32
+
+
+//Convert the parent set to the appropriate variable set
+//HR:F
+varset_t parset2varset(int v, varset_t set){
+  	varset_t sinkleton = 1U<<v;
+  	varset_t mask      = sinkleton - 1;
+  	varset_t low       = set &  mask;
+  	varset_t high      = set & ~mask;
+  	return (high<<1) | low;
+}
+
+
+
+/*================================================================*/
+//class for bnets 
+//HR:F
+//for (net, score) pair
+//  each net[j] (0 <= j <= 32-1) is the binary repres of the parents
+class net_set{
+	public:
+		score_t score;
+		varset_t net[32];
+
+		net_set(){
+			score=0.0000;
+			for(int j=0;j<32;j++){
+				net[j]=0;
+			}
+		}
+
+		friend int operator<(net_set s1,net_set s2);
+		friend int operator==(net_set s1,net_set s2);
+		friend int operator>(net_set s1,net_set s2);
+		friend bool same_obj(net_set s1, net_set s2, int nof_vars);
+
+};
+
+//HR:F
+/*================================================================*/
+
+int operator<(net_set s1,net_set s2){
+	if(fabs(s1.score-s2.score)<EPSILON){
+		return false;
+	}
+    return(s1.score<s2.score);
+}
+
+int operator>(net_set s1,net_set s2){
+	if(fabs(s1.score-s2.score)<EPSILON){
+		return false;
+	}
+    return(s1.score>s2.score);
+}
+
+int operator==(net_set s1,net_set s2){
+    return(fabs(s1.score-s2.score)<EPSILON);
+}
+
+//HR: check whether s1 and s2 are the same
+bool same_obj(net_set s1, net_set s2, int nof_vars){
+
+    bool flag=true;
+
+    for(int j=0;j<nof_vars;j++){
+        if(s1.net[j]!=s2.net[j]){
+			//cout<<"************************";
+            flag=false;
+            break;
+        }
+    }
+	//cout<<"Flag "<<flag;
+	//		if(flag==true)
+	//	{
+		//	if(fabs(s1.score-s2.score)<0.1)
+			//	flag=true;
+		//	else flag=false;
+	//	}
+			
+    return(flag);
+}
+
+//HR: check whether s1 and s2 are the same
+bool same_obj(net_set s1, net_set s2){
+
+    bool flag=true;
+
+    for(int j=0;j<MAX_NOF_VARS;j++){
+        if(s1.net[j]!=s2.net[j]){
+			//cout<<"************************";
+            flag=false;
+            break;
+        }
+    }
+	//cout<<"Flag "<<flag;
+	//		if(flag==true)
+	//	{
+		//	if(fabs(s1.score-s2.score)<0.1)
+			//	flag=true;
+		//	else flag=false;
+	//	}
+			
+    return(flag);
+}
+//
+
+/*================================================================*/
+//HR:F
+//HR: Refined
+void insert_vec(list<net_set>* v,net_set s, int k, int nof_vars){
+    list<net_set>::iterator it;
+    //HR: can improve its time
+    //first check whether v->size() > 0 && s < v->back()
+    //see Lav's comment
+    
+    
+	bool flag=false;
+
+     
+     //HR: Refined
+     //
+     if( (v->size() > 0) && (s < v->back()) ){
+     	v->push_back(s);
+     	flag=true;
+     }
+     else{
+     //
+     
+        for(it=v->begin();it!=v->end();it++){
+        	if(same_obj(s,*it,nof_vars)){
+//				cout<<"Same object so not inserted!!!!!!!!!!!!!"<<endl;
+				flag=true;
+                break;
+            }
+            else if(s>(*it)){
+	//			cout<<"score of s:"<<s.score<<"Score of kbnet element "<<(*it).score<<endl;
+                v->insert(it,s);
+				flag=true;
+                break;
+            }
+						
+        }
+        
+     }
+
+		if(flag==false){
+			v->push_back(s);
+		}
+    	if(v->size()>k){
+        	v->pop_back();
+      	}
+      	
+		//v->unique();
+}
+
+/*================================================================*/
+//class for bparents
+//HR:F
+//HR: (variable set, score) pair
+class score_network{
+	public:
+		score_t scores;
+		varset_t vset;
+
+	friend int operator<(score_network s1,score_network s2);
+    friend int operator==(score_network s1,score_network s2);
+    friend int operator>(score_network s1,score_network s2);
+    friend bool same_obj(score_network s1, score_network s2);
+
+};
+
+
+//HR:F
+int operator<(score_network s1,score_network s2){
+    if(fabs(s1.scores-s2.scores)<EPSILON){
+        return false;
+    }
+    return(s1.scores<s2.scores);
+
+}
+
+int operator>(score_network s1,score_network s2){
+ 	if(fabs(s1.scores-s2.scores)<EPSILON){
+        return false;
+    }
+    return(s1.scores>s2.scores);
+
+}
+
+int operator==(score_network s1,score_network s2){
+	return(fabs(s1.scores-s2.scores)<EPSILON);
+}
+
+
+bool same_obj(score_network s1, score_network s2){
+    return((s1==s2)&&(s1.vset==s2.vset));
+}
+
+
+
+
+void insert_vec(list<score_network>* v,score_network s, int k)
+  {
+    list<score_network>::iterator it;
+
+    if( s < v->back())
+      {
+        v->push_back(s);
+      }
+    else
+      {
+        for(it=v->begin();it!=v->end();it++)
+          {
+    //        if(same_obj(s,*it))
+      //        {
+        //        break;
+          //    }
+//            else
+ if(s>(*it))
+              {
+                v->insert(it,s);
+                break;
+              }
+
+          }
+      }
+
+    if(v->size()>k)
+      {
+        v->pop_back();
+      }
+
+  }
+
+/*================================================================*/
+//class for node
+//HR:F
+class node{
+	public:
+		int ip;
+		int in;
+		score_t score;
+
+		node(int x, int y, score_t z){
+        	ip=x;
+          	in=y;
+			score=z;
+        }
+
+		friend int operator<(node s1,node s2);
+		friend int operator==(node s1,node s2);
+		friend int operator>(node s1,node s2);
+		friend bool same_obj(node s1, node s2);
+};
+
+/*================================================================*/
+
+int operator<(node s1,node s2){
+ 	if(fabs(s1.score-s2.score)<EPSILON){
+     	return false;
+    }
+    return(s1.score<s2.score);
+}
+
+
+int operator>(node s1,node s2){
+
+	if(fabs(s1.score-s2.score)<EPSILON){
+        return false;
+   	}
+    return(s1.score>s2.score);
+}
+
+
+int operator==(node s1,node s2){
+	return(fabs(s1.score-s2.score)<EPSILON);
+}
+
+
+bool same_obj(node s1, node s2){
+	return((s1==s2)&&(s1.ip==s2.ip)&&(s1.in==s2.in));
+}
+
+/*================================================================*/
+
+//HR: F
+void print_queue(list<net_set> v[],int size,int nof_vars){
+
+    list<net_set>::iterator iter;
+
+	for(int j=0;j<size;j++){
+    	for(iter=v[j].begin();iter!=v[j].end();iter++){
+      		//HR:
+      		//kbnetscore[j] can have at most k (net, score) pairs
+        	cout<<"kbnetscore "<<j<<"    Score:"<<(*iter).score<<"   net   ";
+			for(int p=0;p<nof_vars;p++){
+				cout<<(*iter).net[p];
+			}
+			cout<<endl;
+    	}
+	}
+}
+
+//HR: Add
+void print_netscore(net_set ns,int nof_vars){
+
+
+        cout<<"netscore "<<"    Score:"<<ns.score<<" \tnet   "; //<<endl;
+      	for(int p=0;p<nof_vars;p++){
+         	cout<<ns.net[p] << " ";
+        }
+        cout<<endl;
+        cout<<endl;
+
+}
+//
+
+void print_queue(vector<score_network>* v){
+
+    vector<score_network>::iterator iter;
+
+    for(iter=v->begin();iter!=v->end();iter++){
+        cout<<"bparents    "<<(*iter).vset<<","<<(*iter).scores<<"  ,,  ";
+    }
+
+}
+
+void print_queue(list<node>* v){
+
+   	list<node>::iterator iter;
+	cout<<"fringe"<<endl;
+    for(iter=v->begin();iter!=v->end();iter++){
+      	cout<<"   ip "<<(*iter).ip<<", in "<<(*iter).in<<" score "<<(*iter).score;
+    }
+
+}
+
+void print_queue(vector<net_set>* v,int nof_vars){
+
+    vector<net_set>::iterator iter;
+
+    for(iter=v->begin();iter!=v->end();iter++){
+//      cout<<"    "<<(*iter).bsps<<","<<(*iter).scores;
+		cout<<"bnets "<<"    Score:"<<(*iter).score<<"   net   "<<endl;
+        for(int p=0;p<nof_vars;p++){
+            cout<<(*iter).net[p];
+        }
+
+    }
+}
+
+void print_queue(list<net_set>* v,int nof_vars){
+
+    list<net_set>::iterator iter;
+
+    for(iter=v->begin();iter!=v->end();iter++){
+//    	cout<<"    "<<(*iter).bsps<<","<<(*iter).scores;
+        cout<<"kbnet "<<"    Score:"<<(*iter).score<<"   net   "<<endl;
+      	for(int p=0;p<nof_vars;p++){
+         	cout<<(*iter).net[p];
+        }
+    }
+}
+
+
+
+  
+//HR: call insert_vec(&fringe,n,k);
+//HR: by this way, fringe is in descending order
+//HR: Lav's code is wrong
+//HR: corrected
+void insert_vec(list<node>* v,node s, int k){
+    list<node>::iterator it;
+    
+    //HR: test
+    //bool sameObj = false;
+    //bool inserted = false;
+    //
+
+    //if( s < v->back()){ same
+    if( (v->size() == 0) || (s < v->back())){    	
+        v->push_back(s);
+    }
+    else{
+        for(it=v->begin();it!=v->end();it++){
+        //comment it out will give the different answer. Because Lav's original is wrong, it will still insert the same object. It will eventually pop the correct end > k
+        //
+            if(same_obj(s, *it)){
+                break;                
+//                sameObj = true;
+//                cout << "s: ";
+//                print_node(s);
+//                cout << "*it: ";
+//                print_node(*it);
+//                cout << endl;
+//                print_queue(v);
+             
+            }
+            else{
+         //
+ 				if(s>(*it)){
+                	v->insert(it,s);
+                	//inserted = true;
+                	break;
+            	}
+            }
+            
+      	}
+      	
+      	//HR: test
+//      	if(sameObj == true && inserted == true){
+//      		cout << "Error: sameObj == true && inserted = true" << endl;
+      		
+//      		  cout << "s: ";
+//                print_node(s);
+//                print_queue(v);    		
+//      	}
+  	}
+
+    if(v->size()>k){
+    	//cout << "\n\nv->size()>k happens,  v->pop_back()\n" << endl;
+        v->pop_back();  
+    }
+	//	cout<<"Inserted:"<<endl;
+}
+  
+
+
+
+//===================================================================//
+//HR: Add hash_set to store net_set (i.e. (net, score) pair
+namespace gnu_namespace {
+	
+	template<>
+
+	struct hash<const net_set*> {
+	
+		hash<unsigned> hasher_ns;
+		
+		size_t operator()(const net_set* ns) const {
+			return hasher_ns((unsigned) roundl(- ns->score*10)); // wrong hash function??
+		}
+
+	}; //end of struct
+
+} //end of namespace
+
+
+
+struct eqNetScore{
+	bool operator()(const net_set* ns1, const net_set* ns2) const{
+		return same_obj(*ns1, *ns2);
+	}
+};
+
+
+
+typedef hash_set<const net_set *, hash<const net_set *>, eqNetScore> NetScoreHashSet;
+
+NetScoreHashSet knets;
+
+
+//HR: Add
+void print_nsHashSet(NetScoreHashSet nsHSet, int nof_vars){
+	for(NetScoreHashSet::iterator it = nsHSet.begin(); it != nsHSet.end(); it++){
+		print_netscore(**it, nof_vars);
+	}
+}
+//
+
+
+
+//=====================================================================================//
+
+/*================================================================*/
+
+//HR:F
+//HR: call gettopk(&bnets,&bparents,&kbnetscore[varset],k,sink,nof_vars);
+void gettopk(vector<net_set>* bnets, vector<score_network>* bparents, list<net_set>* kbnet, int k, varset_t sink,int nof_vars){
+	int h;
+	int ipmax=bparents->size();
+//		cout<<"ipmax: "<<ipmax;
+		
+	int inmax=bnets->size();
+	//	cout<<"inmax: "<<inmax;
+	
+	//HR: Add hash_set generated here
+	
+	//
+	
+	int ip,in;
+
+	net_set * netwP;
+	
+	score_t score;
+	
+	list<node> fringe;
+	
+	//HR: different from Algo4, here start from 0 vs. 1
+	node n(0,0,(bparents->at(0)).scores + (bnets->at(0)).score);
+	insert_vec(&fringe,n,k);
+	//	print_queue(&fringe);
+		// scanf("%d",&h);
+		
+	NetScoreHashSet::iterator iter1;
+
+	while(!fringe.empty()){
+		//	cout<<"Fringe not empty"<<endl;		
+		n = fringe.front();
+		fringe.pop_front();
+		//	cout<<"Fringe After popping"<<endl;
+		//	print_queue(&fringe);
+		ip=n.ip;
+		in=n.in;
+		score=n.score;				
+		//	cout<<"Popped node"<<endl;
+		//	cout<<"ip "<<ip<<"in "<<in<<"score "<<score<<endl;
+			
+		if((kbnet->size())<k){
+			//		cout<<"Size < k"<<endl;
+			//HR: Add
+			//net_set netw;
+			//
+			netwP = new net_set();
+			for(int j=0;j<nof_vars;j++){
+				(*netwP).net[j]=(bnets->at(in)).net[j];
+				//			cout<<"Net w j"<<netw.net[j]<<endl;
+			}						
+			(*netwP).net[sink]=((bparents->at(ip)).vset);
+			//cout<<"net w sinkleton"<<netw.net[sinkleton]<<endl;
+			(*netwP).score=score;
+			//cout<<"net score "<<netw.score<<endl;
+			//cout<<"Before inserting:"<<endl;
+			//	print_queue(kbnet,nof_vars);
+			
+			//HR: Add hash_set knets check here
+			//if not find netw
+			if((iter1 = knets.find(netwP)) == knets.end()){
+				//Lav
+			 	//every time call by value of netw
+
+				insert_vec(kbnet, *netwP, k, nof_vars);
+				//cout<<"After inserting"<<endl;
+				//print_queue(kbnet,nof_vars);
+				//scanf("%d",&h);
+				//cout<<"Inserted into kbnetscore"<<endl;
+				//
+				//HR: Add to knets
+				knets.insert(netwP);
+
+		   	}
+		   	
+		   	else{
+		   		if( same_obj(*netwP, **iter1, nof_vars) == false ){
+		   			cout<<"Error: same_obj(*netwP, **iter1, nof_vars) == false"<<endl;
+		   			return;
+		   		}
+
+		   		//delete the memory
+		   		delete netwP;
+
+		   	}
+		   	
+			//
+			
+		}
+				
+		else if((fabs(score-(kbnet->back()).score)>EPSILON)&&(score>(kbnet->back().score))){
+					//	cout<<"score>kbnetback's score"<<endl;
+				
+			//HR: Add
+			//net_set netw;
+			//	
+			netwP = new net_set();
+			for(int j=0;j<nof_vars;j++){
+                (*netwP).net[j]=(bnets->at(in)).net[j];
+				//		cout<<"Net w j"<<netw.net[j]<<endl;
+             }
+            (*netwP).net[sink]=(bparents->at(ip)).vset;				
+			//cout<<"net w sinkleton"<<netw.net[sinkleton]<<endl;
+			(*netwP).score=score;
+			//cout<<"net score"<<netw.score<<endl;
+			//cout<<"Before inserting:"<<endl;
+			//	print_queue(kbnet,nof_vars);
+
+			
+			//HR: Add hash_set knets check here
+			//if not find
+			if((iter1 = knets.find(netwP)) == knets.end()){
+				
+				net_set lastNs = kbnet->back();
+				
+				//Lav
+				insert_vec(kbnet,*netwP,k,nof_vars);           
+				//cout<<"After inserting"<<endl;
+				//print_queue(kbnet,nof_vars);
+				//scanf("%d",&h);
+				//
+				//HR: Add to knets
+				knets.insert(netwP);
+
+				iter1 = knets.find(&lastNs);
+				
+				if(iter1  == knets.end()){
+					cout << "Error: iter1 should != knets.end() since lastNs should be found in kents" << endl;
+					return;
+				}
+				const net_set * nsTempP = * iter1;
+				
+				knets.erase(&lastNs);  //do not remove 
+				delete nsTempP;
+
+				//HR: remove from kbnet has been done inside knets.insert(netwP);
+			}
+			
+			else{
+		   		if( same_obj(*netwP, **iter1, nof_vars) == false ){
+		   			cout<<"Error: same_obj(*netwP, **iter1, nof_vars) == false"<<endl;
+		   			return;
+		   		}
+				
+				//delete the memory
+				delete netwP;
+				
+
+		   	}
+		   	
+
+
+		}
+		else{
+			return;
+		}
+		
+		//HR: since start from 0 not 1; so use ip<ipmax-1
+		if(ip<ipmax-1){
+			//cout<<"before child:"<<endl;
+			node child(ip+1,in,(bparents->at(ip+1)).scores + (bnets->at(in)).score);
+			//cout<<"after child"<<endl;
+			//cout<<"Fringe before inserting:"<<endl;
+			//print_queue(&fringe);
+	
+			//may add hash_set generated check here
+			
+			insert_vec(&fringe,child,k);
+			//cout<<"Fringe after inserting"<<endl;
+			//print_queue(&fringe);
+			//scanf("%d",&h);
+
+		}
+		if(in<inmax-1){
+			//	cout<<"Fringe before inserting:"<<endl;
+           	// print_queue(&fringe);
+
+			node child(ip,in+1,(bparents->at(ip)).scores + (bnets->at(in+1)).score);
+			
+			//may add hash_set generated check here
+			
+			insert_vec(&fringe,child,k);
+			//cout<<"Fringe after inserting"<<endl;
+
+			//	print_queue(&fringe);
+			// scanf("%d",&h);
+
+		}
+	}//end of while		
+	//	scanf("%d",&h);
+}
+
+/*================================================================*/
+//converts from the best parent sets obtained to actual variable set
+//HR: call conv_net(&kbnetscore[nof_combs-1],k,nof_vars);
+//HR:F
+void conv_net(list<net_set>* kbnet, int k,int nof_vars){	
+	list<net_set>::iterator it;
+ 	//int j=0;
+ 	//each it is one of k best 
+	for(it=kbnet->begin();it!=kbnet->end();it++){
+		for(int p=0;p<nof_vars;p++){
+
+			(*it).net[p]=parset2varset(p,((*it).net[p]));
+	//		j++;
+		}
+	}
+}
+
+/*================================================================*/
+//To convert net string into arc set
+//HR: call net2arc(dirname,k,nof_vars);
+//HR:F
+void net2arc(char* dirname,int k,int nof_vars){
+	score_t s;
+	string str;
+	unsigned int vset;
+	char str1[32];
+	//HR: for each j'th best network
+	for(int j=0;j<k;j++){
+		str.assign(dirname);
+	  	str.append("/");
+    	sprintf(str1,"%d",j);
+    	str.append(str1);
+		str.append("net");
+		FILE* netf=fopen(str.c_str(),"r");
+		if(netf==NULL)
+			break;
+		str.assign(dirname);
+      	str.append("/");
+		str.append("arc");
+      	sprintf(str1,"%d",j);
+      	str.append(str1);
+
+		FILE* arcf=fopen(str.c_str(),"w");
+		fscanf(netf,"%f",&s);
+		//	printf("\n ===network %d",j);
+		for(int p=0;p<nof_vars;p++){
+			//		printf("\n\nVar %d's parents:\n\n",p);
+			fscanf(netf,"%u",&vset);
+			const int SHIFT = 8 * sizeof( unsigned ) - 1;
+   			const unsigned MASK = 1 << SHIFT;
+			for ( int i = 1; i <= SHIFT + 1; i++ ) {
+      			//		cout << ( vset & MASK ? '1' : '0' );
+				if(vset&MASK){
+					fprintf(arcf,"%u %d",SHIFT+1-i,p);
+					fprintf(arcf,"\n");
+				}
+				vset <<= 1;
+      	 	 }
+			//	printf("\n\n");
+		}
+		fclose(netf);			
+		fclose(arcf);
+	}
+}
+
+/*================================================================*/
+//Write net file
+//HR: call write_net(kbnetscore,dirname,k,nof_vars);
+//HR: get files: 0net, 1net, ..., (k-1)net
+void write_net(list<net_set> kbnetscore[],char* dirname,int k,int nof_vars)
+{
+	string str;
+	list<net_set>::iterator it;
+	char str1[10];
+	int j=0;
+	//HR: each it is the one of the k best
+	for(it=kbnetscore[(1U<<(nof_vars))-1].begin();it!=kbnetscore[(1U<<(nof_vars))-1].end();it++){
+    	str.assign(dirname);
+      	str.append("/");
+      	sprintf(str1,"%d",j++);
+      	str.append(str1);
+      	str.append("net");
+      	FILE* netf=fopen(str.c_str(),"w");
+      	fprintf(netf,"%f \n",(*it).score);
+		//	cout<<(*it).score<<endl;
+      	for(int p=0;p<nof_vars;p++){
+			//					(*it).net[p]=parset2varset(
+      		fprintf(netf,"%u \n",(*it).net[p]);
+        }
+      	fclose(netf);
+	}
+
+}
+
+/*================================================================*/
+
+void print_scores(list<net_set> kbnetscore[],char* dirname,int k,int nof_vars){
+//	string str;
+	list<net_set>::iterator it;
+		
+	int j=0;
+	for(j=0;j<((1U<<nof_vars)-1);j++) 
+	for(it=kbnetscore[j].begin();it!=kbnetscore[j].end();it++){
+     	cout<<(*it).score<<endl;
+  	}
+	
+}
+
+/*================================================================*/
+
+
+//HR: Add
+//HR: Update from comp_post_compl, now compute the exact post. prob. using
+//    denominator P(D) instead of \hat{P}(D) = \sum{G \in the set of k best G's} P(G,D)
+//    require exactPD.txt (computed by POSTER) is stored under the directory
+//Compute each edge out of nof_vars * nof_vars, instead of just the best network
+
+void comp_postExact_compl(list<net_set>* kbnet, int k, char* dirname, int nof_vars){
+	
+	//cout << "Start comp_postExact_compl()" << endl;
+	//long double Sum=0.0;
+	//double logSum = LOG_ZERO;
+	
+	list<net_set>::iterator it;
+	
+	//HR: assume k < 5000
+	long double postExact[5000];
+
+	string str;
+	char str1[32];
+	
+	//cout << "dirname = " << dirname << endl;
+	str.assign(dirname);
+    str.append("/");
+    str.append("exactPD.txt");
+    //str.assign("exactPD.txt");
+    
+    FILE *fp;
+	fp=fopen(str.c_str(),"r");
+	double exactPD = 0.0;
+
+	if(!feof(fp)){
+		char c;
+		fscanf(fp, "%lf", &exactPD);
+		fscanf(fp,"%c",&c);	
+	}
+	fclose(fp);
+	//printf("exactPD = %18.8f\n", exactPD);
+
+	
+	str.assign(dirname);
+	str.append("/netpostExact");
+	fp=fopen(str.c_str(),"w");
+
+	//for each it of k best networks
+//	for(it=kbnet->begin();it!=kbnet->end();it++){
+//		//HR: change it
+//		//sum+=exp((*it).score);
+//		logAddComp(logSum, (*it).score); //HR
+//	}	
+//	cout << "logSum: " << logSum << endl; //HR
+//	printf("logSum = %18.6f\n", logSum);
+//	//
+//	long double Sum = exp(logSum); //HR
+//	cout << "Sum: " << exp(logSum) << endl; //HR
+	//
+	
+	int i=0;
+	//for each it of k best networks,  compute equation (4)
+	//each post[i] ( 0 <= i <= k - 1). repre post prob for i'th best network  
+	for(it=kbnet->begin();it!=kbnet->end();it++){
+		//post[i]=(exp((*it).score))/sum;
+		//double logScore = (*it).score;
+		//LOGMINUS_NEW(logScore, logSum)
+		postExact[i]=exp( (*it).score - exactPD ); //
+		fprintf(fp,"%Lg\n",postExact[i]);				
+		i++;
+	}
+	fclose(fp);
+	
+	
+	//Start the update
+	
+	//define and init
+	long double postProbExact[nof_vars][nof_vars];
+	for(int i = 0; i < nof_vars; i++){
+		for (int j = 0; j < nof_vars; j++){
+			postProbExact[i][j] = 0.0;
+		}
+	}
+
+	int listSize = kbnet->size();
+	int num1 = -1;
+	int num2 = -1;
+	
+	
+	//HR: for each j of k best networks, j >=1
+	for(int j=0; j<listSize; j++){
+		str.assign(dirname);
+    	str.append("/");
+    	str.append("arc");
+    	sprintf(str1,"%d",j);
+		str.append(str1);
+		fp=fopen(str.c_str(),"r");
+		//				fp=fopen(str.c_str(),"r");
+		
+		//HR: for each edge in j'th best network
+		while(!feof(fp)){
+			char c;
+			fscanf(fp,"%d",&num1);
+			fscanf(fp,"%d",&num2);
+			fscanf(fp,"%c",&c);	
+			postProbExact[num1][num2] += postExact[j];
+			//HR: needed! why? Otherwise there is error. fscanf() could not exactly overwrite the content of &num1/&num2
+			num1 = -1;
+			num2 = -1;
+
+		}//HR: end of while(!feof(fp));
+		fclose(fp);
+	}//HR: end of for
+	
+	str.assign(dirname);
+	str.append("/postProbExactEachEdge.txt");
+	ofstream totalOf1(str.c_str());
+
+	for(int i = 0; i < nof_vars; i++){
+		for (int j = 0; j < nof_vars; j++){
+			totalOf1 << "" << j << " -> " << i << " \t" << postProbExact[j][i] << endl;
+		}
+	}
+			
+} //end void comp_postExact_compl()
+
+
+
+
+//HR: Add
+//HR: Update from comp_post
+//Compute each edge out of nof_vars * nof_vars, instead of just the best network
+void comp_post_compl(list<net_set>* kbnet, int k, char* dirname, int nof_vars){
+	//long double Sum=0.0;
+	double logSum = LOG_ZERO;
+	list<net_set>::iterator it;
+	//HR: assume k < 5000
+	long double post[5000];
+
+	string str;
+	char str1[32];
+	str.assign(dirname);
+	str.append("/netpost");
+	FILE *fp=fopen(str.c_str(),"w");
+
+	//for each it of k best networks
+	for(it=kbnet->begin();it!=kbnet->end();it++){
+		//HR: change it
+		//sum+=exp((*it).score);
+		logAddComp(logSum, (*it).score); //HR
+	}	
+	//cout << "logSum: " << logSum << endl; //HR
+	//printf("logSum = %18.6f\n", logSum);
+	//
+	long double Sum = exp(logSum); //HR
+	//cout << "Sum: " << exp(logSum) << endl; //HR
+	//
+	
+	int i=0;
+	//for each it of k best networks,  compute equation (4)
+	//each post[i] ( 0 <= i <= k - 1). repre post prob for i'th best network  
+	for(it=kbnet->begin();it!=kbnet->end();it++){
+		//post[i]=(exp((*it).score))/sum;
+		//double logScore = (*it).score;
+		//LOGMINUS_NEW(logScore, logSum)
+		post[i]=exp( (*it).score - logSum ); //
+		fprintf(fp,"%Lg\n",post[i]);				
+		i++;
+	}
+	fclose(fp);
+	
+	
+	//Start the update
+	
+	//define and init
+	long double postProb[nof_vars][nof_vars];
+	for(int i = 0; i < nof_vars; i++){
+		for (int j = 0; j < nof_vars; j++){
+			postProb[i][j] = 0.0;
+		}
+	}
+
+	int listSize = kbnet->size();
+	int num1 = -1;
+	int num2 = -1;
+	
+	
+	//HR: for each j of k best networks, j >=1
+	for(int j=0; j<listSize; j++){
+		str.assign(dirname);
+    	str.append("/");
+    	str.append("arc");
+    	sprintf(str1,"%d",j);
+		str.append(str1);
+		fp=fopen(str.c_str(),"r");
+		//				fp=fopen(str.c_str(),"r");
+		
+		//HR: for each edge in j'th best network
+		while(!feof(fp)){
+			char c;
+			fscanf(fp,"%d",&num1);
+			fscanf(fp,"%d",&num2);
+			fscanf(fp,"%c",&c);	
+			postProb[num1][num2] += post[j];
+			//HR: needed! why? Otherwise there is error. fscanf() could not exactly overwrite the content of &num1/&num2
+			num1 = -1;
+			num2 = -1;
+
+		}//HR: end of while(!feof(fp));
+		fclose(fp);
+	}//HR: end of for
+	
+	str.assign(dirname);
+	str.append("/postProbEachEdge.txt");
+	ofstream totalOf1(str.c_str());
+
+	for(int i = 0; i < nof_vars; i++){
+		for (int j = 0; j < nof_vars; j++){
+			totalOf1 << "" << j << " -> " << i << " \t" << postProb[j][i] << endl;
+		}
+	}
+			
+}
+
+
+
+//Computation of posterior probabilities - This function's call has been commented. Remove the commenting slashes if the posterior probability needs to be computed.
+//HR: call comp_post(&kbnetscore[nof_combs-1],k,dirname);
+
+void comp_post(list<net_set>* kbnet, int k, char* dirname){
+	//long double Sum=0.0;
+	double logSum = LOG_ZERO;
+	list<net_set>::iterator it;
+	long double post[5000];
+
+	string str;
+	char str1[32];
+	str.assign(dirname);
+	str.append("/netpost");
+	FILE *fp=fopen(str.c_str(),"w");
+
+	//for each it of k best networks
+	for(it=kbnet->begin();it!=kbnet->end();it++){
+		//HR: change it
+		//sum+=exp((*it).score);
+		logAddComp(logSum, (*it).score); //HR
+	}	
+	cout << "logSum: " << logSum << endl; //HR
+	//
+	long double Sum = exp(logSum); //HR
+	cout << "Sum: " << exp(logSum) << endl; //HR
+	//
+	
+	int i=0;
+	//for each it of k best networks,  compute equation (4)
+	//each post[i] ( 0 <= i <= k - 1). repre post prob for i'th best network  
+	for(it=kbnet->begin();it!=kbnet->end();it++){
+		//post[i]=(exp((*it).score))/sum;
+		//double logScore = (*it).score;
+		//LOGMINUS_NEW(logScore, logSum)
+		post[i]=exp( (*it).score - logSum ); //
+		fprintf(fp,"%Lg\n",post[i]);				
+		i++;
+	}
+	fclose(fp);
+	
+	
+	ifstream indata;
+	int n=0;
+	int num[50][2];
+	int num1,num2;
+	//		char f[50][20];
+	long double postf[50];
+	str.assign(dirname);
+    str.append("/");
+    str.append("arc0");
+	fp=fopen(str.c_str(),"r");
+	//   	fp=fopen(str.c_str(),"r");
+	i=0;
+	while(!feof(fp)){
+		char c;
+		//HR: for parent
+		fscanf(fp,"%d",&num[i][0]);
+		//HR: for var
+		fscanf(fp,"%d",&num[i][1]);
+		fscanf(fp,"%c",&c);
+
+		//indata>>num[i][1];
+		//HR:
+		//				cout<<"HIIIII"<<num[i][0]<<"'"<<num[i][1]<<endl;
+
+		//				indata.getline(f[i],100);
+		i++;
+	}
+	//HR:
+	//i: the no. of lines in the arc0; so only for the edges in the best network
+	n=i-1;
+	cout<<n<<endl;
+	
+	//HR: postf vs. post
+	//HR: due to equality (5)
+	for(i=0;i<n;i++){
+		postf[i]=post[0];
+	}
+		
+	//indata.close();
+	fclose(fp);
+	int j;
+	
+	//HR: for each j of k best networks, j >=1
+	for(j=1;j<k;j++){
+		str.assign(dirname);
+    	str.append("/");
+    	str.append("arc");
+    	sprintf(str1,"%d",j);
+		str.append(str1);
+		fp=fopen(str.c_str(),"r");
+		//				fp=fopen(str.c_str(),"r");
+		
+		//HR: for each edge in j'th best network
+		while(!feof(fp)){
+			char c;
+			fscanf(fp,"%d",&num1);
+			fscanf(fp,"%d",&num2);
+			fscanf(fp,"%c",&c);
+			//						indata>>num1;
+			//					indata>>num2;
+	
+			//HR:
+			//						cout<<endl<<endl<<endl<<num1<<",,,"<<num2<<endl;
+			//HR: check whether such edge is one of the edeges in the best network 0net
+			for(i=0;i<n;i++){
+//				if(!strcmp(str1,f[i]))
+				//HR: if such edge is one of the edeges in the best network 0net
+				if(num1==num[i][0]&&num2==num[i][1]){
+					postf[i]+=post[j];
+					//HR: can add break; since each edge out of n edges in the best net is different
+				}	
+			}
+			num1=num2=-1;
+		}//HR: end of while(!feof(fp));
+		fclose(fp);
+	}//HR: end of for
+
+	//HR: print out the posterior prob. for each edge in the best network
+	for(j=0;j<n;j++)
+		cout<<postf[j]<<endl;
+			
+}
+
+
+/*================================================================*/
+//inside it: get_top_k for the features
+//HR:F
+void get_kbest_nets(int nof_vars, FILE** fp,int k, char* dirname){
+    int h;
+    //HR: 2^nof_vars
+	varset_t nof_combs = 1U<<(nof_vars);
+	//HR:
+	//cout<<"No of combs:  "<<nof_combs<<endl;
+    //cout<<"Get k best nets"<<endl;
+    //
+	
+	//cout << "before list<net_set> kbnetscore[nof_combs]" << endl;
+	//cerr << "before list<net_set> kbnetscore[nof_combs]" << endl;
+	//HR: net_set is the (net, score) pair
+	//HR: have not yet set each list kbnetscore[W] the size k
+	list<net_set> kbnetscore[nof_combs];
+	//cerr << "after list<net_set> kbnetscore[nof_combs]" << endl;
+	//cout << "after list<net_set> kbnetscore[nof_combs]" << endl;
+    list<net_set>::iterator it;
+    
+	vector<net_set> bnets;
+	
+	//HR: score_network is (variable set, score) pair
+	score_network s;
+	
+	vector<score_network> bparents;
+	
+	//HR: Add hash_set knets here; global may be better so that gettopk can access
+	//NetScoreHashSet knets;
+	//
+	//cout << "before net_set netw" << endl;
+	
+	net_set netw;
+	netw.score=0;
+	for(int j=0;j<nof_vars;j++)
+		netw.net[j]=0;
+	kbnetscore[0].push_back(netw);
+	
+	//cout << "before insert_vec(&kbnetscore[0],netw,k,nof_vars)" << endl;
+		
+	//HR
+	insert_vec(&kbnetscore[0],netw,k,nof_vars);
+		
+	//HR: call void print_queue(list<net_set> v[],int size,int nof_vars)
+	//cout << "print_queue(kbnetscore)" << endl;
+	//print_queue(kbnetscore,(1U<<nof_vars),nof_vars);
+//	scanf("%d",&h);
+//	cout<<"Pushed!!!"<<endl;
+	//
+	
+	varset_t varset;
+	int sink;
+	
+	//HR: W \subset V except empty set; 	
+	//HR: varset is the binary repre of W
+	for(varset=1;varset<nof_combs;varset++){
+		//HR
+//		if(varset % 10000 == 1){
+//			cout<<"====Varset==="<<varset<<endl; //
+//		}
+		//
+		
+		
+		//HR: Add for hash_set knets
+		//totally clean
+		//cout << "knets.clear() begins:" << endl;		
+		int knetsSize = knets.size() ;
+		const net_set * nsPtrA[knetsSize];
+		int j = 0;
+		for(NetScoreHashSet::iterator it = knets.begin(); it != knets.end(); it++){
+			nsPtrA[j++] = *it;
+		}
+		knets.clear();
+
+		//really delete each object
+		for(j = 0; j < knetsSize; j++){
+			delete nsPtrA[j];  //delete (*nsPtrA[j]) is wrong 
+		}		
+		//cout << "knets.clear() ends." << endl;
+		//
+		
+
+ 		//HR: for each sink
+		for(sink = 0; sink<nof_vars;sink++){
+			//		cout<<"Sink "<<sink<<endl;
+			varset_t sinkleton = 1U<<sink;
+			//			cout<<"sinkleton"<<sinkleton<<endl;
+			varset_t upvars;
+			
+			//HR: if sink is the subset of W
+			if (varset & sinkleton){
+				//				cout<<"inside if loop";
+				upvars = varset& ~sinkleton;
+				//			cout<<"Upvars:"<<upvars<<endl;
+				
+				//HR: construct array bnets from kbnetscore[upvars]
+				bnets.clear();
+				bnets.resize(kbnetscore[upvars].size());
+				copy(kbnetscore[upvars].begin(), kbnetscore[upvars].end(), bnets.begin());
+				//	print_queue(&bnets,nof_vars);
+				//	scanf("%d",&h);
+				//cout<<"Copied"<<endl;
+				
+				//HR: construct array bparents from kbps[s][upvars]
+				bparents.clear();
+				while(1){
+					fread(&s.scores,sizeof(score_t),1,fp[sink]);
+					//cout<<"read score"<<endl;
+					if(s.scores==1000.0)
+						break;
+
+					fread(&s.vset,sizeof(varset_t),1,fp[sink]);	
+					//	cout<<"read varset"<<endl;
+					//int num =k;
+					//insert_vec(&bparents,s,num);
+										
+					bparents.push_back(s);
+					//	print_queue(&bparents);
+					//scanf("%d",&h);
+				}
+				
+				//scanf("%d",&h);
+				//printf("\n\n\nB PARENTS ============\n\n");
+				//print_queue(&bparents);
+				//scanf("%d",&h);
+
+				//printf("\n\n\nB nets =================\n\n");
+				//print_queue(&bnets,nof_vars);
+				//scanf("%d",&h);
+
+				//printf("\n\n\nKBNETSCORE %u =================\n\n",varset);
+				//print_queue(&kbnetscore[varset],nof_vars);
+				//scanf("%d",&h);
+
+				////printf("K = %d",k);
+
+				//printf("Sink = %d",sink);
+
+
+
+				//cout<<"Goin to call gettopk"<<endl;
+            	gettopk(&bnets,&bparents,&kbnetscore[varset],k,sink,nof_vars); //new function: for each combination from n: totally 2^n
+				//printf("\n\n\nAfter topkKBNETSCORE %u =================\n\n",varset);
+				//print_queue(&kbnetscore[varset],nof_vars);
+				
+			}//end of if
+
+
+		}//end of for each sink
+		//scanf("%d",&h);
+		
+	}//end of for each W
+	//HR: last clear
+	//cout << "knets.clear() at the end of V begins: " << endl;
+		int knetsSize = knets.size() ;
+		const net_set * nsPtrA[knetsSize];
+		int j = 0;
+		for(NetScoreHashSet::iterator it = knets.begin(); it != knets.end(); it++){
+			nsPtrA[j++] = *it;
+		}
+		knets.clear();
+
+		//really delete each object
+		for(j = 0; j < knetsSize; j++){
+			delete nsPtrA[j];  //delete (*nsPtrA[j]) is wrong 
+		}
+	//cout << "knets.clear() at the end of V ends. " << endl;
+	
+
+	
+	//HR
+	//print_queue(kbnetscore,32,5); //32 = 2^5
+
+	//cout << "main part of get__kbest_nets() is done." << endl;
+	
+	//HR: only consider V, the bianary repre is nof_combs-1
+	conv_net(&kbnetscore[nof_combs-1],k,nof_vars);
+	//cout << "conv_net(&kbnetscore[nof_combs-1],k,nof_vars) is done." << endl;
+		
+	//HR: get files: 0net, 1net, ..., (k-1)net	
+	write_net(kbnetscore,dirname,k,nof_vars);
+	//cout << "write_net(kbnetscore,dirname,k,nof_vars) is done." << endl;
+	
+	net2arc(dirname,k,nof_vars);
+	//cout << "net2arc(dirname,k,nof_vars) is done." << endl;
+	
+	//HR:
+	//cout << endl;
+	//cout << "kbnetscore[nof_combs-1].size() = " << kbnetscore[nof_combs-1].size() << endl;
+	//cout << "1st network score: " << kbnetscore[nof_combs-1].front().score << endl;
+	//cout << "last network score: " << kbnetscore[nof_combs-1].back().score << endl;
+	//cout << "The difference of the scores = " << ( kbnetscore[nof_combs-1].front().score - kbnetscore[nof_combs-1].back().score ) << endl;
+	//cout << endl;
+	//
+
+	//comp_post(&kbnetscore[nof_combs-1],k,dirname);  //new function: compute the posterior prob.
+	comp_post_compl(&kbnetscore[nof_combs-1],k,dirname, nof_vars);	
+	cout << "comp_post_compl(&kbnetscore[nof_combs-1],k,dirname) is done." << endl;
+	
+	//comp_postExact_compl(&kbnetscore[nof_combs-1],k,dirname, nof_vars);
+	cout << "comp_postExact_compl(&kbnetscore[nof_combs-1],k,dirname, nof_vars) is not done. we will change it if requires" << endl;
+	
+	//HR:
+	//	print_scores(kbnetscore,dirname,k,nof_vars);	
+	
+}//end of get_kbest_nets
+
+/*================================================================*/
+
+//HR:F
+int main(int argc, char* argv[]){
+	FILE* fp[32];
+	string str;
+	char str1[10];
+	//	printf("argc : %d \n\n",argc);
+	if(argc!=4){
+		fprintf(stderr, "Usage: get_kbest_nets nof_vars dirname k\n");
+        return 1;
+	}
+		
+	int nof_vars = atoi(argv[1]);
+	int k = atoi(argv[3]);
+	//	printf("No of vars: %d   K: %d\n\n",nof_vars,k);
+	for(int j=0;j<nof_vars;j++){
+		str.assign(argv[2]);
+		str.append("/");
+		sprintf(str1,"%d",j);
+		str.append(str1);
+		str.append(".kbps");
+		//		cout<<str<<endl;
+		//HR:   In order to open a file as a binary file, a "b" character has to be included in the mode string
+		fp[j]=fopen(str.c_str(),"rb");
+	}
+	//HR:
+	//cout<<"Calling function getkbestnets\n";
+	//
+	get_kbest_nets(nof_vars, fp, k,argv[2]);
+	//cout<<"Success!"<<endl;
+	return 0;
+		
+}
+	
+
+
diff --git a/sourcecodes/k-best/src/get_kbest_parents b/sourcecodes/k-best/src/get_kbest_parents
new file mode 100644
index 00000000..e79b12b4
--- /dev/null
+++ b/sourcecodes/k-best/src/get_kbest_parents
Binary files differdiff --git a/sourcecodes/k-best/src/get_kbest_parents.cc b/sourcecodes/k-best/src/get_kbest_parents.cc
new file mode 100644
index 00000000..9377d11e
--- /dev/null
+++ b/sourcecodes/k-best/src/get_kbest_parents.cc
@@ -0,0 +1,249 @@
+//HR: formetted only, no code change
+
+#include <string>
+#include <cmath>
+#include <iostream>
+#include "cfg.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <list>
+#define EPSILON 0.001
+
+
+#include "files.h"
+
+using namespace std;
+
+int h;
+
+//class for bparents
+//HR:F
+//HR: (variable set, score) pair
+//This class is to store the best parent set and the corresponding score
+class score_network{
+   	public:
+    	score_t scores;
+		varset_t bsps;
+
+       	score_network(score_t a,varset_t b){ 
+        	scores=a;
+          	bsps=b;
+      	}
+
+        score_network(){
+          	scores=bsps=0;
+       	}
+     
+      	friend int operator<(score_network s1,score_network s2);
+      	friend int operator==(score_network s1,score_network s2);
+      	friend int operator>(score_network s1,score_network s2);
+      	friend bool same_obj(score_network s1, score_network s2);
+         
+
+};
+
+//HR:F
+/*================================================================*/
+
+void print_queue(list<score_network>* v){
+
+	list<score_network>::iterator iter;
+
+	for(iter=v->begin();iter!=v->end();iter++){
+		cout<<"    "<<(*iter).bsps<<","<<(*iter).scores;
+	}
+    
+}
+	
+//HR:F
+/*================================================================*/
+
+int operator<(score_network s1,score_network s2){
+ 	if(fabs(s1.scores-s2.scores)<EPSILON){
+     	return false;
+   	}
+    return(s1.scores<s2.scores);
+
+}
+
+
+int operator>(score_network s1,score_network s2){
+
+	if(fabs(s1.scores-s2.scores)<EPSILON){
+    	return false;
+    }
+    return(s1.scores>s2.scores);
+
+}
+
+int operator==(score_network s1,score_network s2){
+	return(fabs(s1.scores-s2.scores)<EPSILON);
+
+}
+
+
+bool same_obj(score_network s1, score_network s2){
+    return((s1==s2)&&(s1.bsps==s2.bsps));
+    
+}
+
+/*================================================================*/
+//HR:F
+//To insert into the best parent set list
+void insert_vec(list<score_network>* v,score_network s, int k){
+  	list<score_network>::iterator it;
+
+	if( s < v->back()){
+		v->push_back(s);
+   	}
+    else{
+      	for(it=v->begin();it!=v->end();it++){
+			if(same_obj(s,*it)){
+				break;
+	        }
+            else if(s>(*it)){
+              	v->insert(it,s);
+				break;
+			}
+
+		}
+	}
+     
+	if(v->size()>k){
+		v->pop_back();
+  	}   
+
+}
+
+/*================================================================*/
+
+void get_best_parents(int nof_vars, char* dirname, int k){
+	varset_t nof_parsets = 1U<<(nof_vars-1);
+	int i;
+//		cout<<endl<<"Inside fn";
+	list<score_network> v[nof_parsets];
+    list<score_network>::iterator it;
+	score_network s;
+   	string str;
+    char str1[40];
+    
+    //HR: For each var
+  	for(i=0;i<nof_vars; ++i){
+		/* READ SCORES FOR i */
+		str.assign(dirname);
+        str.append("/");
+        sprintf(str1,"%d",i); 
+        str.append(str1);
+		//	cout<<str;
+		FILE* fin = fopen(str.c_str(),"rb");
+
+		//	cout<<fin;
+		//	scanf("%d",&h);
+		
+		//HR: for all the possible parents 
+		//Read local score and add it to the queue
+		for(int j=0;j<nof_parsets;j++){
+			fread(&s.scores, sizeof(score_t), 1, fin);
+			//	cout<<s.scores;
+			//	scanf("%d",&h);
+			s.bsps = j;
+			
+			//HR: At this time, every queue has only one element s
+			v[j].push_back(s);
+
+
+		}
+		fclose(fin);
+
+
+		/* FIND BEST PARENTS AND THEIR SCORES IN EACH SET FOR i */
+
+		varset_t ps;
+		
+		//HR: for each possible parent set cs 
+		//For each possible parent set compare and  add to the list if it is within best k parent sets
+		for(ps=0; ps<nof_parsets; ++ps){
+			varset_t psel = 1U;
+
+			//HR: psel represents the number equals the single element which is not in the ps
+			//
+			for(psel=1; psel<nof_parsets; psel <<= 1){
+				if (ps & psel){
+					
+					//HR: use xor to get the subset whose size is 1 smaller
+					varset_t subset = ps^psel;                                        
+					for(it=v[subset].begin();it!=v[subset].end();it++){
+						if(v[ps].size()<k){
+							insert_vec(&v[ps],*it, k);
+
+						}
+						else if(v[ps].size()==k){
+							if(((*it)<v[ps].back())||(*it)==v[ps].back()){
+								break;
+							}
+							else{
+								insert_vec(&v[ps], *it, k);
+
+
+							}
+						}
+					}
+				}
+			}
+		}
+
+
+
+		/* WRITE BEST PARENTS FOR i */
+		str.append(".kbps");
+		FILE* fout = fopen(str.c_str(),"wb");
+		double sentinel = 1000.0;
+		//printf("nofparset: %u",nof_parsets);				
+		for(int j=0;j<nof_parsets;j++){
+			//	int g=0;
+			//	print_queue(&v[j]);
+			//	printf("\n");
+			for(it=v[j].begin();it!=v[j].end();it++){
+				//	g++;
+				//fwrite(&v[j]
+				fwrite(&(it->scores), sizeof(double), 1, fout);
+				fwrite(&(it->bsps),sizeof(unsigned int),1,fout);
+				//print_queue(&v[j]);
+				//printf("\n");
+				//fprintf(fout,"\n");
+			}
+						
+			fwrite(&sentinel,sizeof(double),1,fout);
+			v[j].clear();
+							
+		}
+		//printf("\n");
+		fclose(fout);
+				
+	}// endfor(i=0;i<nof_vars; ++i)
+	
+}
+
+/*================================================================*/
+
+//HR: F
+int main(int argc, char* argv[]){
+	
+	//    cout<<endl<<"Get K Best Parent sets"<<endl;      
+   	if (argc!=4){
+      	fprintf(stderr, "Usage: best_parents nof_vars dirname k\n");
+       	return 1;
+  	}
+      
+	char str[32];
+	int nof_vars = atoi(argv[1]);
+   	int k = atoi(argv[3]);
+      
+   	//strcpy(str,argv[2]);
+      
+   	get_best_parents(nof_vars, argv[2],k);
+  
+   	return 0;
+}
diff --git a/sourcecodes/k-best/src/get_local_scores.h b/sourcecodes/k-best/src/get_local_scores.h
new file mode 100644
index 00000000..3a86d9c9
--- /dev/null
+++ b/sourcecodes/k-best/src/get_local_scores.h
@@ -0,0 +1,15 @@
+#ifndef _GET_LOCAL_SCORES_H_
+#define _GET_LOCAL_SCORES_H_
+
+#include "cfg.h"
+
+extern int  N;
+extern int  nof_vars;
+extern int* nof_vals;
+int*    freqmem; /* a working memory to collect the conditional frequences */
+
+extern score_t get_nof_cfgs(varset_t vs);
+typedef score_t (*scorefun) (int, varset_t, int);
+typedef void (*scorefree) ();
+
+#endif
diff --git a/sourcecodes/k-best/src/graph.sh b/sourcecodes/k-best/src/graph.sh
new file mode 100644
index 00000000..12967360
--- /dev/null
+++ b/sourcecodes/k-best/src/graph.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+k=10
+rdir=./../iris3/resdir
+for ((  i = 0 ;  i < k;  i++  ))
+do
+#if which dot > /dev/null; then
+    ${rdir}/../../src/net2parents ${rdir}/${i}net ${rdir}/${i}parent \
+	| ${rdir}/../../src/parents2arcs ${rdir}/${i}parent ${rdir}/${i}arc \
+	| ${rdir}/../../src/arcs2dot ${rdir}/../iris.vd ${rdir}/${i}arc ${rdir}/dot_$i \
+	| dot ${rdir}/dot_$i -Tps -o ${rdir}/dot_res_${i}.ps
+    echo See $d/resdir/iris.ps for a postscript picture of the net.
+#fi
+done
\ No newline at end of file
diff --git a/sourcecodes/k-best/src/ilogi.c b/sourcecodes/k-best/src/ilogi.c
new file mode 100644
index 00000000..50a8e651
--- /dev/null
+++ b/sourcecodes/k-best/src/ilogi.c
@@ -0,0 +1,37 @@
+#include <stdlib.h>
+#include <math.h>
+#include "cfg.h"
+#include "ilogi.h"
+
+score_t* ilogi = NULL;
+int      len_ilogi = 0;
+
+static int refcount = 0;
+
+int ensure_ilogi(int maxi){
+  if (maxi >= len_ilogi)
+    len_ilogi = maxi+1;
+  
+  ilogi = (score_t*) realloc(ilogi, len_ilogi * sizeof(score_t));
+  ++refcount;
+
+  {
+    int i;
+
+    if (ilogi) 
+      ilogi[0] = 0.0;
+
+    for(i=1;i<len_ilogi;++i) 
+      ilogi[i] = i*log(i);
+  }
+  
+  return 1;
+}
+ 
+void free_ilogi(){
+  --refcount;
+  if (!refcount){
+    free(ilogi);
+    ilogi = NULL;
+  }
+}
diff --git a/sourcecodes/k-best/src/ilogi.h b/sourcecodes/k-best/src/ilogi.h
new file mode 100644
index 00000000..4fef7a35
--- /dev/null
+++ b/sourcecodes/k-best/src/ilogi.h
@@ -0,0 +1,9 @@
+#ifndef _ILOGI_H_
+#define _ILOGI_H_
+#include "cfg.h"
+
+extern score_t* ilogi;
+extern int ensure_ilogi(int maxi);
+extern void free_ilogi();
+
+#endif
diff --git a/sourcecodes/k-best/src/ls_BDe.c b/sourcecodes/k-best/src/ls_BDe.c
new file mode 100644
index 00000000..83865f31
--- /dev/null
+++ b/sourcecodes/k-best/src/ls_BDe.c
@@ -0,0 +1,163 @@
+#include <stdlib.h>
+#include <string.h>
+#include<stdio.h>
+#include <math.h>
+#include "get_local_scores.h"
+#include "ilogi.h"
+#include "ls_BDe.h"
+
+extern int*     nof_vals;
+extern int      N;
+
+score_t ess;
+
+int*    freq2mem  = NULL;
+int*    freq2mem2 = NULL;
+int     nof_freq2s;
+
+
+#define BIG_BDE_DATA (1<<10)
+
+extern double lgamma(double); /* to avoid the warning with ansi-flag */
+
+/* BDe */
+
+score_t big_bde_score(int i, varset_t psi, int nof_freqs){
+
+  int vc_v = nof_vals[i];
+  score_t pcc =  get_nof_cfgs(psi);
+  score_t ess_per_pcc = ess / pcc;
+  score_t ess_per_cc  = ess_per_pcc / vc_v;
+
+  int* freqp = freqmem;
+  int* end_freqp = freqp + nof_freqs * vc_v;
+
+  score_t res = nof_freqs * lgamma(ess_per_pcc);
+  int nof_zeros = 0;
+    
+  memset(freq2mem,  0, nof_freq2s*sizeof(int)); /* could reset later */
+  memset(freq2mem2, 0, nof_freq2s*sizeof(int)); /* could reset later */
+
+  for(;freqp < end_freqp; freqp += vc_v) {
+    int  pcfreq = 0;
+    int v;
+    for(v = 0; v<vc_v; ++v) {
+      int freq = freqp[v];
+      if (freq) {
+	pcfreq += freq;
+	if(freq<nof_freq2s){
+	  ++freq2mem[freq];
+	} else {
+	  res += lgamma(ess_per_cc + freq);
+	}
+      } else {
+	++ nof_zeros;
+      }
+    }
+    if(pcfreq<nof_freq2s){
+      ++freq2mem2[pcfreq];
+    } else {
+      res -= lgamma(ess_per_pcc + pcfreq);
+    }
+  }
+
+  res += (nof_zeros - nof_freqs * vc_v) * lgamma(ess_per_cc);
+
+  {
+    int i;
+
+    for(i=1;i<nof_freq2s;++i){
+      int freq2 = freq2mem[i];
+      if(freq2) res += freq2 * lgamma(ess_per_cc + i);
+    }
+
+    for(i=1;i<nof_freq2s;++i){
+      int freq2 = freq2mem2[i];
+      if(freq2) res -= freq2 * lgamma(ess_per_pcc + i);
+    }
+
+  }
+
+  return res > 0.0 ? 0.0 : res;
+}
+
+
+score_t bde_score(int i, varset_t psi, int nof_freqs){
+//HR
+//printf ("bde score %d, %u %d",i, psi, nof_freqs);
+
+  int vc_v = nof_vals[i];
+  score_t pcc =  get_nof_cfgs(psi);
+  score_t ess_per_pcc = ess / pcc;
+  score_t ess_per_cc  = ess_per_pcc / vc_v;
+
+  int* freqp = freqmem;
+  int* end_freqp = freqp + nof_freqs * vc_v;
+
+  score_t res = nof_freqs * lgamma(ess_per_pcc);
+  int nof_zeros = 0;
+    
+  memset(freq2mem,  0, nof_freq2s*sizeof(int)); /* could reset later */
+  memset(freq2mem2, 0, nof_freq2s*sizeof(int)); /* could reset later */
+
+  for(;freqp < end_freqp; freqp += vc_v) {
+    int  pcfreq = 0;
+    int v;
+    for(v = 0; v<vc_v; ++v) {
+      int freq = freqp[v];
+      if (freq) {
+	pcfreq += freq;
+	++freq2mem[freq];
+      } else {
+	++ nof_zeros;
+      }
+    }
+    ++freq2mem2[pcfreq];
+  }
+
+  res += (nof_zeros - nof_freqs * vc_v) * lgamma(ess_per_cc);
+
+  {
+    int i;
+
+    for(i=1;i<nof_freq2s;++i){
+      int freq2 = freq2mem[i];
+      if(freq2) res += freq2 * lgamma(ess_per_cc + i);
+    }
+
+    for(i=1;i<nof_freq2s;++i){
+      int freq2 = freq2mem2[i];
+      if(freq2) res -= freq2 * lgamma(ess_per_pcc + i);
+    }
+
+  }
+
+  return res > 0.0 ? 0.0 : res;
+}
+
+
+
+scorefun init_BDe_scorer(char* arg){
+
+  scorefun sf;
+
+  ess = atof(arg);
+
+  if (N<BIG_BDE_DATA){
+    sf = bde_score;
+    nof_freq2s = N+1;
+  } else {
+    sf = big_bde_score;
+    nof_freq2s = BIG_BDE_DATA;
+  }
+
+  freq2mem  = malloc(nof_freq2s * sizeof(int));
+  freq2mem2 = malloc(nof_freq2s * sizeof(int));
+
+  return sf;
+}
+
+void free_BDe_scorer(){
+  if(freq2mem)  free(freq2mem);
+  if(freq2mem2) free(freq2mem2);
+}
diff --git a/sourcecodes/k-best/src/ls_BDe.h b/sourcecodes/k-best/src/ls_BDe.h
new file mode 100644
index 00000000..01a92fab
--- /dev/null
+++ b/sourcecodes/k-best/src/ls_BDe.h
@@ -0,0 +1,12 @@
+#ifndef _LS_BDE_H_
+#define _LS_BDE_H_
+
+#include "cfg.h"
+#include "get_local_scores.h"
+
+/* BDe = P(D|G,ess) */
+
+extern scorefun init_BDe_scorer();
+extern void free_BDe_scorer();
+
+#endif
diff --git a/sourcecodes/k-best/src/ls_LOO.c b/sourcecodes/k-best/src/ls_LOO.c
new file mode 100644
index 00000000..57a1fae4
--- /dev/null
+++ b/sourcecodes/k-best/src/ls_LOO.c
@@ -0,0 +1,152 @@
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+#include "get_local_scores.h"
+#include "ls_LOO.h"
+
+extern int*     nof_vals;
+extern int      N;
+
+static score_t ess;
+static int splitess;
+
+static int*    freq2mem  = NULL;
+static int*    freq2mem2 = NULL;
+static int     nof_freq2s;
+
+
+#define BIG_LOO_DATA (1<<10)
+
+/* LOO */
+
+score_t big_loo_score(int i, varset_t psi, int nof_freqs){
+
+  int vc_v = nof_vals[i];
+  score_t pcc =  get_nof_cfgs(psi);
+  score_t ess_per_pcc = splitess ? (ess / pcc)          : (ess*vc_v);
+  score_t ess_per_cc  = splitess ? (ess_per_pcc / vc_v) : ess;
+
+  int* freqp = freqmem;
+  int* end_freqp = freqp + nof_freqs * vc_v;
+
+  score_t res = - log(N);
+    
+  memset(freq2mem,  0, nof_freq2s*sizeof(int)); /* could reset later */
+  memset(freq2mem2, 0, nof_freq2s*sizeof(int)); /* could reset later */
+
+  for(;freqp < end_freqp; freqp += vc_v) {
+    int  pcfreq = 0;
+    int v;
+    for(v = 0; v<vc_v; ++v) {
+      int freq = freqp[v];
+      if (freq) {
+	pcfreq += freq;
+	if(freq<nof_freq2s){
+	  ++freq2mem[freq];
+	} else {
+	  res += freq * log(ess_per_cc + freq - 1);
+	}
+      }
+    }
+
+    if(pcfreq<nof_freq2s){
+      ++freq2mem2[pcfreq];
+    } else {
+      res -= pcfreq * log(ess_per_pcc + pcfreq);
+    }
+  }
+
+  {
+    int i;
+
+    for(i=1;i<nof_freq2s;++i){
+      int freq2 = freq2mem[i];
+      if(freq2) res += freq2 * i * log(ess_per_cc + i - 1);
+    }
+
+    for(i=1;i<nof_freq2s;++i){
+      int freq2 = freq2mem2[i];
+      if(freq2) res -= freq2 * i * log(ess_per_pcc + i);
+    }
+
+  }
+
+  return res > 0.0 ? 0.0 : res;
+}
+
+
+score_t loo_score(int i, varset_t psi, int nof_freqs){
+
+  int vc_v = nof_vals[i];
+  score_t pcc =  get_nof_cfgs(psi);
+
+  score_t ess_per_pcc = splitess ? (ess / pcc)          : (ess*vc_v);
+  score_t ess_per_cc  = splitess ? (ess_per_pcc / vc_v) : ess;
+
+  int* freqp = freqmem;
+  int* end_freqp = freqp + nof_freqs * vc_v;
+
+  score_t res = -log(N);
+    
+  memset(freq2mem,  0, nof_freq2s*sizeof(int)); /* could reset later */
+  memset(freq2mem2, 0, nof_freq2s*sizeof(int)); /* could reset later */
+
+  for(;freqp < end_freqp; freqp += vc_v) {
+    int  pcfreq = 0;
+    int v;
+    for(v = 0; v<vc_v; ++v) {
+      int freq = freqp[v];
+      if (freq) {
+	pcfreq += freq;
+	++freq2mem[freq];
+      }
+    }
+    ++freq2mem2[pcfreq];
+  }
+
+  {
+    int i;
+
+    for(i=1;i<nof_freq2s;++i){
+      int freq2 = freq2mem[i];
+      if(freq2) res += freq2 * i * log(ess_per_cc + i - 1);
+    }
+
+    for(i=1;i<nof_freq2s;++i){
+      int freq2 = freq2mem2[i];
+      if(freq2) res -= freq2 * i * log(ess_per_pcc + i);
+    }
+
+  }
+
+  return res > 0.0 ? 0.0 : res;
+}
+
+
+
+scorefun init_LOO_scorer(char* arg){
+
+  scorefun sf;
+  int arglen = strlen(arg);
+
+  ess = atof(arg);
+  splitess = arg[arglen-1] == 'l';
+
+  if (N<BIG_LOO_DATA){
+    sf = loo_score;
+    nof_freq2s = N+1;
+  } else {
+    sf = big_loo_score;
+    nof_freq2s = BIG_LOO_DATA;
+  }
+
+  freq2mem  = malloc(nof_freq2s * sizeof(int));
+  freq2mem2 = malloc(nof_freq2s * sizeof(int));
+
+  return sf;
+}
+
+void free_LOO_scorer(){
+  if(freq2mem)  free(freq2mem);
+  if(freq2mem2) free(freq2mem2);
+}
diff --git a/sourcecodes/k-best/src/ls_LOO.h b/sourcecodes/k-best/src/ls_LOO.h
new file mode 100644
index 00000000..a2963832
--- /dev/null
+++ b/sourcecodes/k-best/src/ls_LOO.h
@@ -0,0 +1,10 @@
+#ifndef _LS_LOO_H_
+#define _LS_LOO_H_
+
+#include "cfg.h"
+#include "get_local_scores.h"
+
+extern scorefun init_LOO_scorer();
+extern void free_LOO_scorer();
+
+#endif
diff --git a/sourcecodes/k-best/src/ls_NML.c b/sourcecodes/k-best/src/ls_NML.c
new file mode 100644
index 00000000..6c3523a4
--- /dev/null
+++ b/sourcecodes/k-best/src/ls_NML.c
@@ -0,0 +1,77 @@
+#include <math.h>
+#include "get_local_scores.h"
+#include "ilogi.h"
+#include "reg.h"
+#include "ls_NML.h"
+
+extern int*     nof_vals;
+extern int      N;
+
+#define BIG_NML_DATA (1<<16)
+
+/* NML = log(ML) - log(REGRET) */
+
+score_t big_nml_score(int i, varset_t psi, int nof_freqs){
+
+  int vc_v = nof_vals[i];
+  int* freqp = freqmem;
+  int* end_freqp = freqp + nof_freqs * vc_v;
+
+  score_t res = 0.0;
+
+  for(;freqp < end_freqp; freqp += vc_v) {
+    int  pcfreq = 0;
+    int v;
+    for(v = 0; v<vc_v; ++v) {
+      int freq = freqp[v];
+      if (freq) {
+	pcfreq += freq;
+	res += (freq < BIG_NML_DATA) ? ilogi[freq] : freq * log(freq);
+      }
+    }
+    res -= (pcfreq < BIG_NML_DATA) ? ilogi[pcfreq] : pcfreq * log(pcfreq);
+    res -= log(reg(pcfreq, vc_v)); /* regret */
+  }
+
+  return res;
+}
+
+score_t nml_score(int i, varset_t psi, int nof_freqs){
+
+  int vc_v = nof_vals[i];
+  int* freqp = freqmem;
+  int* end_freqp = freqp + nof_freqs * vc_v;
+
+  score_t res = 0.0;
+
+  for(;freqp < end_freqp; freqp += vc_v) {
+    int  pcfreq = 0;
+    int v;
+    for(v = 0; v<vc_v; ++v) {
+      int freq = freqp[v];
+      if (freq) {
+	pcfreq += freq;
+	res += ilogi[freq];
+      }
+    }
+    res -= ilogi[pcfreq];
+    res -= log(reg(pcfreq, vc_v)); /* regret */
+  }
+
+  return res;
+}
+
+
+scorefun init_NML_scorer(){
+  if (N<BIG_NML_DATA){
+    ensure_ilogi(N);
+    return nml_score;
+  } else {
+    ensure_ilogi(BIG_NML_DATA);
+    return big_nml_score;
+  }
+}
+
+void free_NML_scorer(){
+  free_ilogi();
+}
diff --git a/sourcecodes/k-best/src/ls_NML.h b/sourcecodes/k-best/src/ls_NML.h
new file mode 100644
index 00000000..bd7df9de
--- /dev/null
+++ b/sourcecodes/k-best/src/ls_NML.h
@@ -0,0 +1,12 @@
+#ifndef _LS_NML_H_
+#define _LS_NML_H_
+
+#include "cfg.h"
+#include "get_local_scores.h"
+
+/* NML = log(ML) - SUM_D log(ML(D)) */
+
+extern scorefun init_NML_scorer();
+extern void free_NML_scorer();
+
+#endif
diff --git a/sourcecodes/k-best/src/ls_XIC.c b/sourcecodes/k-best/src/ls_XIC.c
new file mode 100644
index 00000000..22d51d04
--- /dev/null
+++ b/sourcecodes/k-best/src/ls_XIC.c
@@ -0,0 +1,82 @@
+#include <math.h>
+#include <string.h>
+#include "get_local_scores.h"
+#include "ilogi.h"
+#include "ls_XIC.h"
+
+extern int*     nof_vals;
+extern int      N;
+
+static int bic = 0;
+
+#define BIG_XIC_DATA (1<<16)
+
+/* XIC = log(ML) - 0.5*nof_params*log(n) */
+
+score_t big_xic_score(int i, varset_t psi, int nof_freqs){
+
+  int vc_v = nof_vals[i];
+  score_t pcc =  get_nof_cfgs(psi);
+  score_t nof_params = pcc * (vc_v-1);
+  int* freqp = freqmem;
+  int* end_freqp = freqp + nof_freqs * vc_v;
+
+  score_t res = bic ? (-0.5 * nof_params * log(N)) : nof_params;
+
+  for(;freqp < end_freqp; freqp += vc_v) {
+    int  pcfreq = 0;
+    int v;
+    for(v = 0; v<vc_v; ++v) {
+      int freq = freqp[v];
+      if (freq) {
+	pcfreq += freq;
+	res += (freq < BIG_XIC_DATA) ? ilogi[freq] : freq * log(freq);
+      }
+    }
+    res -= (pcfreq < BIG_XIC_DATA) ? ilogi[pcfreq] : pcfreq * log(pcfreq);
+  }
+
+  return res;
+}
+
+score_t xic_score(int i, varset_t psi, int nof_freqs){
+
+  int vc_v = nof_vals[i];
+  score_t pcc =  get_nof_cfgs(psi);
+  score_t nof_params = pcc * (vc_v-1);
+  int* freqp = freqmem;
+  int* end_freqp = freqp + nof_freqs * vc_v;
+
+  score_t res = bic ? (-0.5 * nof_params * log(N)) : -nof_params;
+
+  for(;freqp < end_freqp; freqp += vc_v) {
+    int  pcfreq = 0;
+    int v;
+    for(v = 0; v<vc_v; ++v) {
+      int freq = freqp[v];
+      if (freq) {
+	pcfreq += freq;
+	res += ilogi[freq];
+      }
+    }
+    res -= ilogi[pcfreq];
+  }
+
+  return res;
+}
+
+scorefun init_XIC_scorer(char* essarg){
+  bic = strncmp(essarg,"BIC", 3) == 0;
+  
+  if (N<BIG_XIC_DATA){
+    ensure_ilogi(N);
+    return xic_score;
+  } else {
+    ensure_ilogi(BIG_XIC_DATA);
+    return big_xic_score;
+  }
+}
+
+void free_XIC_scorer(){
+  free_ilogi();
+}
diff --git a/sourcecodes/k-best/src/ls_XIC.h b/sourcecodes/k-best/src/ls_XIC.h
new file mode 100644
index 00000000..773a1d94
--- /dev/null
+++ b/sourcecodes/k-best/src/ls_XIC.h
@@ -0,0 +1,13 @@
+#ifndef _LS_XIC_H_
+#define _LS_XIC_H_
+
+#include "cfg.h"
+#include "get_local_scores.h"
+
+/* BIC = log(ML) - 0.5*nof_params*log(n) */
+/* AIC = log(ML) - 0.5*nof_params */
+
+extern scorefun init_XIC_scorer(char*);
+extern void free_XIC_scorer();
+
+#endif
diff --git a/sourcecodes/k-best/src/main.cc b/sourcecodes/k-best/src/main.cc
new file mode 100644
index 00000000..d84af256
--- /dev/null
+++ b/sourcecodes/k-best/src/main.cc
@@ -0,0 +1,51 @@
+#include<stdio.h>
+#include<stdlib.h>
+#include"math.h"
+
+#include"Arguments.h"
+#include"Model.h"
+#include"Engine.h"
+
+void welcome(){
+	fprintf(stderr,
+	" ~~~ Welcome ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"); 
+	fprintf(stderr, 
+	" Poster:  The Tool for Computing Posterior \n");
+	fprintf(stderr,
+	" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"); 
+
+}
+void goodbye(){
+	fprintf(stderr,
+	" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"); 
+}
+
+
+
+int main(int argc, char **argv){
+	welcome();
+
+	Arguments::init(argc, argv);
+	
+	Model model;
+
+	model.init();
+	
+	//HR
+	//model.makeADTree();
+	////model.MakeADContiTable();
+	//model.testHR_ADtree();
+	//model.freeADTree();
+	//return 1;
+	
+	//cerr << "Start Engine.h " << endl;
+	
+	Engine engine;
+
+	engine.init(&model);
+
+	engine.compute_edge_probabilities();
+
+	goodbye();
+	return 1;
+}
diff --git a/sourcecodes/k-best/src/net2parents.c b/sourcecodes/k-best/src/net2parents.c
new file mode 100644
index 00000000..f12e9f64
--- /dev/null
+++ b/sourcecodes/k-best/src/net2parents.c
@@ -0,0 +1,50 @@
+#include "cfg.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+void net2parents(char* netfile, char* parfile)
+{
+  int v;
+  varset_t varset;
+//score_t s;
+//FILE *fp=fopen("/home/grad/lram/RA stuff/try/src/kd.log","w+");
+
+
+  FILE* netf = strcmp(netfile,"-") ? fopen(netfile, "r") : stdin;
+  FILE* parf = strcmp(parfile,"-") ? fopen(parfile, "w") : stdout;
+//fprintf(fp, "great one was here");
+//fclose(fp);
+
+//fscanf(netf,"%f",&s);
+  for(v=0; 1 == fscanf(netf, "%u", &varset); ++v){
+    int p;
+//printf("Var %d", v);
+
+    for(p=0; varset; ++p, varset>>=1){
+      if(varset & 1) {
+	fprintf(parf, "%d", p);
+	if(varset>1)fprintf(parf, " ");
+      }
+    }
+//	printf("Var %d", v);
+    fprintf(parf,"\n");
+  }
+//printf("Here");
+  fclose(parf);
+  fclose(netf);
+}
+
+int main(int argc, char* argv[])
+{
+
+  if (argc!=3) {
+    fprintf(stderr, "Usage: net2parents netfile parentfile\n");
+    return 1;
+  }
+
+  net2parents(argv[1], argv[2]);
+
+  return 0;
+}
diff --git a/sourcecodes/k-best/src/parents2arcs.c b/sourcecodes/k-best/src/parents2arcs.c
new file mode 100644
index 00000000..81e8b3b1
--- /dev/null
+++ b/sourcecodes/k-best/src/parents2arcs.c
@@ -0,0 +1,37 @@
+#include "cfg.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#define BUFSIZE (1024)
+
+void parents2arcs(char* parfile, char* arcfile)
+{
+  char buffer[BUFSIZE];
+  int v;
+  FILE* parf = strcmp(parfile,"-") ? fopen(parfile, "r") : stdin;
+  FILE* arcf = strcmp(arcfile,"-") ? fopen(arcfile, "w") : stdout;
+  for(v=0; NULL != fgets(buffer, BUFSIZE, parf); ++v){
+    /* could check that the last character in buffer is newline */
+    char* token;
+    for(token=strtok(buffer, " \t\r\n"); token; token=strtok(NULL, " \t\r\n")){
+      fprintf(arcf, "%d %d\n", atoi(token), v);
+    }
+  }
+  fclose(arcf);
+  fclose(parf);
+}
+
+int main(int argc, char* argv[])
+{
+
+  if (argc!=3) {
+    fprintf(stderr, "Usage: parents2arcs parentfile arcfile\n");
+    return 1;
+  }
+
+  parents2arcs(argv[1], argv[2]);
+
+  return 0;
+}
diff --git a/sourcecodes/k-best/src/reg.c b/sourcecodes/k-best/src/reg.c
new file mode 100644
index 00000000..311bf59c
--- /dev/null
+++ b/sourcecodes/k-best/src/reg.c
@@ -0,0 +1,320 @@
+#include <math.h>
+#include "reg.h"
+
+#define pi 3.1415926535897932384626433832795
+
+
+static score_t r2_1000[] = {
+1.0, 2.0, 2.5, 2.88888888889, 3.21875, 3.5104, 3.77469135802,
+4.01813870071, 4.24501800537, 4.45831574489, 4.66021568,
+4.85237205074, 5.0360736751, 5.21234791295, 5.38202942438,
+5.54580728515, 5.70425824707, 5.8578708208, 6.00706309899,
+6.15219620096, 6.293584586, 6.43150408335, 6.56619822786,
+6.69788331895, 6.82675250392, 6.95297910625, 7.07671936269,
+7.19811469288, 7.31729359534, 7.43437324249, 7.54946083103,
+7.66265473218, 7.77404547667, 7.88371660286, 7.99174539033,
+8.09820349737, 8.2031575174, 8.30666946646, 8.408797212,
+8.50959485133, 8.60911304685, 8.70739932387, 8.80449833604,
+8.90045210255, 8.9953002208, 9.08908005739, 9.1818269202,
+9.27357421386, 9.36435358028, 9.45419502625, 9.54312703934,
+9.63117669346, 9.71836974515, 9.80473072166, 9.89028300153,
+9.97504888851, 10.0590496796, 10.1423057273, 10.2248364976,
+10.3066606229, 10.3877959509, 10.4682595908, 10.5480679547,
+10.627236797, 10.7057812508, 10.7837158615, 10.8610546184,
+10.937810984, 11.0139979213, 11.0896279195, 11.1647130175,
+11.239264827, 11.3132945527, 11.3868130127, 11.4598306561,
+11.5323575813, 11.6044035514, 11.6759780103, 11.7470900966,
+11.8177486575, 11.8879622617, 11.9577392113, 12.0270875534,
+12.0960150909, 12.1645293929, 12.2326378041, 12.3003474542,
+12.3676652666, 12.4345979668, 12.5011520898, 12.5673339879,
+12.6331498379, 12.6986056474, 12.7637072616, 12.8284603691,
+12.8928705079, 12.9569430709, 13.0206833111, 13.0840963465,
+13.1471871653, 13.2099606302, 13.2724214826, 13.3345743473,
+13.3964237358, 13.4579740508, 13.5192295895, 13.5801945472,
+13.6408730205, 13.7012690107, 13.7613864269, 13.8212290886,
+13.8808007292, 13.9401049979, 13.9991454631, 14.0579256142,
+14.1164488646, 14.1747185536, 14.2327379487, 14.2905102481,
+14.3480385822, 14.405326016, 14.4623755507, 14.5191901259,
+14.5757726211, 14.6321258572, 14.6882525988, 14.7441555552,
+14.799837382, 14.8553006829, 14.9105480108, 14.9655818692,
+15.0204047137, 15.0750189533, 15.1294269511, 15.1836310264,
+15.2376334551, 15.291436471, 15.3450422672, 15.3984529967,
+15.4516707737, 15.5046976745, 15.5575357382, 15.6101869683,
+15.6626533327, 15.7149367651, 15.7670391659, 15.8189624026,
+15.870708311, 15.9222786955, 15.9736753304, 16.0248999601,
+16.0759543002, 16.1268400377, 16.1775588321, 16.2281123159,
+16.2785020951, 16.3287297498, 16.3787968348, 16.4287048805,
+16.4784553929, 16.5280498543, 16.5774897242, 16.6267764392,
+16.6759114139, 16.7248960413, 16.7737316932, 16.8224197206,
+16.8709614543, 16.9193582051, 16.9676112644, 17.0157219046,
+17.0636913794, 17.1115209241, 17.1592117562, 17.2067650757,
+17.2541820653, 17.3014638909, 17.3486117017, 17.3956266311,
+17.4425097961, 17.4892622985, 17.5358852248, 17.5823796464,
+17.6287466201, 17.6749871882, 17.721102379, 17.7670932069,
+17.8129606726, 17.8587057635, 17.9043294539, 17.9498327054,
+17.9952164666, 18.0404816741, 18.0856292522, 18.130660113,
+18.1755751573, 18.2203752741, 18.2650613411, 18.309634225,
+18.3540947814, 18.3984438554, 18.4426822814, 18.4868108834,
+18.5308304754, 18.5747418613, 18.6185458352, 18.6622431813,
+18.7058346748, 18.749321081, 18.7927031564, 18.8359816483,
+18.8791572952, 18.9222308268, 18.9652029643, 19.0080744204,
+19.0508458994, 19.0935180976, 19.136091703, 19.1785673961,
+19.2209458492, 19.2632277271, 19.3054136872, 19.3475043792,
+19.3895004457, 19.431402522, 19.4732112364, 19.5149272102,
+19.5565510578, 19.598083387, 19.6395247987, 19.6808758874,
+19.7221372412, 19.7633094418, 19.8043930645, 19.8453886786,
+19.8862968473, 19.9271181279, 19.9678530715, 20.0085022239,
+20.0490661246, 20.0895453079, 20.1299403023, 20.1702516311,
+20.2104798118, 20.250625357, 20.2906887737, 20.3306705641,
+20.3705712249, 20.4103912481, 20.4501311206, 20.4897913245,
+20.5293723369, 20.5688746305, 20.608298673, 20.6476449276,
+20.6869138529, 20.7261059032, 20.7652215281, 20.804261173,
+20.843225279, 20.8821142829, 20.9209286172, 20.9596687105,
+20.9983349871, 21.0369278674, 21.0754477678, 21.1138951007,
+21.1522702748, 21.1905736947, 21.2288057616, 21.2669668728,
+21.3050574217, 21.3430777984, 21.3810283893, 21.4189095773,
+21.4567217417, 21.4944652585, 21.5321405003, 21.5697478361,
+21.6072876319, 21.6447602504, 21.6821660507, 21.7195053891,
+21.7567786187, 21.7939860892, 21.8311281476, 21.8682051376,
+21.9052174, 21.9421652726, 21.9790490904, 22.0158691853,
+22.0526258864, 22.0893195201, 22.1259504099, 22.1625188766,
+22.1990252382, 22.2354698102, 22.271852905, 22.3081748329,
+22.3444359014, 22.3806364152, 22.4167766768, 22.4528569861,
+22.4888776404, 22.5248389346, 22.5607411612, 22.5965846105,
+22.63236957, 22.6680963252, 22.7037651592, 22.7393763528,
+22.7749301845, 22.8104269307, 22.8458668654, 22.8812502606,
+22.9165773859, 22.9518485091, 22.9870638955, 23.0222238086,
+23.0573285098, 23.0923782582, 23.1273733112, 23.1623139241,
+23.1972003501, 23.2320328405, 23.2668116448, 23.3015370104,
+23.3362091828, 23.3708284059, 23.4053949214, 23.4399089693,
+23.4743707879, 23.5087806136, 23.5431386809, 23.5774452228,
+23.6117004703, 23.6459046528, 23.6800579981, 23.7141607321,
+23.7482130793, 23.7822152621, 23.8161675019, 23.8500700178,
+23.8839230279, 23.9177267482, 23.9514813936, 23.985187177,
+24.0188443102, 24.0524530031, 24.0860134643, 24.1195259009,
+24.1529905184, 24.1864075209, 24.2197771112, 24.2530994905,
+24.2863748586, 24.3196034138, 24.3527853533, 24.3859208726,
+24.4190101661, 24.4520534266, 24.4850508458, 24.5180026138,
+24.5509089198, 24.5837699513, 24.6165858946, 24.6493569349,
+24.682083256, 24.7147650405, 24.7474024696, 24.7799957236,
+24.8125449812, 24.8450504203, 24.8775122172, 24.9099305473,
+24.9423055847, 24.9746375025, 25.0069264724, 25.0391726652,
+25.0713762504, 25.1035373964, 25.1356562707, 25.1677330394,
+25.1997678678, 25.2317609198, 25.2637123586, 25.295622346,
+25.3274910431, 25.3593186096, 25.3911052044, 25.4228509853,
+25.4545561092, 25.4862207318, 25.517845008, 25.5494290916,
+25.5809731355, 25.6124772915, 25.6439417106, 25.6753665429,
+25.7067519372, 25.7380980417, 25.7694050037, 25.8006729694,
+25.8319020841, 25.8630924924, 25.8942443377, 25.9253577628,
+25.9564329095, 25.9874699187, 26.0184689304, 26.0494300839,
+26.0803535176, 26.111239369, 26.1420877748, 26.1728988708,
+26.2036727921, 26.234409673, 26.2651096468, 26.2957728462,
+26.326399403, 26.3569894483, 26.3875431124, 26.4180605247,
+26.448541814, 26.4789871082, 26.5093965346, 26.5397702197,
+26.5701082891, 26.6004108679, 26.6306780804, 26.66091005,
+26.6911068996, 26.7212687513, 26.7513957266, 26.781487946,
+26.8115455297, 26.841568597, 26.8715572664, 26.9015116561,
+26.9314318831, 26.9613180642, 26.9911703153, 27.0209887518,
+27.0507734882, 27.0805246386, 27.1102423164, 27.1399266342,
+27.1695777042, 27.1991956378, 27.2287805458, 27.2583325386,
+27.2878517257, 27.3173382162, 27.3467921183, 27.3762135401,
+27.4056025886, 27.4349593705, 27.4642839918, 27.4935765581,
+27.5228371742, 27.5520659444, 27.5812629725, 27.6104283616,
+27.6395622145, 27.6686646331, 27.697735719, 27.7267755733,
+27.7557842963, 27.7847619879, 27.8137087475, 27.842624674,
+27.8715098657, 27.9003644204, 27.9291884353, 27.9579820072,
+27.9867452325, 28.0154782067, 28.0441810252, 28.0728537828,
+28.1014965736, 28.1301094915, 28.1586926296, 28.1872460809,
+28.2157699376, 28.2442642915, 28.2727292341, 28.3011648561,
+28.329571248, 28.3579484998, 28.3862967009, 28.4146159405,
+28.442906307, 28.4711678886, 28.499400773, 28.5276050474,
+28.5557807987, 28.5839281132, 28.6120470769, 28.6401377751,
+28.6682002931, 28.6962347154, 28.7242411262, 28.7522196094,
+28.7801702483, 28.808093126, 28.8359883249, 28.8638559271,
+28.8916960146, 28.9195086685, 28.9472939699, 28.9750519992,
+29.0027828366, 29.0304865619, 29.0581632545, 29.0858129932,
+29.1134358568, 29.1410319234, 29.1686012709, 29.1961439767,
+29.2236601179, 29.2511497712, 29.2786130131, 29.3060499193,
+29.3334605657, 29.3608450274, 29.3882033793, 29.415535696,
+29.4428420516, 29.4701225201, 29.4973771748, 29.524606089,
+29.5518093353, 29.5789869864, 29.6061391142, 29.6332657906,
+29.6603670869, 29.6874430744, 29.7144938237, 29.7415194054,
+29.7685198894, 29.7954953457, 29.8224458438, 29.8493714526,
+29.8762722411, 29.9031482778, 29.9299996309, 29.9568263682,
+29.9836285574, 30.0104062657, 30.03715956, 30.0638885071,
+30.0905931733, 30.1172736246, 30.1439299267, 30.1705621452,
+30.1971703452, 30.2237545916, 30.2503149489, 30.2768514815,
+30.3033642532, 30.3298533279, 30.3563187689, 30.3827606395,
+30.4091790024, 30.4355739203, 30.4619454555, 30.48829367,
+30.5146186255, 30.5409203836, 30.5671990054, 30.593454552,
+30.619687084, 30.6458966617, 30.6720833454, 30.698247195,
+30.7243882701, 30.75050663, 30.7766023339, 30.8026754406,
+30.8287260087, 30.8547540966, 30.8807597623, 30.9067430638,
+30.9327040585, 30.958642804, 30.9845593572, 31.010453775,
+31.0363261141, 31.0621764309, 31.0880047814, 31.1138112216,
+31.1395958072, 31.1653585935, 31.1910996358, 31.216818989,
+31.242516708, 31.268192847, 31.2938474606, 31.3194806026,
+31.345092327, 31.3706826872, 31.3962517367, 31.4217995287,
+31.4473261161, 31.4728315515, 31.4983158875, 31.5237791764,
+31.5492214701, 31.5746428207, 31.6000432796, 31.6254228984,
+31.6507817282, 31.67611982, 31.7014372247, 31.7267339927,
+31.7520101746, 31.7772658204, 31.8025009802, 31.8277157038,
+31.8529100406, 31.87808404, 31.9032377513, 31.9283712234,
+31.9534845051, 31.9785776449, 32.0036506913, 32.0287036925,
+32.0537366963, 32.0787497507, 32.1037429033, 32.1287162015,
+32.1536696925, 32.1786034234, 32.2035174411, 32.2284117922,
+32.2532865233, 32.2781416806, 32.3029773103, 32.3277934584,
+32.3525901706, 32.3773674925, 32.4021254696, 32.426864147,
+32.4515835699, 32.4762837831, 32.5009648313, 32.5256267592,
+32.5502696109, 32.5748934309, 32.599498263, 32.6240841512,
+32.6486511391, 32.6731992702, 32.6977285879, 32.7222391355,
+32.7467309558, 32.7712040919, 32.7956585863, 32.8200944816,
+32.8445118202, 32.8689106443, 32.8932909959, 32.9176529169,
+32.9419964492, 32.9663216342, 32.9906285133, 33.0149171279,
+33.0391875191, 33.0634397278, 33.0876737947, 33.1118897607,
+33.1360876661, 33.1602675513, 33.1844294565, 33.2085734218,
+33.2326994871, 33.256807692, 33.2808980763, 33.3049706794,
+33.3290255406, 33.353062699, 33.3770821938, 33.4010840637,
+33.4250683475, 33.4490350839, 33.4729843113, 33.4969160679,
+33.520830392, 33.5447273217, 33.5686068947, 33.5924691489,
+33.616314122, 33.6401418513, 33.6639523743, 33.6877457282,
+33.71152195, 33.7352810768, 33.7590231452, 33.7827481922,
+33.8064562541, 33.8301473674, 33.8538215684, 33.8774788933,
+33.9011193781, 33.9247430588, 33.948349971, 33.9719401506,
+33.9955136329, 34.0190704534, 34.0426106474, 34.0661342501,
+34.0896412964, 34.1131318213, 34.1366058595, 34.1600634458,
+34.1835046147, 34.2069294006, 34.2303378377, 34.2537299604,
+34.2771058026, 34.3004653983, 34.3238087813, 34.3471359853,
+34.370447044, 34.3937419907, 34.4170208589, 34.4402836819,
+34.4635304926, 34.4867613243, 34.5099762097, 34.5331751816,
+34.5563582728, 34.5795255158, 34.6026769431, 34.625812587,
+34.6489324797, 34.6720366535, 34.6951251402, 34.7181979718,
+34.7412551801, 34.7642967968, 34.7873228536, 34.8103333817,
+34.8333284128, 34.8563079779, 34.8792721083, 34.9022208351,
+34.9251541892, 34.9480722013, 34.9709749024, 34.993862323,
+35.0167344937, 35.0395914449, 35.0624332071, 35.0852598103,
+35.1080712847, 35.1308676605, 35.1536489675, 35.1764152355,
+35.1991664944, 35.2219027737, 35.2446241031, 35.2673305119,
+35.2900220296, 35.3126986853, 35.3353605082, 35.3580075275,
+35.3806397721, 35.4032572708, 35.4258600525, 35.4484481458,
+35.4710215794, 35.4935803816, 35.5161245811, 35.538654206,
+35.5611692847, 35.5836698452, 35.6061559156, 35.6286275239,
+35.6510846979, 35.6735274653, 35.695955854, 35.7183698915,
+35.7407696053, 35.7631550228, 35.7855261715, 35.8078830784,
+35.8302257708, 35.8525542758, 35.8748686204, 35.8971688314,
+35.9194549357, 35.94172696, 35.963984931, 35.9862288753,
+36.0084588193, 36.0306747894, 36.0528768121, 36.0750649133,
+36.0972391195, 36.1193994565, 36.1415459505, 36.1636786272,
+36.1857975127, 36.2079026325, 36.2299940124, 36.252071678,
+36.2741356547, 36.296185968, 36.3182226433, 36.3402457058,
+36.3622551806, 36.3842510931, 36.4062334681, 36.4282023307,
+36.4501577057, 36.472099618, 36.4940280922, 36.5159431531,
+36.5378448252, 36.559733133, 36.581608101, 36.6034697535,
+36.6253181149, 36.6471532092, 36.6689750607, 36.6907836935,
+36.7125791315, 36.7343613986, 36.7561305187, 36.7778865156,
+36.7996294129, 36.8213592344, 36.8430760035, 36.8647797438,
+36.8864704787, 36.9081482315, 36.9298130256, 36.951464884,
+36.9731038301, 36.9947298868, 37.0163430771, 37.0379434241,
+37.0595309504, 37.0811056791, 37.1026676327, 37.124216834,
+37.1457533055, 37.1672770699, 37.1887881495, 37.2102865668,
+37.231772344, 37.2532455036, 37.2747060675, 37.2961540581,
+37.3175894974, 37.3390124074, 37.36042281, 37.3818207271,
+37.4032061805, 37.4245791921, 37.4459397834, 37.4672879761,
+37.4886237918, 37.5099472519, 37.531258378, 37.5525571913,
+37.5738437133, 37.5951179651, 37.616379968, 37.6376297431,
+37.6588673114, 37.680092694, 37.7013059119, 37.7225069858,
+37.7436959367, 37.7648727854, 37.7860375524, 37.8071902586,
+37.8283309244, 37.8494595705, 37.8705762172, 37.8916808851,
+37.9127735945, 37.9338543657, 37.9549232189, 37.9759801743,
+37.9970252521, 38.0180584723, 38.039079855, 38.0600894201,
+38.0810871876, 38.1020731772, 38.1230474088, 38.1440099022,
+38.1649606769, 38.1858997527, 38.2068271491, 38.2277428857,
+38.2486469818, 38.269539457, 38.2904203306, 38.3112896218,
+38.3321473499, 38.3529935342, 38.3738281938, 38.3946513477,
+38.4154630151, 38.4362632149, 38.457051966, 38.4778292874,
+38.4985951977, 38.519349716, 38.5400928608, 38.5608246508,
+38.5815451047, 38.602254241, 38.6229520783, 38.643638635,
+38.6643139297, 38.6849779805, 38.7056308059, 38.7262724241,
+38.7469028534, 38.767522112, 38.7881302179, 38.8087271892,
+38.829313044, 38.8498878003, 38.870451476, 38.8910040889,
+38.9115456569, 38.9320761978, 38.9525957293, 38.9731042692,
+38.993601835, 39.0140884444, 39.0345641149, 39.055028864,
+39.0754827091, 39.0959256678, 39.1163577573, 39.136778995,
+39.1571893981, 39.1775889839, 39.1979777695, 39.2183557721,
+39.2387230088, 39.2590794966, 39.2794252526, 39.2997602936,
+39.3200846366, 39.3403982984, 39.3607012959, 39.3809936458,
+39.401275365, 39.4215464701, 39.4418069776, 39.4620569043,
+39.4822962667, 39.5025250812, 39.5227433645, 39.5429511329,
+39.5631484027, 39.5833351904, 39.6035115122, 39.6236773845,
+39.6438328234, 39.6639778451, 39.6841124657, 39.7042367014,
+39.7243505682, 39.744454082, 39.7645472589, 39.7846301149,
+39.8047026656, 39.8247649272, 39.8448169153, 39.8648586456,
+39.884890134, 39.9049113962, 39.9249224477, 39.9449233041,
+39.9649139811, 39.9848944942, 40.0048648588, 40.0248250904,
+40.0447752044, 40.0647152162, 40.0846451411, 40.1045649944,
+40.1244747914, 40.1443745472, 40.164264277, 40.1841439961,
+40.2040137194, 40.2238734621, 40.2437232392, 40.2635630656,
+40.2833929563, 40.3032129263
+};
+
+static score_t reg2(int N){
+  if (N<=1000)
+    return r2_1000[N];
+  else
+    return exp(0.5*log(N*pi/2)
+	       + sqrt(8/(9*N*pi))
+	       + (1.0/12 - 4/(9*pi))/N);
+}
+
+score_t reg(int N, int K){
+
+  if (K == 1)
+    return 1.0 ;
+  else if (K == 2)
+    return reg2(N);
+  else {
+    int k = 0;
+    score_t rk_2 = reg(N,1);
+    score_t rk_1 = reg(N,2);
+    score_t rk   = 0;
+    for (k=3; k<=K;++k){
+      rk = rk_1 + rk_2 /(k-2)*N;
+      rk_2 = rk_1;
+      rk_1 = rk;
+    }
+    return rk;
+  }
+}
+
+#ifdef MAIN
+#include <stdio.h>
+#include <stdlib.h>
+
+  int main(int argc, char* argv[]){
+    int N, K;
+
+    if (argc != 3) {
+      fprintf(stderr, "Usage: reg N K\n");
+      exit(2);
+    }
+
+    N = atoi(argv[1]);
+    K = atoi(argv[2]);
+
+    if (K<=0){
+      fprintf(stderr, "K has to be a positive integer.\n");
+      exit(2);
+    }
+     
+    if (N<0){
+      fprintf(stderr, "N has to be a non-negative integer.\n");
+      exit(2);
+    }
+
+
+    printf("%f\n", reg(N,K));
+
+    return 0;
+  }
+	
+#endif
diff --git a/sourcecodes/k-best/src/reg.h b/sourcecodes/k-best/src/reg.h
new file mode 100644
index 00000000..2422f2e5
--- /dev/null
+++ b/sourcecodes/k-best/src/reg.h
@@ -0,0 +1,7 @@
+#ifndef __REG_H__
+#define __REG_H__
+#include "cfg.h"
+
+extern score_t reg(int N, int K);
+
+#endif
diff --git a/sourcecodes/k-best/src/score_net.c b/sourcecodes/k-best/src/score_net.c
new file mode 100644
index 00000000..fccec93f
--- /dev/null
+++ b/sourcecodes/k-best/src/score_net.c
@@ -0,0 +1,39 @@
+#include "cfg.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "files.h"
+#include "varpar.h"
+
+score_t score_net(char* netfile, char* dirprefix){
+  score_t score = 0.0;
+
+  int v;
+  varset_t varset;
+  FILE* netf = strcmp(netfile,"-") ? fopen(netfile, "rt") : stdin;
+  for(v=0; 1 == fscanf(netf, "%u", &varset); ++v){
+    score_t vscore;
+    FILE* fin = open_file(dirprefix, v, "", "rb");
+    fseek(fin, varset2parset(v, varset)*sizeof(score_t), SEEK_SET);
+    fread(&vscore, sizeof(score_t), 1, fin);
+    fclose(fin);
+    score += vscore;
+  }
+  fclose(netf);
+  return score;
+}
+
+int main(int argc, char* argv[])
+{
+
+  if (argc!=3) {
+    fprintf(stderr, "Usage: score_net netfile dirname\n");
+    return 1;
+  }
+
+  printf("%.3f\n", score_net(argv[1], argv[2]));
+
+  return 0;
+}
diff --git a/sourcecodes/k-best/src/score_nets.c b/sourcecodes/k-best/src/score_nets.c
new file mode 100644
index 00000000..44ab3a27
--- /dev/null
+++ b/sourcecodes/k-best/src/score_nets.c
@@ -0,0 +1,54 @@
+#include "cfg.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "files.h"
+#include "varpar.h"
+
+score_t score_net(char* netfile, char* dirprefix, int nof_vars, FILE** fins){
+  score_t score = 0.0;
+
+  int v;
+  varset_t varset;
+  FILE* netf = strcmp(netfile,"-") ? fopen(netfile, "r") : stdin;
+  for(v=0; 1 == fscanf(netf, "%u", &varset); ++v){
+    score_t vscore;
+    fseek(fins[v], varset2parset(v, varset)*sizeof(score_t), SEEK_SET);
+    fread(&vscore, sizeof(score_t), 1, fins[v]);
+    rewind(fins[v]);
+    score += vscore;
+  }
+  fclose(netf);
+  return score;
+}
+
+void score_nets(char* netfiles, char* dirprefix){
+  char netfile[1024];
+  FILE* netfs = strcmp(netfiles,"-") ? fopen(netfiles, "r") : stdin;
+  int nof_vars = 0;
+  FILE** fins = NULL; 
+  while(EOF != fscanf(netfs, "%s", netfile)){
+    if (0 == nof_vars){
+      nof_vars = nof_lines(netfile);
+      fins = open_files(nof_vars, dirprefix,"","r");
+    }
+    printf("%.3f\n", score_net(netfile, dirprefix, nof_vars, fins));
+  }
+  free_files(nof_vars,fins);
+  fclose(netfs);
+}
+
+int main(int argc, char* argv[])
+{
+
+  if (argc!=3) {
+    fprintf(stderr, "Usage: score_nets netfiles dirname\n");
+    return 1;
+  }
+
+  score_nets(argv[1], argv[2]);
+
+  return 0;
+}
diff --git a/sourcecodes/k-best/src/varpar.c b/sourcecodes/k-best/src/varpar.c
new file mode 100644
index 00000000..584799c6
--- /dev/null
+++ b/sourcecodes/k-best/src/varpar.c
@@ -0,0 +1,19 @@
+#include "varpar.h"
+
+varset_t parset2varset(int v, varset_t set){
+  varset_t sinkleton = 1U<<v;
+  varset_t mask      = sinkleton - 1;
+  varset_t low       = set &  mask;
+  varset_t high      = set & ~mask;
+  return (high<<1) | low;
+}
+
+varset_t varset2parset(int v, varset_t set){
+  /* assumes v not set */
+  varset_t sinkleton = 1U<<v;
+  varset_t mask      = sinkleton - 1;
+  varset_t low       = set &  mask;
+  varset_t high      = set & ~mask;
+  return (high>>1) | low;
+}
+
diff --git a/sourcecodes/k-best/src/varpar.h b/sourcecodes/k-best/src/varpar.h
new file mode 100644
index 00000000..3f28b64b
--- /dev/null
+++ b/sourcecodes/k-best/src/varpar.h
@@ -0,0 +1,9 @@
+#ifndef __VARPAR_H__
+#define __VARPAR_H__
+
+#include "cfg.h"
+
+varset_t parset2varset(int v, varset_t set);
+varset_t varset2parset(int v, varset_t set);
+
+#endif
diff --git a/sourcecodes/k-best/src/varpar.o b/sourcecodes/k-best/src/varpar.o
new file mode 100644
index 00000000..4fa1b165
--- /dev/null
+++ b/sourcecodes/k-best/src/varpar.o
Binary files differdiff --git a/sourcecodes/k-best/src/xtab.h b/sourcecodes/k-best/src/xtab.h
new file mode 100644
index 00000000..51d424c1
--- /dev/null
+++ b/sourcecodes/k-best/src/xtab.h
@@ -0,0 +1,80 @@
+#ifndef _XTAB_H_
+#define _XTAB_H_
+
+#include <string.h>
+
+typedef struct xentry xentry;
+typedef unsigned char uchar;
+typedef unsigned int uint;
+
+
+//Each xentry is one node in the linked list
+struct xentry {
+  uchar* key;  //Key value as a string
+  int*  val;   //value as int array
+  xentry* next; //pointer to the next xentry i.e. the next node in this linked list
+  uint h;       /* h denotes hash key i.e to which row in the hash table it belongs to*/
+};
+
+typedef struct xtab xtab;
+
+struct xtab {
+  int range;        /* range of hash keys, for example 1024 */ //i.e. number of rows in hash table
+  xentry** ix;      /* hashkey to xentry pointer mapping    */ //pointer pointing to start of each row in the hash table
+  xentry* free;     /* pointer to unused xentries           */
+  xentry* xentries; //Each entry in hash table
+};
+
+//Number of entries in the hash table are counted by (free-xentries)
+#define xcount(t) ((t)->free - (t)->xentries)
+
+/*Reset memory to 0's from ix to the end of last xentry*/
+
+# define xreset(t) \
+{\
+  memset((t)->ix, 0, (t)->range * sizeof(xentry*));\
+  memset((t)->xentries, 0, xcount(t) * sizeof(xentry));\
+  (t)->free = (t)->xentries;\
+}
+
+xentry* xadd(xtab* t, uint h, uchar* key, int klen, int* new) {
+
+  /* starting from ix[h], go through x:s and try to find key */
+
+  //Search in the linked list for that particular hash value and see if such a linked list has the particular key already
+  xentry* x = t->ix[h];
+  xentry** p = t->ix + h; /* prev-pointer to chain the possibly new xentry */
+  
+  //Compares the entry to be added with old entries. If the same key value does not already exist in the linked list, then just go to the next xentry and compare
+  //memcmp returns 0 if the strings are identical
+  for(; x && memcmp(x->key, key, klen); x = x->next)
+    p = &(x->next);
+
+  //If the key value is not already present in the linked list for that hash value
+  *new = !x;
+
+  if(*new){
+    x = (t->free)++;  //Free memory starts one block later because new element is inserted
+    x->h = h;  //Set hash value
+    *p = x; /* link the new x */
+  }
+
+  return x;
+}
+
+xtab* xcreate(int range, int nof_xentries){
+  xtab* t     = calloc(1,sizeof(xtab));
+  t->range    = range;
+  t->ix       = calloc(range, sizeof(xentry*));
+  t->xentries = calloc(nof_xentries, sizeof(xentry));
+  t->free     = t->xentries;
+  return t;
+}
+ 
+void  xdestroy(xtab* t) {
+  free(t->ix);
+  free(t->xentries);
+  free(t);
+}
+
+#endif
diff --git a/sourcecodes/k_only_table.txt b/sourcecodes/k_only_table.txt
new file mode 100644
index 00000000..92bd80b5
--- /dev/null
+++ b/sourcecodes/k_only_table.txt
@@ -0,0 +1,19 @@
+0	0	0	0	0	0
+0	0	0	0	0	0
+0	0	0	0	0	0
+0	0	0	0	0	0
+0	0	0	0	0	1
+0	0	0	0	1	3
+0	0	0	1	3	8
+0	0	0	1	7	21
+0	0	1	1	17	58
+0	1	2	4	40	142
+0	1	5	12	98	355
+1	1	12	30	243	822
+2	5	30	80	596	1901
+0	7	74	206	1525	4509
+2	17	180	518	4024	5275
+3	38	426	1284	10060	14840
+6	85	1004	2353	25150	44525
+12	194	2318	4539	62875	104838
+28	431	5457	9009	157188	218857
diff --git a/sourcecodes/layout.php b/sourcecodes/layout.php
new file mode 100644
index 00000000..85d089b5
--- /dev/null
+++ b/sourcecodes/layout.php
@@ -0,0 +1,121 @@
+<?php
+
+include("header_new.inc");
+
+$keyval=$_GET["My_key"];
+
+
+
+
+
+
+$dir="./data/";
+
+$vf1=$dir.$keyval."var.txt";
+$vf2=$dir.$keyval."varname.txt";
+$vf3=$dir.$keyval."vardata.txt";
+unlink($vf1);
+unlink($vf2);
+unlink($vf3);
+
+
+$radiovalue="Evidence";
+$valcompare="Evidence";
+
+
+  if(isset($_POST["Datatype"])) 
+ {
+
+ $radiovalue=$_POST["Datatype"];
+ if($radiovalue=="Evidence") $S1="checked=\"checked\"";
+ if($radiovalue=="Intervention") $S2="checked=\"checked\"";
+ }
+ else
+ {
+   $radiovalue="Evidence";
+   $S1="checked=\"checked\"";
+ }
+
+
+
+?>
+<script language="JavaScript">
+<!--
+function calcHeight()
+{
+  //find the height of the internal page
+  var the_height=
+    document.getElementById('the_iframe').contentWindow.
+      document.body.scrollHeight;
+
+  //change the height of the iframe
+  document.getElementById('the_iframe').height=
+      the_height;
+}
+//-->
+</script>
+<form  method="post" name="form"> 
+<table width="100%" align="center" style="background-color:" bordercolor=white border=0.5 cellspacing="0" cellpadding="0">
+ <tr valign=top>
+      <td colspan=4><hr size=3></td>
+  </tr>
+<tr >
+<th align=right> <h3>Prediction Mode:&nbsp</h3></th>
+  <td align=left>
+      <input name="Datatype" type="radio" value=<?php $radioval="Evidence"; echo $radioval; ?> checked <?php echo $S1; ?>" onClick="javascript:this.form.submit();">Evidence&nbsp;&nbsp;&nbsp;
+      <input name="Datatype" type="radio" value=<?php $radioval="Intervention"; echo $radioval; ?> <?php echo $S2; ?>" onClick="javascript:this.form.submit();"> Intervention
+      
+  </td>
+</tr>
+  <tr valign=top>
+      <td colspan=4><hr size=3></td>
+  </tr>
+
+</table>
+</form>
+
+<!-- Site navigation menu -->
+<ul class="navbar2">
+   <li><p>Selected mode:<br><?php print($radiovalue);?></p></li>
+</ul>
+
+<ul class="navbar">
+ <li><a href="clear.php?My_key=<?php print($keyval);?>" target='_blank'>Clear evidence</a>
+  <li><a href="javascript:void(0);"
+NAME="Model Averaging Matrix" title="Model Averaging Matrix"
+onClick=window.open("matrix.php?My_key=<?php print($keyval);?>","Ratting","width=950,height=270,0,status=0,");>Display structure matrix</a>  
+ <li><a href="help.php" target='_blank'>Help</a> 
+ <li><a href="../home.php">Home</a>
+</ul>
+
+<?php
+    //echo "Selected mode:";
+    //echo $radiovalue;
+
+
+
+if($radiovalue==$valcompare)
+{
+?>
+<div  id="outernew">
+
+<object type="text/html" data="network_layout_evd.php?My_key=<?php print($keyval);?>" style="width:3000; height:3000">
+<p>Error: Try again</p>
+</object>
+
+</div>
+<?php
+}
+else
+{
+?>
+<div  id="outernew">
+<object type="text/html" data="network_layout_inv.php?My_key=<?php print($keyval);?>" style="width:3000; height:3000">
+<p>Error: Try again</p>
+</object>
+
+</div>
+<?php
+}
+?>
+
diff --git a/sourcecodes/layout_example.php b/sourcecodes/layout_example.php
new file mode 100644
index 00000000..b5f53a6b
--- /dev/null
+++ b/sourcecodes/layout_example.php
@@ -0,0 +1,121 @@
+<?php
+
+include("header_new.inc");
+
+$keyval=$_GET["My_key"];
+
+
+
+
+
+
+$dir="./data/";
+
+$vf1=$dir.$keyval."var.txt";
+$vf2=$dir.$keyval."varname.txt";
+$vf3=$dir.$keyval."vardata.txt";
+unlink($vf1);
+unlink($vf2);
+unlink($vf3);
+
+
+$radiovalue="Evidence";
+$valcompare="Evidence";
+
+
+  if(isset($_POST["Datatype"])) 
+ {
+
+ $radiovalue=$_POST["Datatype"];
+ if($radiovalue=="Evidence") $S1="checked=\"checked\"";
+ if($radiovalue=="Intervention") $S2="checked=\"checked\"";
+ }
+ else
+ {
+   $radiovalue="Evidence";
+   $S1="checked=\"checked\"";
+ }
+
+
+
+?>
+<script language="JavaScript">
+<!--
+function calcHeight()
+{
+  //find the height of the internal page
+  var the_height=
+    document.getElementById('the_iframe').contentWindow.
+      document.body.scrollHeight;
+
+  //change the height of the iframe
+  document.getElementById('the_iframe').height=
+      the_height;
+}
+//-->
+</script>
+<form  method="post" name="form"> 
+<table width="100%" align="center" style="background-color:" bordercolor=white border=0.5 cellspacing="0" cellpadding="0">
+ <tr valign=top>
+      <td colspan=4><hr size=3></td>
+  </tr>
+<tr >
+<th align=right> <h3>Prediction Mode:&nbsp</h3></th>
+  <td align=left>
+      <input name="Datatype" type="radio" value=<?php $radioval="Evidence"; echo $radioval; ?> checked <?php echo $S1; ?>" onClick="javascript:this.form.submit();">Evidence&nbsp;&nbsp;&nbsp;
+      <input name="Datatype" type="radio" value=<?php $radioval="Intervention"; echo $radioval; ?> <?php echo $S2; ?>" onClick="javascript:this.form.submit();"> Intervention
+      
+  </td>
+</tr>
+  <tr valign=top>
+      <td colspan=4><hr size=3></td>
+  </tr>
+
+</table>
+</form>
+
+<!-- Site navigation menu -->
+<ul class="navbar2">
+   <li><p>Selected mode:<br><?php print($radiovalue);?></p></li>
+</ul>
+
+<ul class="navbar">
+ <li><a href="clear_example.php?My_key=<?php print($keyval);?>" target='_blank'>Clear evidence</a>
+  <li><a href="javascript:void(0);"
+NAME="Model Averaging Matrix" title="Model Averaging Matrix"
+onClick=window.open("matrix.php?My_key=<?php print($keyval);?>","Ratting","width=950,height=270,0,status=0,");>Display structure matrix</a>  
+ <li><a href="help.php" target='_blank'>Help</a> 
+ <li><a href="home.php">Home</a>
+</ul>
+
+<?php
+    //echo "Selected mode:";
+    //echo $radiovalue;
+
+
+
+if($radiovalue==$valcompare)
+{
+?>
+<div  id="outernew">
+
+<object type="text/html" data="network_layout_evd_example.php?My_key=<?php print($keyval);?>" style="width:3000; height:3000">
+<p>Error: Try again</p>
+</object>
+
+</div>
+<?php
+}
+else
+{
+?>
+<div  id="outernew">
+<object type="text/html" data="network_layout_inv_example.php?My_key=<?php print($keyval);?>" style="width:3000; height:3000">
+<p>Error: Try again</p>
+</object>
+
+</div>
+<?php
+}
+?>
+
diff --git a/sourcecodes/localscore/Applic.h b/sourcecodes/localscore/Applic.h
new file mode 100644
index 00000000..0ae5e981
--- /dev/null
+++ b/sourcecodes/localscore/Applic.h
@@ -0,0 +1,291 @@
+/*
+ *  R : A Computer Language for Statistical Data Analysis
+ *  Copyright (C) 1998-2012   Robert Gentleman, Ross Ihaka
+ *                             and the R Core Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation; either version 2.1 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this program; if not, a copy is available at
+ *  http://www.r-project.org/Licenses/
+ *
+ *
+ * Application Routines, typically implemented in  ../appl/
+ * ----------------------------------------------  ========
+ */
+
+/* This header file contains routines which are in the R API and ones which
+   are not.
+
+   Those which are not can be used only at the user's risk and may change
+   or disappear in a future release of R.
+*/
+
+
+#ifndef R_APPLIC_H_
+#define R_APPLIC_H_
+
+#include <R_ext/Boolean.h>
+#include <R_ext/RS.h>		/* F77_... */
+#include <R_ext/BLAS.h>
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+/* Entry points in the R API */
+
+/* appl/integrate.c */
+typedef void integr_fn(double *x, int n, void *ex);
+/* vectorizing function   f(x[1:n], ...) -> x[]  {overwriting x[]}. */
+
+void Rdqags(integr_fn f, void *ex, double *a, double *b,
+	    double *epsabs, double *epsrel,
+	    double *result, double *abserr, int *neval, int *ier,
+	    int *limit, int *lenw, int *last, int *iwork, double *work);
+
+void Rdqagi(integr_fn f, void *ex, double *bound, int *inf,
+	    double *epsabs, double *epsrel,
+	    double *result, double *abserr, int *neval, int *ier,
+	    int *limit, int *lenw, int *last,
+	    int *iwork, double *work);
+
+/* main/optim.c */
+typedef double optimfn(int, double *, void *);
+typedef void optimgr(int, double *, double *, void *);
+
+void vmmin(int n, double *b, double *Fmin,
+	   optimfn fn, optimgr gr, int maxit, int trace,
+	   int *mask, double abstol, double reltol, int nREPORT,
+	   void *ex, int *fncount, int *grcount, int *fail);
+void nmmin(int n, double *Bvec, double *X, double *Fmin, optimfn fn,
+	   int *fail, double abstol, double intol, void *ex,
+	   double alpha, double bet, double gamm, int trace,
+	   int *fncount, int maxit);
+void cgmin(int n, double *Bvec, double *X, double *Fmin,
+	   optimfn fn, optimgr gr,
+	   int *fail, double abstol, double intol, void *ex,
+	   int type, int trace, int *fncount, int *grcount, int maxit);
+void lbfgsb(int n, int m, double *x, double *l, double *u, int *nbd,
+	    double *Fmin, optimfn fn, optimgr gr, int *fail, void *ex,
+	    double factr, double pgtol, int *fncount, int *grcount,
+	    int maxit, char *msg, int trace, int nREPORT);
+void samin(int n, double *pb, double *yb, optimfn fn, int maxit,
+	   int tmax, double ti, int trace, void *ex);
+
+
+
+/* Entry points NOT in the R API */
+
+/* appl/bakslv.c : hidden */
+void bakslv(double *, int *, int *,
+	    double *, int *, int *,
+	    double *, int *, int *);
+
+/* appl/binning.c : hidden */
+void bincode (double *x, int *n, double *breaks, int *nb,
+	      int *code, int *right, int *include_border, int *naok);
+void bincount(double *x, int *n, double *breaks, int *nb, int *count,
+	      int *right, int *include_border, int *naok);
+
+/* appl/ch2inv.f */
+void F77_NAME(ch2inv)(double *x, int *ldx, int *n, double *v, int *info);
+
+/* appl/chol.f Used in nlme */
+void F77_NAME(chol)(double *a, int *lda, int *n, double *v, int *info);
+
+/* appl/cpoly.c : hidden */
+void R_cpolyroot(double *opr, double *opi, int *degree,
+		 double *zeror, double *zeroi, Rboolean *fail);
+/* More `Complex Polynomial Utilities' could be exported:
+
+   polyev(...)
+   errev(...)
+   cpoly_cauchy(...)
+   cpoly_scale(...)
+   cdivid(...)
+*/
+
+
+/* appl/cumsum.c : non-API, used in package DCluster */
+void R_cumsum(double *, int *, double *, double *);
+
+/* appl/eigen.f */
+int F77_NAME(cg)(int *nm, int *n, double *ar, double *ai,
+		 double *wr, double *wi, int *matz, double *zr, double *zi,
+		 double *fv1, double *fv2, double *fv3, int *ierr);
+int F77_NAME(ch)(int *nm, int *n, double *ar, double *ai,
+		 double *w, int *matz, double *zr, double *zi,
+		 double *fv1, double *fv2, double *fm1, int *ierr);
+int F77_NAME(rg)(int *nm, int *n, double *a, double *wr, double *wi,
+		 int *matz, double *z, int *iv1, double *fv1, int *ierr);
+/* used in nlme */
+int F77_NAME(rs)(int *nm, int *n, double *a, double *w,
+		 int *matz, double *z, double *fv1, double *fv2, int *ierr);
+
+/* appl/fft.c */
+/* NOTE:  The following functions use GLOBAL (static) variables !!
+ * ----   some of R-core think that this should be changed,
+ *        which will INEVITABLY extend the argument lists ...!
+ */
+/* non-API, but used by package RandomFields */
+void fft_factor(int n, int *pmaxf, int *pmaxp);
+Rboolean fft_work(double *a, double *b, int nseg, int n, int nspn,
+/* TRUE: success */ int isn, double *work, int *iwork);
+
+/* appl/fmin.c : */
+double Brent_fmin(double ax, double bx, double (*f)(double, void *),
+		  void *info, double tol);
+
+/* appl/interv.c: also in Utils.h */
+/* used in packages gam and mda */
+int F77_SUB(interv)(double *xt, int *n, double *x,
+		    Rboolean *rightmost_closed, Rboolean *all_inside,
+		    int *ilo, int *mflag);
+/* Non-API No longer used */
+void find_interv_vec(double *xt, int *n, double *x, int *nx,
+		     int *rightmost_closed, int *all_inside, int *indx);
+/* API, used in package eco */
+int findInterval(double *xt, int n, double x,
+		 Rboolean rightmost_closed,  Rboolean all_inside, int ilo,
+		 int *mflag);
+
+/* appl/lbfgsb.c */
+void setulb(int n, int m, double *x, double *l, double *u, int *nbd,
+	    double *f, double *g, double factr, double *pgtol,
+	    double *wa, int * iwa, char *task, int iprint,
+	    int *lsave, int *isave, double *dsave);
+
+/* appl/machar.c */
+void machar(int *ibeta, int *it, int *irnd, int *ngrd, int *machep,
+	    int *negep, int *iexp, int *minexp, int *maxexp,
+	    double *eps, double *epsneg, double *xmin, double *xmax);
+
+/* appl/maxcol.c: also in Utils.h  Used in package MNP */
+void R_max_col(double *matrix, int *nr, int *nc, int *maxes, int *ties_meth);
+
+
+/* appl/pretty.c */
+double R_pretty0(double *lo, double *up, int *ndiv, int min_n,
+		 double shrink_sml, double high_u_fact[],
+		 int eps_correction, int return_bounds);
+void R_pretty(double *lo, double *up, int *ndiv, int *min_n,
+	      double *shrink_sml, double *high_u_fact,
+	      int *eps_correction);
+
+/* appl/rcont.c: API prior to R 2.15.2 */
+void rcont2(int *nrow, int *ncol, int *nrowt, int *ncolt, int *ntotal,
+	    double *fact, int *jwork, int *matrix);
+
+/* appl/rowsum.c */
+void R_rowsum(int *dim, double *na_x, double *x, double *group);
+
+/* appl/stem.c */
+Rboolean stemleaf(double *x, int *n, double *scale, int *width, double *atom);
+
+/* appl/strsignif.c */
+void str_signif(char *x, int *n, const char **type, int *width, int *digits,
+		const char **format, const char **flag, char **result);
+
+/* appl/tabulate.c : non-API, used in package ape, phangorn, pcaPA */
+void R_tabulate(int *x, int *n, int *nbin, int *ans);
+
+/* appl/uncmin.c : */
+
+/* type of pointer to the target and gradient functions */
+typedef void (*fcn_p)(int, double *, double *, void *);
+
+/* type of pointer to the hessian functions */
+typedef void (*d2fcn_p)(int, int, double *, double *, void *);
+
+void fdhess(int n, double *x, double fval, fcn_p fun, void *state,
+	    double *h, int nfd, double *step, double *f, int ndigit,
+	    double *typx);
+
+/* used in nlme */
+void optif9(int nr, int n, double *x,
+	    fcn_p fcn, fcn_p d1fcn, d2fcn_p d2fcn,
+	    void *state, double *typsiz, double fscale, int method,
+	    int iexp, int *msg, int ndigit, int itnlim, int iagflg,
+	    int iahflg, double dlt, double gradtl, double stepmx,
+	    double steptl, double *xpls, double *fpls, double *gpls,
+	    int *itrmcd, double *a, double *wrk, int *itncnt);
+
+void optif0(int nr, int n, double *x, fcn_p fcn, void *state,
+	    double *xpls, double *fpls, double *gpls, int *itrmcd,
+	    double *a, double *wrk);
+
+/* appl/zeroin.c : non API, but used in package qtl */
+double R_zeroin(double ax, double bx, double (*f)(double, void *), void *info,
+		double *Tol, int *Maxit);
+/* R_zeroin2() is faster for "expensive" f(), in those typical cases where
+ *             f(ax) and f(bx) are available anyway : */
+double R_zeroin2(double ax, double bx, double fa, double fb,
+		 double (*f)(double, void *), void *info, double *Tol, int *Maxit);
+
+
+/* ALL appl/<foobar>.f	[semi-automatically by
+ *				 f2c -A -P *.f; cat *.P > all.h	 and editing]
+ */
+
+/* This is not in the applications but in the BLAS, and defined in Lapack.h
+extern int F77_NAME(lsame)(const char *, const char *);
+*/
+
+/* LINPACK routines also declared in Linpack.h
+void F77_NAME(dpoco)(double *a, int *lda, int *n, double *rcond,
+		     double *z__, int *info);
+void F77_NAME(dpodi)(double *a, int *lda, int *n, double *det, int *job);
+void F77_NAME(dpofa)(double *a, int *lda, int *n, int *info);
+void F77_NAME(dposl)(double *a, int *lda, int *n, double *b);
+void F77_NAME(dqrdc)(double *x, int *ldx, int *n, int *p,
+		     double *qraux, int *jpvt, double *work, int *job);
+void F77_NAME(dqrsl)(double *x, int *ldx, int *n, int *k,
+		     double *qraux, double *y,
+		     double *qy, double *qty, double *b,
+		     double *rsd, double *xb, int *job, int *info);
+void F77_NAME(dsvdc)(double *x, int *ldx, int *n, int *p,
+		     double *s, double *e,
+		     double *u, int *ldu, double *v, int *ldv,
+		     double *work, int *job, int *info);
+void F77_NAME(dtrco)(double *t, int *ldt, int *n, double *rcond,
+		     double *z__, int *job);
+void F77_NAME(dtrsl)(double *t, int *ldt, int *n, double *b, int *job,
+		     int *info);
+*/
+
+/* find qr decomposition, dqrdc2() is basis of R's qr(), also used by nlme */
+void F77_NAME(dqrdc2)(double *x, int *ldx, int *n, int *p,
+		      double *tol, int *rank,
+		      double *qraux, int *pivot, double *work);
+void F77_NAME(dqrls)(double *x, int *n, int *p, double *y, int *ny,
+		     double *tol, double *b, double *rsd,
+		     double *qty, int *k,
+		     int *jpvt, double *qraux, double *work);
+
+/* appl/dqrutl.f: interfaces to dqrsl */
+void F77_NAME(dqrqty)(double *x, int *n, int *k, double *qraux,
+		      double *y, int *ny, double *qty);
+void F77_NAME(dqrqy)(double *x, int *n, int *k, double *qraux,
+		     double *y, int *ny, double *qy);
+void F77_NAME(dqrcf)(double *x, int *n, int *k, double *qraux,
+		     double *y, int *ny, double *b, int *info);
+void F77_NAME(dqrrsd)(double *x, int *n, int *k, double *qraux,
+		     double *y, int *ny, double *rsd);
+void F77_NAME(dqrxb)(double *x, int *n, int *k, double *qraux,
+		     double *y, int *ny, double *xb);
+
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif /* R_APPLIC_H_ */
diff --git a/sourcecodes/localscore/Arith.h b/sourcecodes/localscore/Arith.h
new file mode 100644
index 00000000..4a0030f1
--- /dev/null
+++ b/sourcecodes/localscore/Arith.h
@@ -0,0 +1,87 @@
+/*
+ *  R : A Computer Language for Statistical Data Analysis
+ *  Copyright (C) 1995, 1996  Robert Gentleman and Ross Ihaka
+ *  Copyright (C) 1998--2007  The R Core Team.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation; either version 2.1 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this program; if not, a copy is available at
+ *  http://www.r-project.org/Licenses/
+ */
+
+/* Included by R.h: API */
+
+#ifndef R_ARITH_H_
+#define R_ARITH_H_
+
+/* Only for use where config.h has not already been included */
+#if defined(HAVE_GLIBC2) && !defined(_BSD_SOURCE)
+/* ensure that finite and isnan are declared */
+# define _BSD_SOURCE 1
+#endif
+
+#include "libextern.h"
+#ifdef  __cplusplus
+extern "C" {
+#elif !defined(NO_C_HEADERS)
+/* needed for isnan and isfinite, neither of which are used under C++ */
+# include <math.h>
+#endif
+
+/* implementation of these : ../../main/arithmetic.c */
+LibExtern double R_NaN;		/* IEEE NaN */
+LibExtern double R_PosInf;	/* IEEE Inf */
+LibExtern double R_NegInf;	/* IEEE -Inf */
+LibExtern double R_NaReal;	/* NA_REAL: IEEE */
+LibExtern int	 R_NaInt;	/* NA_INTEGER:= INT_MIN currently */
+#ifdef __MAIN__
+#undef extern
+#undef LibExtern
+#endif
+
+#define NA_LOGICAL	R_NaInt
+#define NA_INTEGER	R_NaInt
+/* #define NA_FACTOR	R_NaInt  unused */
+#define NA_REAL		R_NaReal
+/* NA_STRING is a SEXP, so defined in Rinternals.h */
+
+int R_IsNA(double);		/* True for R's NA only */
+int R_IsNaN(double);		/* True for special NaN, *not* for NA */
+int R_finite(double);		/* True if none of NA, NaN, +/-Inf */
+#define ISNA(x)	       R_IsNA(x)
+
+/* ISNAN(): True for *both* NA and NaN.
+   NOTE: some systems do not return 1 for TRUE.
+   Also note that C++ math headers specifically undefine
+   isnan if it is a macro (it is on OS X and in C99),
+   hence the workaround.  This code also appears in Rmath.h
+*/
+#ifdef __cplusplus
+  int R_isnancpp(double); /* in arithmetic.c */
+#  define ISNAN(x)     R_isnancpp(x)
+#else
+#  define ISNAN(x)     (isnan(x)!=0)
+#endif
+
+/* The following is only defined inside R */
+#ifdef HAVE_WORKING_ISFINITE
+/* isfinite is defined in <math.h> according to C99 */
+# define R_FINITE(x)    isfinite(x)
+#else
+# define R_FINITE(x)    R_finite(x)
+#endif
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif /* R_ARITH_H_ */
diff --git a/sourcecodes/localscore/BLAS.h b/sourcecodes/localscore/BLAS.h
new file mode 100644
index 00000000..98c192e9
--- /dev/null
+++ b/sourcecodes/localscore/BLAS.h
@@ -0,0 +1,382 @@
+/*
+ *  R : A Computer Language for Statistical Data Analysis
+ *  Copyright (C) 2003-12 The R Core Team.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation; either version 2.1 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this program; if not, a copy is available at
+ *  http://www.r-project.org/Licenses/
+ */
+
+/*
+   C declarations of BLAS Fortran subroutines always available in R.
+
+   Part of the API.
+
+   R packages that use these should have PKG_LIBS in src/Makevars include 
+   $(BLAS_LIBS) $(FLIBS)
+ */
+
+/* Part of the API */
+
+#ifndef R_BLAS_H
+#define R_BLAS_H
+
+#include <R_ext/RS.h>		/* for F77_... */
+#include <R_ext/Complex.h>	/* for Rcomplex */
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+// never defined in R itself.
+#ifndef BLAS_extern
+#define BLAS_extern extern
+#endif
+
+/* Double Precision Level 1 BLAS */
+
+BLAS_extern double /* DASUM - sum of absolute values of a one-dimensional array */
+F77_NAME(dasum)(const int *n, const double *dx, const int *incx);
+BLAS_extern void   /* DAXPY - replace y by alpha*x + y */
+F77_NAME(daxpy)(const int *n, const double *alpha,
+		const double *dx, const int *incx,
+		double *dy, const int *incy);
+BLAS_extern void   /* DCOPY - copy x to y */
+F77_NAME(dcopy)(const int *n, const double *dx, const int *incx,
+		double *dy, const int *incy);
+BLAS_extern double /* DDOT - inner product of x and y */
+F77_NAME(ddot)(const int *n, const double *dx, const int *incx,
+	       const double *dy, const int *incy);
+BLAS_extern double /* DNRM2 - 2-norm of a vector */
+F77_NAME(dnrm2)(const int *n, const double *dx, const int *incx);
+BLAS_extern void   /* DROT - apply a Given's rotation */
+F77_NAME(drot)(const int *n, double *dx, const int *incx,
+	       double *dy, const int *incy, const double *c, const double *s);
+BLAS_extern void   /* DROTG - generate a Given's rotation */
+F77_NAME(drotg)(const double *a, const double *b, double *c, double *s);
+BLAS_extern void   /* DROTM - apply a modified Given's rotation */
+F77_NAME(drotm)(const int *n, double *dx, const int *incx,
+		double *dy, const int *incy, const double *dparam);
+BLAS_extern void   /* DROTMG - generate a modified Given's rotation */
+F77_NAME(drotmg)(const double *dd1, const double *dd2, const double *dx1,
+		 const double *dy1, double *param);
+BLAS_extern void   /* DSCAL - scale a one-dimensional array */
+F77_NAME(dscal)(const int *n, const double *alpha, double *dx, const int *incx);
+BLAS_extern void   /* DSWAP - interchange one-dimensional arrays */
+F77_NAME(dswap)(const int *n, double *dx, const int *incx,
+		double *dy, const int *incy);
+BLAS_extern int    /* IDAMAX - return the index of the element with max abs value */
+F77_NAME(idamax)(const int *n, const double *dx, const int *incx);
+
+/* Double Precision Level 2 BLAS */
+
+/* DGBMV - perform one of the matrix-vector operations */
+/* y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y, */
+BLAS_extern void
+F77_NAME(dgbmv)(const char *trans, const int *m, const int *n,
+		const int *kl,const int *ku,
+		const double *alpha, const double *a, const int *lda,
+		const double *x, const int *incx,
+		const double *beta, double *y, const int *incy);
+/* DGEMV - perform one of the matrix-vector operations */
+/* y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y,  */
+BLAS_extern void
+F77_NAME(dgemv)(const char *trans, const int *m, const int *n,
+		const double *alpha, const double *a, const int *lda,
+		const double *x, const int *incx, const double *beta,
+		double *y, const int *incy);
+/* DSBMV - perform the matrix-vector operation */
+/* y := alpha*A*x + beta*y, */
+BLAS_extern void
+F77_NAME(dsbmv)(const char *uplo, const int *n, const int *k,
+		const double *alpha, const double *a, const int *lda,
+		const double *x, const int *incx,
+		const double *beta, double *y, const int *incy);
+/* DSPMV - perform the matrix-vector operation */
+/* y := alpha*A*x + beta*y, */
+BLAS_extern void
+F77_NAME(dspmv)(const char *uplo, const int *n,
+		const double *alpha, const double *ap,
+		const double *x, const int *incx,
+		const double *beta, double *y, const int *incy);
+
+/* DSYMV - perform the matrix-vector operation */
+/*  y := alpha*A*x + beta*y, */
+BLAS_extern void
+F77_NAME(dsymv)(const char *uplo, const int *n, const double *alpha,
+		const double *a, const int *lda,
+		const double *x, const int *incx,
+		const double *beta, double *y, const int *incy);
+/* DTBMV - perform one of the matrix-vector operations */
+/* x := A*x, or x := A'*x, */
+BLAS_extern void
+F77_NAME(dtbmv)(const char *uplo, const char *trans,
+		const char *diag, const int *n, const int *k,
+		const double *a, const int *lda,
+		double *x, const int *incx);
+/* DTPMV - perform one of the matrix-vector operations */
+/* x := A*x, or x := A'*x, */
+BLAS_extern void
+F77_NAME(dtpmv)(const char *uplo, const char *trans, const char *diag,
+		const int *n, const double *ap,
+		double *x, const int *incx);
+/* DTRMV - perform one of the matrix-vector operations  */
+/* x := A*x, or x := A'*x, */
+BLAS_extern void
+F77_NAME(dtrmv)(const char *uplo, const char *trans, const char *diag,
+		const int *n, const double *a, const int *lda,
+		double *x, const int *incx);
+/* DTBSV - solve one of the systems of equations */
+/* A*x = b, or A'*x = b, */
+BLAS_extern void
+F77_NAME(dtbsv)(const char *uplo, const char *trans,
+		const char *diag, const int *n, const int *k,
+		const double *a, const int *lda,
+		double *x, const int *incx);
+/* DTPSV - solve one of the systems of equations */
+/* A*x = b, or A'*x = b, */
+BLAS_extern void
+F77_NAME(dtpsv)(const char *uplo, const char *trans,
+		const char *diag, const int *n,
+		const double *ap, double *x, const int *incx);
+/* DTRSV - solve one of the systems of equations */
+/* A*x = b, or A'*x = b, */
+BLAS_extern void
+F77_NAME(dtrsv)(const char *uplo, const char *trans,
+		const char *diag, const int *n,
+		const double *a, const int *lda,
+		double *x, const int *incx);
+/* DGER - perform the rank 1 operation   A := alpha*x*y' + A */
+BLAS_extern void
+F77_NAME(dger)(const int *m, const int *n, const double *alpha,
+	       const double *x, const int *incx,
+	       const double *y, const int *incy,
+	       double *a, const int *lda);
+/* DSYR - perform the symmetric rank 1 operation A := alpha*x*x' + A */
+BLAS_extern void
+F77_NAME(dsyr)(const char *uplo, const int *n, const double *alpha,
+	       const double *x, const int *incx,
+	       double *a, const int *lda);
+/* DSPR - perform the symmetric rank 1 operation A := alpha*x*x' + A */
+BLAS_extern void
+F77_NAME(dspr)(const char *uplo, const int *n, const double *alpha,
+	       const double *x, const int *incx, double *ap);
+/* DSYR2 - perform the symmetric rank 2 operation */
+/* A := alpha*x*y' + alpha*y*x' + A, */
+BLAS_extern void
+F77_NAME(dsyr2)(const char *uplo, const int *n, const double *alpha,
+		const double *x, const int *incx,
+		const double *y, const int *incy,
+		double *a, const int *lda);
+/* DSPR2 - perform the symmetric rank 2 operation */
+/* A := alpha*x*y' + alpha*y*x' + A,  */
+BLAS_extern void
+F77_NAME(dspr2)(const char *uplo, const int *n, const double *alpha,
+		const double *x, const int *incx,
+		const double *y, const int *incy, double *ap);
+
+/* Double Precision Level 3 BLAS */
+
+/* DGEMM - perform one of the matrix-matrix operations    */
+/* C := alpha*op( A )*op( B ) + beta*C */
+BLAS_extern void
+F77_NAME(dgemm)(const char *transa, const char *transb, const int *m,
+		const int *n, const int *k, const double *alpha,
+		const double *a, const int *lda,
+		const double *b, const int *ldb,
+		const double *beta, double *c, const int *ldc);
+/* DTRSM - solve one of the matrix equations  */
+/* op(A)*X = alpha*B, or  X*op(A) = alpha*B  */
+BLAS_extern void
+F77_NAME(dtrsm)(const char *side, const char *uplo,
+		const char *transa, const char *diag,
+		const int *m, const int *n, const double *alpha,
+		const double *a, const int *lda,
+		double *b, const int *ldb);
+/* DTRMM - perform one of the matrix-matrix operations */
+/* B := alpha*op( A )*B, or B := alpha*B*op( A ) */
+BLAS_extern void
+F77_NAME(dtrmm)(const char *side, const char *uplo, const char *transa,
+		const char *diag, const int *m, const int *n,
+		const double *alpha, const double *a, const int *lda,
+		double *b, const int *ldb);
+/* DSYMM - perform one of the matrix-matrix operations   */
+/*  C := alpha*A*B + beta*C, */
+BLAS_extern void
+F77_NAME(dsymm)(const char *side, const char *uplo, const int *m,
+		const int *n, const double *alpha,
+		const double *a, const int *lda,
+		const double *b, const int *ldb,
+		const double *beta, double *c, const int *ldc);
+/* DSYRK - perform one of the symmetric rank k operations */
+/* C := alpha*A*A' + beta*C or C := alpha*A'*A + beta*C */
+BLAS_extern void
+F77_NAME(dsyrk)(const char *uplo, const char *trans,
+		const int *n, const int *k,
+		const double *alpha, const double *a, const int *lda,
+		const double *beta, double *c, const int *ldc);
+/* DSYR2K - perform one of the symmetric rank 2k operations */
+/* C := alpha*A*B' + alpha*B*A' + beta*C or */
+/* C := alpha*A'*B + alpha*B'*A + beta*C */
+BLAS_extern void
+F77_NAME(dsyr2k)(const char *uplo, const char *trans,
+		 const int *n, const int *k,
+		 const double *alpha, const double *a, const int *lda,
+		 const double *b, const int *ldb,
+		 const double *beta, double *c, const int *ldc);
+/*
+  LSAME is a LAPACK support routine, not part of BLAS
+*/
+
+/* Double complex BLAS routines added for 2.3.0 */
+/* #ifdef HAVE_FORTRAN_DOUBLE_COMPLEX */
+    BLAS_extern double
+    F77_NAME(dcabs1)(double *z);
+    BLAS_extern double
+    F77_NAME(dzasum)(int *n, Rcomplex *zx, int *incx);
+    BLAS_extern double
+    F77_NAME(dznrm2)(int *n, Rcomplex *x, int *incx);
+    BLAS_extern int
+    F77_NAME(izamax)(int *n, Rcomplex *zx, int *incx);
+    BLAS_extern void
+    F77_NAME(zaxpy)(int *n, Rcomplex *za, Rcomplex *zx,
+		    int *incx, Rcomplex *zy, int *incy);
+    BLAS_extern void
+    F77_NAME(zcopy)(int *n, Rcomplex *zx, int *incx,
+		    Rcomplex *zy, int *incy);
+
+    /* WARNING!  The next two return a value that may not be
+       compatible between C and Fortran, and even if it is, this might
+       not be the right translation to C.  Only use after
+       configure-testing with your compilers.
+     */
+    BLAS_extern Rcomplex
+    F77_NAME(zdotc)(int *n,
+		    Rcomplex *zx, int *incx, Rcomplex *zy, int *incy);
+    BLAS_extern Rcomplex
+    F77_NAME(zdotu)(int *n,
+		    Rcomplex *zx, int *incx, Rcomplex *zy, int *incy);
+
+    BLAS_extern void
+    F77_NAME(zdrot)(int *n, Rcomplex *zx, int *incx, Rcomplex *zy,
+		int *incy, double *c, double *s);
+    BLAS_extern void
+    F77_NAME(zdscal)(int *n, double *da, Rcomplex *zx, int *incx);
+    BLAS_extern void
+    F77_NAME(zgbmv)(char *trans, int *m, int *n, int *kl,
+		    int *ku, Rcomplex *alpha, Rcomplex *a, int *lda,
+		    Rcomplex *x, int *incx, Rcomplex *beta, Rcomplex *y,
+		    int *incy);
+    BLAS_extern void
+    F77_NAME(zgemm)(const char *transa, const char *transb, const int *m,
+		    const int *n, const int *k, const Rcomplex *alpha,
+		    const Rcomplex *a, const int *lda,
+		    const Rcomplex *b, const int *ldb,
+		    const Rcomplex *beta, Rcomplex *c, const int *ldc);
+    BLAS_extern void
+    F77_NAME(zgemv)(char *trans, int *m, int *n, Rcomplex *alpha,
+		    Rcomplex *a, int *lda, Rcomplex *x, int *incx,
+		    Rcomplex *beta, Rcomplex *y, int * incy);
+    BLAS_extern void
+    F77_NAME(zgerc)(int *m, int *n, Rcomplex *alpha, Rcomplex *x,
+		    int *incx, Rcomplex *y, int *incy, Rcomplex *a, int *lda);
+    BLAS_extern void
+    F77_NAME(zgeru)(int *m, int *n, Rcomplex *alpha, Rcomplex *x,
+		    int *incx, Rcomplex *y, int *incy, Rcomplex *a, int *lda);
+    BLAS_extern void
+    F77_NAME(zhbmv)(char *uplo, int *n, int *k, Rcomplex *alpha,
+		    Rcomplex *a, int *lda, Rcomplex *x, int *incx,
+		    Rcomplex *beta, Rcomplex *y, int *incy);
+    BLAS_extern void
+    F77_NAME(zhemm)(char *side, char *uplo, int *m, int *n,
+		    Rcomplex *alpha, Rcomplex *a, int *lda, Rcomplex *b,
+		    int *ldb, Rcomplex *beta, Rcomplex *c, int *ldc);
+    BLAS_extern void
+    F77_NAME(zhemv)(char *uplo, int *n, Rcomplex *alpha, Rcomplex *a,
+		    int *lda, Rcomplex *x, int *incx, Rcomplex *beta,
+		    Rcomplex *y, int *incy);
+    BLAS_extern void
+    F77_NAME(zher)(char *uplo, int *n, double *alpha, Rcomplex *x,
+		   int *incx, Rcomplex *a, int *lda);
+    BLAS_extern void
+    F77_NAME(zher2)(char *uplo, int *n, Rcomplex *alpha, Rcomplex *x,
+		    int *incx, Rcomplex *y, int *incy, Rcomplex *a, int *lda);
+    BLAS_extern void
+    F77_NAME(zher2k)(char *uplo, char *trans, int *n, int *k,
+		     Rcomplex *alpha, Rcomplex *a, int *lda, Rcomplex *b,
+		     int *ldb, double *beta, Rcomplex *c, int *ldc);
+    BLAS_extern void
+    F77_NAME(zherk)(char *uplo, char *trans, int *n, int *k,
+		    double *alpha, Rcomplex *a, int *lda, double *beta,
+		    Rcomplex *c, int *ldc);
+    BLAS_extern void
+    F77_NAME(zhpmv)(char *uplo, int *n, Rcomplex *alpha, Rcomplex *ap,
+		    Rcomplex *x, int *incx, Rcomplex * beta, Rcomplex *y,
+		    int *incy);
+    BLAS_extern void
+    F77_NAME(zhpr)(char *uplo, int *n, double *alpha,
+		   Rcomplex *x, int *incx, Rcomplex *ap);
+    BLAS_extern void
+    F77_NAME(zhpr2)(char *uplo, int *n, Rcomplex *alpha, Rcomplex *x,
+		    int *incx, Rcomplex *y, int *incy, Rcomplex *ap);
+    BLAS_extern void
+    F77_NAME(zrotg)(Rcomplex *ca, Rcomplex *cb, double *c, Rcomplex *s);
+    BLAS_extern void
+    F77_NAME(zscal)(int *n, Rcomplex *za, Rcomplex *zx, int *incx);
+    BLAS_extern void
+    F77_NAME(zswap)(int *n, Rcomplex *zx, int *incx, Rcomplex *zy, int *incy);
+    BLAS_extern void
+    F77_NAME(zsymm)(char *side, char *uplo, int *m, int *n,
+		    Rcomplex *alpha, Rcomplex *a, int *lda, Rcomplex *b,
+		    int *ldb, Rcomplex *beta, Rcomplex *c, int *ldc);
+    BLAS_extern void
+    F77_NAME(zsyr2k)(char *uplo, char *trans, int *n, int *k,
+		     Rcomplex *alpha, Rcomplex *a, int *lda, Rcomplex *b,
+		     int *ldb, Rcomplex *beta, Rcomplex *c, int *ldc);
+    BLAS_extern void
+    F77_NAME(zsyrk)(char *uplo, char *trans, int *n, int *k,
+		    Rcomplex *alpha, Rcomplex *a, int *lda,
+		    Rcomplex *beta, Rcomplex *c, int *ldc);
+    BLAS_extern void
+    F77_NAME(ztbmv)(char *uplo, char *trans, char *diag, int *n, int *k,
+		    Rcomplex *a, int *lda, Rcomplex *x, int *incx);
+    BLAS_extern void
+    F77_NAME(ztbsv)(char *uplo, char *trans, char *diag, int *n, int *k,
+		    Rcomplex *a, int *lda, Rcomplex *x, int *incx);
+    BLAS_extern void
+    F77_NAME(ztpmv)(char *uplo, char *trans, char *diag, int *n,
+		    Rcomplex *ap, Rcomplex *x, int *incx);
+    BLAS_extern void
+    F77_NAME(ztpsv)(char *uplo, char *trans, char *diag, int *n,
+		    Rcomplex *ap, Rcomplex *x, int *incx);
+    BLAS_extern void
+    F77_NAME(ztrmm)(char *side, char *uplo, char *transa, char *diag,
+		    int *m, int *n, Rcomplex *alpha, Rcomplex *a,
+		    int *lda, Rcomplex *b, int *ldb);
+    BLAS_extern void
+    F77_NAME(ztrmv)(char *uplo, char *trans, char *diag, int *n,
+		    Rcomplex *a, int *lda, Rcomplex *x, int *incx);
+    BLAS_extern void
+    F77_NAME(ztrsm)(char *side, char *uplo, char *transa, char *diag,
+		    int *m, int *n, Rcomplex *alpha, Rcomplex *a,
+		    int *lda, Rcomplex *b, int *ldb);
+    BLAS_extern void
+    F77_NAME(ztrsv)(char *uplo, char *trans, char *diag, int *n,
+		    Rcomplex *a, int *lda, Rcomplex *x, int *incx);
+/* #endif */
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif /* R_BLAS_H */
diff --git a/sourcecodes/localscore/Boolean.h b/sourcecodes/localscore/Boolean.h
new file mode 100644
index 00000000..ea855a29
--- /dev/null
+++ b/sourcecodes/localscore/Boolean.h
@@ -0,0 +1,37 @@
+/*
+ *  R : A Computer Language for Statistical Data Analysis
+ *  Copyright (C) 2000, 2001 The R Core Team.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation; either version 2.1 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this program; if not, a copy is available at
+ *  http://www.r-project.org/Licenses/
+ */
+
+/* Included by R.h: API */
+
+#ifndef R_EXT_BOOLEAN_H_
+#define R_EXT_BOOLEAN_H_
+
+#undef FALSE
+#undef TRUE
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+typedef enum { FALSE = 0, TRUE /*, MAYBE */ } Rboolean;
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif /* R_EXT_BOOLEAN_H_ */
diff --git a/sourcecodes/localscore/Callbacks.h b/sourcecodes/localscore/Callbacks.h
new file mode 100644
index 00000000..cb1d64ca
--- /dev/null
+++ b/sourcecodes/localscore/Callbacks.h
@@ -0,0 +1,116 @@
+/*
+ *  R : A Computer Language for Statistical Data Analysis
+ *  Copyright (C) 2001-2 The R Core Team.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation; either version 2.1 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this program; if not, a copy is available at
+ *  http://www.r-project.org/Licenses/
+ */
+
+/* 
+   Not part of the API, subject to change at any time.
+*/
+
+#ifndef R_CALLBACKS_H
+#define R_CALLBACKS_H
+
+/**
+  These structures are for C (and R function) top-level task handlers.
+  Such routines are called at the end of every (successful) top-level task
+  in the regular REPL. 
+ */
+
+#include <Rinternals.h>
+/**
+  The signature of the C routine that a callback must implement.
+  expr - the expression for the top-level task that was evaluated.
+  value - the result of the top-level task, i.e. evaluating expr.
+  succeeded - a logical value indicating whether the task completed propertly.
+  visible - a logical value indicating whether the result was printed to the R ``console''/stdout.
+  data - user-level data passed to the registration routine.
+ */
+typedef Rboolean (*R_ToplevelCallback)(SEXP expr, SEXP value, Rboolean succeeded, Rboolean visible, void *);
+
+typedef struct _ToplevelCallback  R_ToplevelCallbackEl;
+/** 
+ Linked list element for storing the top-level task callbacks.
+ */
+struct _ToplevelCallback {
+    R_ToplevelCallback cb; /* the C routine to call. */
+    void *data;            /* the user-level data to pass to the call to cb() */
+    void (*finalizer)(void *data); /* Called when the callback is removed. */
+
+    char *name;  /* a name by which to identify this element. */ 
+
+    R_ToplevelCallbackEl *next; /* the next element in the linked list. */
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+Rboolean Rf_removeTaskCallbackByIndex(int id);
+Rboolean Rf_removeTaskCallbackByName(const char *name);
+SEXP R_removeTaskCallback(SEXP which);
+R_ToplevelCallbackEl* Rf_addTaskCallback(R_ToplevelCallback cb, void *data, void (*finalizer)(void *), const char *name, int *pos);
+
+
+
+/*
+  The following definitions are for callbacks to R functions and
+  methods related to user-level tables.  This was implemented in a
+  separate package on Omegahat and these declarations allow the package
+  to interface to the internal R code.
+  
+  See http://developer.r-project.org/RObjectTables.pdf,
+  http://www.omegahat.org/RObjectTables/
+*/
+
+typedef struct  _R_ObjectTable R_ObjectTable;
+
+/* Do we actually need the exists() since it is never called but R
+   uses get to see if the symbol is bound to anything? */
+typedef Rboolean (*Rdb_exists)(const char * const name, Rboolean *canCache, R_ObjectTable *);
+typedef SEXP     (*Rdb_get)(const char * const name, Rboolean *canCache, R_ObjectTable *);
+typedef int      (*Rdb_remove)(const char * const name, R_ObjectTable *);
+typedef SEXP     (*Rdb_assign)(const char * const name, SEXP value, R_ObjectTable *);
+typedef SEXP     (*Rdb_objects)(R_ObjectTable *);
+typedef Rboolean (*Rdb_canCache)(const char * const name, R_ObjectTable *);
+
+typedef void     (*Rdb_onDetach)(R_ObjectTable *);
+typedef void     (*Rdb_onAttach)(R_ObjectTable *);
+
+struct  _R_ObjectTable{
+  int       type;
+  char    **cachedNames;
+  Rboolean  active;
+
+  Rdb_exists   exists;
+  Rdb_get      get;
+  Rdb_remove   remove;
+  Rdb_assign   assign;
+  Rdb_objects  objects;
+  Rdb_canCache canCache;
+
+  Rdb_onDetach onDetach;
+  Rdb_onAttach onAttach;
+  
+  void     *privateData;
+};
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* R_CALLBACKS_H */
diff --git a/sourcecodes/localscore/Complex.h b/sourcecodes/localscore/Complex.h
new file mode 100644
index 00000000..06417a71
--- /dev/null
+++ b/sourcecodes/localscore/Complex.h
@@ -0,0 +1,38 @@
+/*
+ *  R : A Computer Language for Statistical Data Analysis
+ *  Copyright (C) 1998-2001   The R Core Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation; either version 2.1 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this program; if not, a copy is available at
+ *  http://www.r-project.org/Licenses/
+ */
+
+/* Included by R.h: API */
+
+#ifndef R_COMPLEX_H
+#define R_COMPLEX_H
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+typedef struct {
+	double r;
+	double i;
+} Rcomplex;
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif /* R_COMPLEX_H */
diff --git a/sourcecodes/localscore/Constants.h b/sourcecodes/localscore/Constants.h
new file mode 100644
index 00000000..08e3d158
--- /dev/null
+++ b/sourcecodes/localscore/Constants.h
@@ -0,0 +1,44 @@
+/*
+ *  R : A Computer Language for Statistical Data Analysis
+ *  Copyright (C) 1995, 1996  Robert Gentleman and Ross Ihaka
+ *  Copyright (C) 1998-2012   The R Core Team.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation; either version 2.1 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this program; if not, a copy is available at
+ *  http://www.r-project.org/Licenses/
+ */
+
+/* Included by R.h: API */
+
+#ifndef R_EXT_CONSTANTS_H_
+#define R_EXT_CONSTANTS_H_
+
+/* usually in math.h, but not with strict C99 compliance */
+#ifndef M_PI
+#define M_PI 3.141592653589793238462643383279502884197169399375
+#endif
+
+#ifndef STRICT_R_HEADERS
+#define PI             M_PI
+#include <float.h>  /* Defines the rest, at least in C99 */
+#define SINGLE_EPS     FLT_EPSILON
+#define SINGLE_BASE    FLT_RADIX
+#define SINGLE_XMIN    FLT_MIN
+#define SINGLE_XMAX    FLT_MAX
+#define DOUBLE_DIGITS  DBL_MANT_DIG
+#define DOUBLE_EPS     DBL_EPSILON
+#define DOUBLE_XMAX    DBL_MAX
+#define DOUBLE_XMIN    DBL_MIN
+#endif
+
+#endif /* R_EXT_CONSTANTS_H_ */
diff --git a/sourcecodes/localscore/Error.h b/sourcecodes/localscore/Error.h
new file mode 100644
index 00000000..1a8905c6
--- /dev/null
+++ b/sourcecodes/localscore/Error.h
@@ -0,0 +1,46 @@
+/*
+ *  R : A Computer Language for Statistical Data Analysis
+ *  Copyright (C) 1998-2005   The R Core Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation; either version 2.1 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this program; if not, a copy is available at
+ *  http://www.r-project.org/Licenses/
+ */
+
+/* Included by R.h: API */
+
+#ifndef R_ERROR_H_
+#define R_ERROR_H_
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+void	Rf_error(const char *, ...);
+void	Rf_warning(const char *, ...);
+void	WrongArgCount(const char *);
+void	UNIMPLEMENTED(const char *);
+void 	R_ShowMessage(const char *s);
+    
+
+#ifdef  __cplusplus
+}
+#endif
+
+#ifndef R_NO_REMAP
+#define error Rf_error
+#define warning Rf_warning
+#endif
+
+
+#endif /* R_ERROR_H_ */
diff --git a/sourcecodes/localscore/GetX11Image.h b/sourcecodes/localscore/GetX11Image.h
new file mode 100644
index 00000000..a7181fa3
--- /dev/null
+++ b/sourcecodes/localscore/GetX11Image.h
@@ -0,0 +1,36 @@
+/*
+ *  R : A Computer Language for Statistical Data Analysis
+ *  Copyright (C) 2003  R Core Team
+ *
+ *  This program 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.
+ *
+ *  This program 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 this program; if not, a copy is available at
+ *  http://www.r-project.org/Licenses/
+ */
+
+#ifndef GETX11IMAGE_H_
+#define GETX11IMAGE_H_
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+/* used by package tkrplot */
+
+Rboolean R_GetX11Image(int d, void *pximage, int *pwidth, int *pheight);
+/* pximage is really (XImage **) */
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif
diff --git a/sourcecodes/localscore/GraphicsDevice.h b/sourcecodes/localscore/GraphicsDevice.h
new file mode 100644
index 00000000..10851b26
--- /dev/null
+++ b/sourcecodes/localscore/GraphicsDevice.h
@@ -0,0 +1,863 @@
+/*
+ *  R : A Computer Language for Statistical Data Analysis
+ *  Copyright (C) 2001-11 The R Core Team.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation; either version 2.1 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this program; if not, a copy is available at
+ *  http://www.r-project.org/Licenses/
+ */
+
+/* Used by third-party graphics devices.
+ *
+ * This defines DevDesc, whereas GraphicsEngine.h defines GEDevDesc.
+ * Also contains entry points from gevents.c
+ */
+
+#ifndef R_GRAPHICSDEVICE_H_
+#define R_GRAPHICSDEVICE_H_
+
+
+/* ideally we would use prototypes in DevDesc.  
+   Some devices have taken to passing pointers to their own structure
+   instead of DevDesc* , defining R_USE_PROTOTYPES 0 allows them to
+   opt out.
+*/
+
+#ifndef  R_USE_PROTOTYPES
+# define R_USE_PROTOTYPES 1
+# ifndef R_GRAPHICSENGINE_H_
+#  error R_ext/GraphicsEngine.h must be included first, and includes this header
+# endif
+#endif
+
+#include <R_ext/Boolean.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* --------- New (in 1.4.0) device driver structure ---------
+ * NOTES:
+ * 1. All locations and dimensions are in device coordinates.
+ * 2. I found this comment in the doc for dev_Open -- looks nasty
+ *    Any known instances of such a thing happening?  Should be
+ *    replaced by a function to query the device for preferred gpars
+ *    settings? (to be called when the device is initialised)
+         *
+         * NOTE that it is perfectly acceptable for this
+         * function to set generic graphics parameters too
+         * (i.e., override the generic parameter settings
+         * which GInit sets up) all at the author's own risk
+         * of course :)
+	 *
+ * 3. Do we really need dev_StrWidth as well as dev_MetricInfo?
+ *    I can see the difference between the two -- its just a
+ *    question of whether dev_MetricInfo should just return
+ *    what dev_StrWidth would give if font metric information is
+ *    not available.  I guess having both allows the developer
+ *    to decide when to ask for which sort of value, and to decide
+ *    what to do when font metric information is not available.
+ *    And why not a dev_StrHeight?
+ * 4. Should "ipr", "asp", and "cra" be in the device description?
+ *    If not, then where?
+ *    I guess they don't need to be if no device makes use of them.
+ *    On the other hand, they would need to be replaced by a device
+ *    call that R base graphics could use to get enough information
+ *    to figure them out.  (e.g., some sort of dpi() function to
+ *    complement the size() function.)
+ */
+
+typedef struct _DevDesc DevDesc;
+typedef DevDesc* pDevDesc;
+
+struct _DevDesc {
+    /********************************************************
+     * Device physical characteristics
+     ********************************************************/
+    double left;	        /* left raster coordinate */
+    double right;	        /* right raster coordinate */
+    double bottom;	        /* bottom raster coordinate */
+    double top;		        /* top raster coordinate */
+    /* R only has the notion of a rectangular clipping region
+     */
+    double clipLeft;
+    double clipRight;
+    double clipBottom;
+    double clipTop;
+    /* I hate these next three -- they seem like a real fudge
+     * BUT I'm not sure what to replace them with so they stay for now.
+     */
+    double xCharOffset;	        /* x character addressing offset - unused */
+    double yCharOffset;	        /* y character addressing offset */
+    double yLineBias;	        /* 1/2 interline space as frac of line height */
+    double ipr[2];	        /* Inches per raster; [0]=x, [1]=y */
+    /* I hate this guy too -- seems to assume that a device can only
+     * have one font size during its lifetime
+     * BUT removing/replacing it would take quite a lot of work
+     * to design and insert a good replacement so it stays for now.
+     */
+    double cra[2];	        /* Character size in rasters; [0]=x, [1]=y */
+    double gamma;	        /* (initial) Device Gamma Correction */
+    /********************************************************
+     * Device capabilities
+     ********************************************************/
+    Rboolean canClip;		/* Device-level clipping */
+    Rboolean canChangeGamma;    /* can the gamma factor be modified? */
+    int canHAdj;	        /* Can do at least some horiz adjust of text
+			           0 = none, 1 = {0,0.5,1}, 2 = [0,1] */
+    /********************************************************
+     * Device initial settings
+     ********************************************************/
+    /* These are things that the device must set up when it is created.
+     * The graphics system can modify them and track current values,
+     */
+    double startps;
+    int startcol;  /* sets par("fg"), par("col") and gpar("col") */
+    int startfill; /* sets par("bg") and gpar("fill") */
+    int startlty;
+    int startfont;
+    double startgamma;
+    /********************************************************
+     * Device specific information
+     ********************************************************/
+    void *deviceSpecific;	/* pointer to device specific parameters */
+    /********************************************************
+     * Device display list
+     ********************************************************/
+    Rboolean displayListOn;     /* toggle for initial display list status */
+
+
+    /********************************************************
+     * Event handling entries
+     ********************************************************/
+
+    /* Used in do_setGraphicsEventEnv */
+
+    Rboolean canGenMouseDown; /* can the device generate mousedown events */
+    Rboolean canGenMouseMove; /* can the device generate mousemove events */
+    Rboolean canGenMouseUp;   /* can the device generate mouseup events */
+    Rboolean canGenKeybd;     /* can the device generate keyboard events */
+
+    Rboolean gettingEvent;    /* This is set while getGraphicsEvent
+				 is actively looking for events */
+    
+    /********************************************************
+     * Device procedures.
+     ********************************************************/
+
+    /*
+     * ---------------------------------------
+     * GENERAL COMMENT ON GRAPHICS PARAMETERS:
+     * ---------------------------------------
+     * Graphical parameters are now passed in a pointer to a 
+     * graphics context structure (pGEcontext) rather than individually.
+     * Each device action should extract the parameters it needs
+     * and ignore the others.  Thought should be given to which
+     * parameters are relevant in each case -- the graphics engine
+     * does not REQUIRE that each parameter is honoured, but if
+     * a parameter is NOT honoured, it might be a good idea to
+     * issue a warning when a parameter is not honoured (or at
+     * the very least document which parameters are not honoured
+     * in the user-level documentation for the device).  [An example
+     * of a parameter that may not be honoured by many devices is
+     * transparency.]
+     */
+
+    /*
+     * device_Activate is called when a device becomes the
+     * active device.  For example, it can be used to change the
+     * title of a window to indicate the active status of
+     * the device to the user.  Not all device types will
+     * do anything.
+     * The only parameter is a device driver structure.
+     * An example is ...
+     *
+     * static void   X11_Activate(pDevDesc dd);
+     *
+     * As from R 2.14.0 this can be omitted or set to NULL.
+     */
+#if R_USE_PROTOTYPES
+    void (*activate)(const pDevDesc );
+#else
+    void (*activate)();
+#endif
+    /*
+     * device_Circle should have the side-effect that a
+     * circle is drawn, centred at the given location, with
+     * the given radius.
+     * (If the device has non-square pixels, 'radius' should
+     * be interpreted in the units of the x direction.)
+     * The border of the circle should be
+     * drawn in the given "col", and the circle should be
+     * filled with the given "fill" colour.
+     * If "col" is NA_INTEGER then no border should be drawn
+     * If "fill" is NA_INTEGER then the circle should not
+     * be filled.
+     * An example is ...
+     *
+     * static void X11_Circle(double x, double y, double r,
+     *                        pGEcontext gc,
+     *                        pDevDesc dd);
+     *
+     * R_GE_gcontext parameters that should be honoured (if possible):
+     *   col, fill, gamma, lty, lwd
+     */
+#if R_USE_PROTOTYPES
+    void (*circle)(double x, double y, double r, const pGEcontext gc, pDevDesc dd);
+#else
+    void (*circle)();
+#endif
+    /*
+     * device_Clip is given the left, right, bottom, and
+     * top of a rectangle (in DEVICE coordinates).
+     * It should have the side-effect that subsequent output
+     * is clipped to the given rectangle.
+     * NOTE that R's graphics engine already clips to the
+     * extent of the device.
+     * NOTE also that this will probably only be called if
+     * the flag canClip is true.
+     * An example is ...
+     *
+     * static void X11_Clip(double x0, double x1, double y0, double y1,
+     *                      pDevDesc dd)
+     */
+#if R_USE_PROTOTYPES
+    void (*clip)(double x0, double x1, double y0, double y1, pDevDesc dd);
+#else
+    void (*clip)();
+#endif
+    /*
+     * device_Close is called when the device is killed.
+     * This function is responsible for destroying any
+     * device-specific resources that were created in
+     * device_Open and for FREEing the device-specific
+     * parameters structure.
+     * An example is ...
+     *
+     * static void X11_Close(pDevDesc dd)
+     *
+     */
+#if R_USE_PROTOTYPES
+    void (*close)(pDevDesc dd);
+#else
+    void (*close)();
+#endif
+    /*
+     * device_Deactivate is called when a device becomes
+     * inactive.
+     * This allows the device to undo anything it did in
+     * dev_Activate.
+     * Not all device types will do anything.
+     * An example is ...
+     *
+     * static void X11_Deactivate(pDevDesc dd)
+     *
+     * As from R 2.14.0 this can be omitted or set to NULL.
+     */
+#if R_USE_PROTOTYPES
+    void (*deactivate)(pDevDesc );
+#else
+    void (*deactivate)();
+#endif
+
+
+    /*
+     * device_Locator should return the location of the next
+     * mouse click (in DEVICE coordinates)
+     * Not all devices will do anything (e.g., postscript)
+     * An example is ...
+     *
+     * static Rboolean X11_Locator(double *x, double *y, pDevDesc dd)
+     *
+     * As from R 2.14.0 this can be omitted or set to NULL.
+     */
+#if R_USE_PROTOTYPES
+    Rboolean (*locator)(double *x, double *y, pDevDesc dd);
+#else
+    Rboolean (*locator)();
+#endif
+    /*
+     * device_Line should have the side-effect that a single
+     * line is drawn (from x1,y1 to x2,y2)
+     * An example is ...
+     *
+     * static void X11_Line(double x1, double y1, double x2, double y2,
+     *                      const pGEcontext gc,
+     *                      pDevDesc dd);
+     *
+     * R_GE_gcontext parameters that should be honoured (if possible):
+     *   col, gamma, lty, lwd
+     */
+#if R_USE_PROTOTYPES
+    void (*line)(double x1, double y1, double x2, double y2,
+		 const pGEcontext gc, pDevDesc dd);
+#else
+    void (*line)();
+#endif
+    /*
+     * device_MetricInfo should return height, depth, and
+     * width information for the given character in DEVICE
+     * units.
+     * Note: in an 8-bit locale, c is 'char'.
+     * In an mbcslocale, it is wchar_t, and at least some
+     * of code assumes that is UCS-2 (Windows, true) or UCS-4.
+     * This is used for formatting mathematical expressions
+     * and for exact centering of text (see GText)
+     * If the device cannot provide metric information then
+     * it MUST return 0.0 for ascent, descent, and width.
+     * An example is ...
+     *
+     * static void X11_MetricInfo(int c,
+     *                            const pGEcontext gc,
+     *                            double* ascent, double* descent,
+     *                            double* width, pDevDesc dd);
+     *
+     * R_GE_gcontext parameters that should be honoured (if possible):
+     *   font, cex, ps
+     */
+#if R_USE_PROTOTYPES
+    void (*metricInfo)(int c, const pGEcontext gc,
+		       double* ascent, double* descent, double* width,
+		       pDevDesc dd);
+#else
+    void (*metricInfo)();
+#endif
+    /*
+     * device_Mode is called whenever the graphics engine
+     * starts drawing (mode=1) or stops drawing (mode=0)
+     * GMode (in graphics.c) also says that 
+     * mode = 2 (graphical input on) exists.
+     * The device is not required to do anything
+     * An example is ...
+     *
+     * static void X11_Mode(int mode, pDevDesc dd);
+     *
+     * As from R 2.14.0 this can be omitted or set to NULL.
+     */
+#if R_USE_PROTOTYPES
+    void (*mode)(int mode, pDevDesc dd);
+#else
+    void (*mode)();
+#endif
+    /*
+     * device_NewPage is called whenever a new plot requires
+     * a new page.
+     * A new page might mean just clearing the
+     * device (e.g., X11) or moving to a new page
+     * (e.g., postscript)
+     * An example is ...
+     *
+     *
+     * static void X11_NewPage(const pGEcontext gc,
+     *                         pDevDesc dd);
+     *
+     */
+#if R_USE_PROTOTYPES
+    void (*newPage)(const pGEcontext gc, pDevDesc dd);
+#else
+    void (*newPage)();
+#endif
+    /*
+     * device_Polygon should have the side-effect that a
+     * polygon is drawn using the given x and y values
+     * the polygon border should be drawn in the "col"
+     * colour and filled with the "fill" colour.
+     * If "col" is NA_INTEGER don't draw the border
+     * If "fill" is NA_INTEGER don't fill the polygon
+     * An example is ...
+     *
+     * static void X11_Polygon(int n, double *x, double *y,
+     *                         const pGEcontext gc,
+     *                         pDevDesc dd);
+     *
+     * R_GE_gcontext parameters that should be honoured (if possible):
+     *   col, fill, gamma, lty, lwd
+     */
+#if R_USE_PROTOTYPES
+    void (*polygon)(int n, double *x, double *y, const pGEcontext gc, pDevDesc dd);
+#else
+    void (*polygon)();
+#endif
+    /*
+     * device_Polyline should have the side-effect that a
+     * series of line segments are drawn using the given x
+     * and y values.
+     * An example is ...
+     *
+     * static void X11_Polyline(int n, double *x, double *y,
+     *                          const pGEcontext gc,
+     *                          pDevDesc dd);
+     *
+     * R_GE_gcontext parameters that should be honoured (if possible):
+     *   col, gamma, lty, lwd
+     */
+#if R_USE_PROTOTYPES
+    void (*polyline)(int n, double *x, double *y, const pGEcontext gc, pDevDesc dd);
+#else
+    void (*polyline)();
+#endif
+    /*
+     * device_Rect should have the side-effect that a
+     * rectangle is drawn with the given locations for its
+     * opposite corners.  The border of the rectangle
+     * should be in the given "col" colour and the rectangle
+     * should be filled with the given "fill" colour.
+     * If "col" is NA_INTEGER then no border should be drawn
+     * If "fill" is NA_INTEGER then the rectangle should not
+     * be filled.
+     * An example is ...
+     *
+     * static void X11_Rect(double x0, double y0, double x1, double y1,
+     *                      const pGEcontext gc,
+     *                      pDevDesc dd);
+     *
+     */
+#if R_USE_PROTOTYPES
+    void (*rect)(double x0, double y0, double x1, double y1,
+		 const pGEcontext gc, pDevDesc dd);
+#else
+    void (*rect)();
+#endif
+    /* 
+     * device_Path should draw one or more sets of points 
+     * as a single path
+     * 
+     * 'x' and 'y' give the points
+     *
+     * 'npoly' gives the number of polygons in the path
+     * MUST be at least 1
+     *
+     * 'nper' gives the number of points in each polygon
+     * each value MUST be at least 2
+     *
+     * 'winding' says whether to fill using the nonzero 
+     * winding rule or the even-odd rule
+     *
+     * Added 2010-06-27
+     *
+     * As from R 2.13.2 this can be left unimplemented as NULL.
+     */
+#if R_USE_PROTOTYPES
+    void (*path)(double *x, double *y, 
+                 int npoly, int *nper,
+                 Rboolean winding,
+                 const pGEcontext gc, pDevDesc dd);
+#else
+    void (*path)();
+#endif
+    /* 
+     * device_Raster should draw a raster image justified 
+     * at the given location,
+     * size, and rotation (not all devices may be able to rotate?)
+     * 
+     * 'raster' gives the image data BY ROW, with every four bytes
+     * giving one R colour (ABGR).
+     *
+     * 'x and 'y' give the bottom-left corner.
+     *
+     * 'rot' is in degrees (as per device_Text), with positive
+     * rotation anticlockwise from the positive x-axis.
+     *
+     * As from R 2.13.2 this can be left unimplemented as NULL.
+     */
+#if R_USE_PROTOTYPES
+    void (*raster)(unsigned int *raster, int w, int h,
+                   double x, double y, 
+                   double width, double height,
+                   double rot, 
+                   Rboolean interpolate,
+                   const pGEcontext gc, pDevDesc dd);
+#else
+    void (*raster)();
+#endif
+    /* 
+     * device_Cap should return an integer matrix (R colors)
+     * representing the current contents of the device display.
+     * 
+     * The result is expected to be ROW FIRST.
+     *
+     * This will only make sense for raster devices and can 
+     * probably only be implemented for screen devices.
+     *
+     * added 2010-06-27
+     *
+     * As from R 2.13.2 this can be left unimplemented as NULL.
+     * For earlier versions of R it should return R_NilValue.
+     */
+#if R_USE_PROTOTYPES
+    SEXP (*cap)(pDevDesc dd);
+#else
+    SEXP (*cap)();
+#endif
+    /*
+     * device_Size is called whenever the device is
+     * resized.
+     * The function returns (left, right, bottom, and top) for the
+     * new device size.
+     * This is not usually called directly by the graphics
+     * engine because the detection of device resizes
+     * (e.g., a window resize) are usually detected by
+     * device-specific code.
+     * An example is ...
+     *
+     * static void X11_Size(double *left, double *right,
+     *                      double *bottom, double *top,
+     *                      pDevDesc dd);
+     *
+     * R_GE_gcontext parameters that should be honoured (if possible):
+     *   col, fill, gamma, lty, lwd
+     *
+     * As from R 2.13.2 this can be left unimplemented as NULL.
+     */
+#if R_USE_PROTOTYPES
+    void (*size)(double *left, double *right, double *bottom, double *top,
+		 pDevDesc dd);
+#else
+    void (*size)();
+#endif
+    /*
+     * device_StrWidth should return the width of the given
+     * string in DEVICE units.
+     * An example is ...
+     *
+     * static double X11_StrWidth(const char *str,
+     *                            const pGEcontext gc,
+     *                            pDevDesc dd)
+     *
+     * R_GE_gcontext parameters that should be honoured (if possible):
+     *   font, cex, ps
+     */
+#if R_USE_PROTOTYPES
+    double (*strWidth)(const char *str, const pGEcontext gc, pDevDesc dd);
+#else
+    double (*strWidth)();
+#endif
+    /*
+     * device_Text should have the side-effect that the
+     * given text is drawn at the given location.
+     * The text should be rotated according to rot (degrees)
+     * An example is ...
+     *
+     * static void X11_Text(double x, double y, const char *str,
+     *                      double rot, double hadj,
+     *                      const pGEcontext gc,
+     * 	                    pDevDesc dd);
+     *
+     * R_GE_gcontext parameters that should be honoured (if possible):
+     *   font, cex, ps, col, gamma
+     */
+#if R_USE_PROTOTYPES
+    void (*text)(double x, double y, const char *str, double rot,
+		 double hadj, const pGEcontext gc, pDevDesc dd);
+#else
+    void (*text)();
+#endif
+    /*
+     * device_onExit is called by GEonExit when the user has aborted
+     * some operation, and so an R_ProcessEvents call may not return normally.
+     * It need not be set to any value; if null, it will not be called.
+     *
+     * An example is ...
+     *
+     * static void GA_onExit(pDevDesc dd);
+    */
+#if R_USE_PROTOTYPES
+    void (*onExit)(pDevDesc dd);
+#else
+    void (*onExit)();
+#endif
+    /*
+     * device_getEvent is no longer used, but the slot is kept for back
+     * compatibility of the structure.
+     */
+    SEXP (*getEvent)(SEXP, const char *);
+
+    /* --------- Optional features introduced in 2.7.0 --------- */
+
+    /* Does the device have a device-specific way to confirm a 
+       new frame (for e.g. par(ask=TRUE))?
+       This should be NULL if it does not.
+       If it does, it returns TRUE if the device handled this, and
+       FALSE if it wants the engine to do so. 
+
+       There is an example in the windows() device.
+
+       Can be left unimplemented as NULL.
+    */
+#if R_USE_PROTOTYPES
+    Rboolean (*newFrameConfirm)(pDevDesc dd);
+#else
+    Rboolean (*newFrameConfirm)();
+#endif
+
+    /* Some devices can plot UTF-8 text directly without converting
+       to the native encoding, e.g. windows(), quartz() ....
+
+       If this flag is true, all text *not in the symbol font* is sent
+       in UTF8 to the textUTF8/strWidthUTF8 entry points.
+
+       If the flag is TRUE, the metricInfo entry point should
+       accept negative values for 'c' and treat them as indicating
+       Unicode points (as well as positive values in a MBCS locale).
+    */
+    Rboolean hasTextUTF8; /* and strWidthUTF8 */
+#if R_USE_PROTOTYPES
+    void (*textUTF8)(double x, double y, const char *str, double rot,
+		     double hadj, const pGEcontext gc, pDevDesc dd);
+    double (*strWidthUTF8)(const char *str, const pGEcontext gc, pDevDesc dd);
+#else
+    void (*textUTF8)();
+    double (*strWidthUTF8)();
+#endif
+    Rboolean wantSymbolUTF8;
+
+    /* Is rotated text good enough to be preferable to Hershey in
+       contour labels?  Old default was FALSE.
+    */
+    Rboolean useRotatedTextInContour;
+
+    /* --------- Post-2.7.0 features --------- */
+
+    /* Added in 2.12.0:  Changed graphics event handling. */
+    
+    SEXP eventEnv;   /* This is an environment holding event handlers. */
+    /*
+     * eventHelper(dd, 1) is called by do_getGraphicsEvent before looking for a 
+     * graphics event.  It will then call R_ProcessEvents() and eventHelper(dd, 2)
+     * until this or another device returns sets a non-null result value in eventEnv,
+     * at which time eventHelper(dd, 0) will be called.
+     * 
+     * An example is ...
+     *
+     * static SEXP GA_eventHelper(pDevDesc dd, int code);
+
+     * Can be left unimplemented as NULL
+     */
+#if R_USE_PROTOTYPES
+    void (*eventHelper)(pDevDesc dd, int code);
+#else
+    void (*eventHelper)();
+#endif
+
+    /* added in 2.14.0, only used by screen devices.
+
+       Allows graphics devices to have multiple levels of suspension: 
+       when this reaches zero output is flushed.
+
+       Can be left unimplemented as NULL.
+     */
+#if R_USE_PROTOTYPES
+    int (*holdflush)(pDevDesc dd, int level);
+#else
+    int (*holdflush)();
+#endif
+
+    /* added in 2.14.0, for dev.capabilities.
+       In all cases 0 means NA (unset).
+    */
+    int haveTransparency; /* 1 = no, 2 = yes */
+    int haveTransparentBg; /* 1 = no, 2 = fully, 3 = semi */
+    int haveRaster; /* 1 = no, 2 = yes, 3 = except for missing values */
+    int haveCapture, haveLocator;  /* 1 = no, 2 = yes */
+
+
+    /* Area for future expansion.
+       By zeroing this, devices are more likely to work if loaded
+       into a later version of R than that they were compiled under.
+    */
+    char reserved[64];
+};
+
+
+	/********************************************************/
+	/* the device-driver entry point is given a device	*/
+	/* description structure that it must set up.  this	*/
+	/* involves several important jobs ...			*/
+	/* (1) it must ALLOCATE a new device-specific parameters*/
+	/* structure and FREE that structure if anything goes	*/
+	/* wrong (i.e., it won't report a successful setup to	*/
+	/* the graphics engine (the graphics engine is NOT	*/
+	/* responsible for allocating or freeing device-specific*/
+	/* resources or parameters)				*/
+	/* (2) it must initialise the device-specific resources */
+	/* and parameters (mostly done by calling device_Open)	*/
+	/* (3) it must initialise the generic graphical		*/
+	/* parameters that are not initialised by GInit (because*/
+	/* only the device knows what values they should have)	*/
+	/* see Graphics.h for the official list of these	*/
+	/* (4) it may reset generic graphics parameters that	*/
+	/* have already been initialised by GInit (although you	*/
+	/* should know what you are doing if you do this)	*/
+	/* (5) it must attach the device-specific parameters	*/
+	/* structure to the device description structure	*/
+	/* e.g., dd->deviceSpecfic = (void *) xd;		*/
+	/* (6) it must FREE the overall device description if	*/
+	/* it wants to bail out to the top-level		*/
+	/* the graphics engine is responsible for allocating	*/
+	/* the device description and freeing it in most cases	*/
+	/* but if the device driver freaks out it needs to do	*/
+	/* the clean-up itself					*/
+	/********************************************************/
+
+/* moved from Rgraphics.h */
+
+/*
+ *	Some Notes on Color
+ *
+ *	R uses a 24-bit color model.  Colors are specified in 32-bit
+ *	integers which are partitioned into 4 bytes as follows.
+ *
+ *		<-- most sig	    least sig -->
+ *		+-------------------------------+
+ *		|   0	| blue	| green |  red	|
+ *		+-------------------------------+
+ *
+ *	The red, green and blue bytes can be extracted as follows.
+ *
+ *		red   = ((color	     ) & 255)
+ *		green = ((color >>  8) & 255)
+ *		blue  = ((color >> 16) & 255)
+ */
+/*
+ *	Changes as from 1.4.0: use top 8 bits as an alpha channel.
+ * 	0 = opaque, 255 = transparent.
+ */
+/*
+ * Changes as from 2.0.0:  use top 8 bits as full alpha channel
+ *      255 = opaque, 0 = transparent
+ *      [to conform with SVG, PDF and others]
+ *      and everything in between is used
+ *      [which means that NA is not stored as an internal colour;
+ *       it is converted to R_RGBA(255, 255, 255, 0)]
+ */
+
+#define R_RGB(r,g,b)	((r)|((g)<<8)|((b)<<16)|0xFF000000)
+#define R_RGBA(r,g,b,a)	((r)|((g)<<8)|((b)<<16)|((a)<<24))
+#define R_RED(col)	(((col)	   )&255)
+#define R_GREEN(col)	(((col)>> 8)&255)
+#define R_BLUE(col)	(((col)>>16)&255)
+#define R_ALPHA(col)	(((col)>>24)&255)
+#define R_OPAQUE(col)	(R_ALPHA(col) == 255)
+#define R_TRANSPARENT(col) (R_ALPHA(col) == 0)
+    /*
+     * A transparent white
+     */
+#define R_TRANWHITE     (R_RGBA(255, 255, 255, 0))
+
+
+/* used in various devices */
+
+#define curDevice		Rf_curDevice
+#define killDevice		Rf_killDevice
+#define ndevNumber		Rf_ndevNumber
+#define NewFrameConfirm		Rf_NewFrameConfirm
+#define nextDevice		Rf_nextDevice
+#define NoDevices		Rf_NoDevices
+#define NumDevices		Rf_NumDevices
+#define prevDevice		Rf_prevDevice
+#define selectDevice		Rf_selectDevice
+#define AdobeSymbol2utf8	Rf_AdobeSymbol2utf8
+
+/* Properly declared version of devNumber */
+int ndevNumber(pDevDesc );
+
+/* Formerly in Rdevices.h */
+
+/* How many devices exist ? (>= 1) */
+int NumDevices(void);
+
+/* Check for an available device slot */
+void R_CheckDeviceAvailable(void);
+Rboolean R_CheckDeviceAvailableBool(void);
+
+/* Return the number of the current device. */
+int curDevice(void);
+
+/* Return the number of the next device. */
+int nextDevice(int);
+
+/* Return the number of the previous device. */
+int prevDevice(int);
+
+/* Make the specified device (specified by number) the current device */
+int selectDevice(int);
+
+/* Kill device which is identified by number. */
+void killDevice(int);
+
+int NoDevices(void); /* used in engine, graphics, plot, grid */
+
+void NewFrameConfirm(pDevDesc); /* used in graphics.c, grid */
+
+
+/* Graphics events: defined in gevents.c */
+
+/* These give the indices of some known keys */
+
+typedef enum {knUNKNOWN = -1,
+              knLEFT = 0, knUP, knRIGHT, knDOWN,
+              knF1, knF2, knF3, knF4, knF5, knF6, knF7, knF8, knF9, knF10,
+              knF11, knF12,
+              knPGUP, knPGDN, knEND, knHOME, knINS, knDEL} R_KeyName;
+
+/* These are the three possible mouse events */
+
+typedef enum {meMouseDown = 0,
+	      meMouseUp,
+	      meMouseMove} R_MouseEvent;
+
+#define leftButton   1
+#define middleButton 2
+#define rightButton  4
+
+#define doKeybd			Rf_doKeybd
+#define doMouseEvent		Rf_doMouseEvent
+
+void doMouseEvent(pDevDesc dd, R_MouseEvent event,
+                  int buttons, double x, double y);
+void doKeybd(pDevDesc dd, R_KeyName rkey,
+	     const char *keyname);
+
+
+/* For use in third-party devices when setting up a device:
+ * duplicates Defn.h which is used internally.
+ * (Tested in devNull.c)
+ */
+
+#ifndef BEGIN_SUSPEND_INTERRUPTS
+/* Macros for suspending interrupts */
+#define BEGIN_SUSPEND_INTERRUPTS do { \
+    Rboolean __oldsusp__ = R_interrupts_suspended; \
+    R_interrupts_suspended = TRUE;
+#define END_SUSPEND_INTERRUPTS R_interrupts_suspended = __oldsusp__; \
+    if (R_interrupts_pending && ! R_interrupts_suspended) \
+        Rf_onintr(); \
+} while(0)
+    
+#include <R_ext/libextern.h>
+LibExtern Rboolean R_interrupts_suspended;    
+LibExtern int R_interrupts_pending;
+extern void Rf_onintr(void);
+LibExtern Rboolean mbcslocale;
+#endif
+
+/* Useful for devices: translates Adobe symbol encoding to UTF-8 */
+extern void *AdobeSymbol2utf8(char*out, const char *in, int nwork);
+/* Translates Unicode point to UTF-8 */
+extern size_t Rf_ucstoutf8(char *s, const unsigned int c);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* R_GRAPHICSDEVICE_ */
diff --git a/sourcecodes/localscore/GraphicsEngine.h b/sourcecodes/localscore/GraphicsEngine.h
new file mode 100644
index 00000000..8d4a8748
--- /dev/null
+++ b/sourcecodes/localscore/GraphicsEngine.h
@@ -0,0 +1,514 @@
+/*
+ *  R : A Computer Language for Statistical Data Analysis
+ *  Copyright (C) 2001-11 The R Core Team.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation; either version 2.1 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this program; if not, a copy is available at
+ *  http://www.r-project.org/Licenses/
+ */
+
+/* Used by graphics.c, grid and by third-party graphics devices */
+
+#ifndef R_GRAPHICSENGINE_H_
+#define R_GRAPHICSENGINE_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * The current graphics engine (including graphics device) API version
+ * MUST be integer
+ *
+ * This number should be bumped whenever there are changes to
+ * GraphicsEngine.h or GraphicsDevice.h so that add-on packages
+ * that compile against these headers (graphics systems such as
+ * graphics and grid;  graphics devices such as gtkDevice, RSvgDevice)
+ * can detect any version mismatch.
+ *
+ * Version 1:  Introduction of the version number.
+ * Version 2:  GEDevDesc *dd dropped from GEcontourLines().
+ * Version 3:  R_GE_str2col() added to API. (r41887)
+ * Version 4:  UTF-8 text hooks, useRotatedTextInContour,
+ *             add newFrameConfirm() to NewDevDesc.
+ *             New API: GEaddDevice[2] GEgetDevice, GEkillDevice,
+ *             ndevNumber. (R 2.7.0)
+ * Version 5:  Clean up 1.4.0/2.0.0 changes!
+ *             Remove newDevStruct from GEDevDesc and NewDevDesc.
+ *             Remove asp, dot(), hold(), open() from NewDevDesc.
+ *             Move displayList, DLlastElt, savedSnapshot from
+ *             NewDevDesc to GEDevDesc.
+ *             Add 'ask' to GEDevDesc. (R 2.8.0)
+ * Version 6:  Add dev_Raster() and dev_Cap()  (R 2.11.0)
+ * Version 7:  Change graphics event handling, adding eventEnv and eventHelper()
+ *	       to DevDesc.  (R 2.12.0)
+ * Version 8:  Add dev_Path() (R 2.12.0)
+ * Version 9:  Add dev_HoldFlush(), haveTrans*, haveRaster,
+ *             haveCapture, haveLocator.  (R 2.14.0)
+ */
+
+#define R_GE_version 9
+
+int R_GE_getVersion(void);
+
+void R_GE_checkVersionOrDie(int version);
+
+/* The graphics engine will only accept locations and dimensions
+ * in native device coordinates, but it provides the following functions
+ * for converting between a couple of simple alternative coordinate
+ * systems and device coordinates:
+ *    DEVICE = native units of the device
+ *    NDC = Normalised device coordinates
+ *    INCHES = inches (!)
+ *    CM = centimetres (!!)
+ */
+
+typedef enum {
+ GE_DEVICE	= 0,	/* native device coordinates (rasters) */
+ GE_NDC	= 1,	/* normalised device coordinates x=(0,1), y=(0,1) */
+ GE_INCHES = 2,
+ GE_CM     = 3
+} GEUnit;
+
+#define MAX_GRAPHICS_SYSTEMS 24
+
+typedef enum {
+    /* In response to this event, the registered graphics system
+     * should allocate and initialise the systemSpecific structure
+     *
+     * Should return R_NilValue on failure so that engine
+     * can tidy up memory allocation
+     */
+    GE_InitState = 0,
+    /* This event gives the registered system a chance to undo
+     * anything done in the initialisation.
+     */
+    GE_FinaliseState = 1,
+    /* This is sent by the graphics engine prior to initialising
+     * the display list.  It give the graphics system the chance
+     * to squirrel away information it will need for redrawing the
+     * the display list
+     */
+    GE_SaveState = 2,
+    /* This is sent by the graphics engine prior to replaying the
+     * display list.  It gives the graphics system the chance to
+     * restore any information it saved on the GE_SaveState event
+     */
+    GE_RestoreState = 6,
+    /* Copy system state information to the current device.
+     * This is used when copying graphics from one device to another
+     * so all the graphics system needs to do is to copy across
+     * the bits required for the display list to draw faithfully
+     * on the new device.
+     */
+    GE_CopyState = 3,
+    /* Create a snapshot of the system state that is sufficient
+     * for the current "image" to be reproduced
+     */
+    GE_SaveSnapshotState = 4,
+    /* Restore the system state that is saved by GE_SaveSnapshotState
+     */
+    GE_RestoreSnapshotState = 5,
+    /* When replaying the display list, the graphics engine
+     * checks, after each replayed action, that the action
+     * produced valid output.  This is the graphics system's
+     * chance to say that the output is crap (in which case the
+     * graphics engine will abort the display list replay).
+     */
+    GE_CheckPlot = 7,
+    /* The device wants to scale the current pointsize
+     * (for scaling an image)
+     * This is not a nice general solution, but a quick fix for
+     * the Windows device.
+     */
+    GE_ScalePS = 8
+} GEevent;
+
+/*
+ *  Some line end/join constants
+ */
+typedef enum {
+  GE_ROUND_CAP  = 1,
+  GE_BUTT_CAP   = 2,
+  GE_SQUARE_CAP = 3
+} R_GE_lineend;
+
+typedef enum {
+  GE_ROUND_JOIN = 1,
+  GE_MITRE_JOIN = 2,
+  GE_BEVEL_JOIN = 3
+} R_GE_linejoin;
+
+/*
+ * A structure containing graphical parameters
+ *
+ * This is how graphical parameters are passed from graphics systems
+ * to the graphics engine AND from the graphics engine to graphics
+ * devices.
+ *
+ * Devices are not *required* to honour graphical parameters
+ * (e.g., alpha transparency is going to be tough for some)
+ */
+typedef struct {
+    /*
+     * Colours
+     *
+     * NOTE:  Alpha transparency included in col & fill
+     */
+    int col;             /* pen colour (lines, text, borders, ...) */
+    int fill;            /* fill colour (for polygons, circles, rects, ...) */
+    double gamma;        /* Gamma correction */
+    /*
+     * Line characteristics
+     */
+    double lwd;          /* Line width (roughly number of pixels) */
+    int lty;             /* Line type (solid, dashed, dotted, ...) */
+    R_GE_lineend lend;   /* Line end */
+    R_GE_linejoin ljoin; /* line join */
+    double lmitre;       /* line mitre */
+    /*
+     * Text characteristics
+     */
+    double cex;          /* Character expansion (font size = fontsize*cex) */
+    double ps;           /* Font size in points */
+    double lineheight;   /* Line height (multiply by font size) */
+    int fontface;        /* Font face (plain, italic, bold, ...) */
+    char fontfamily[201]; /* Font family */
+} R_GE_gcontext;
+
+typedef R_GE_gcontext* pGEcontext;
+
+
+#include <R_ext/GraphicsDevice.h> /* needed for DevDesc */
+
+typedef struct _GEDevDesc GEDevDesc;
+
+typedef SEXP (* GEcallback)(GEevent, GEDevDesc *, SEXP);
+
+typedef struct {
+    /* An array of information about each graphics system that
+     * has registered with the graphics engine.
+     * This is used to store graphics state for each graphics
+     * system on each device.
+     */
+    void *systemSpecific;
+    /*
+     * An array of function pointers, one per graphics system that
+     * has registered with the graphics engine.
+     *
+     * system_Callback is called when the graphics engine wants
+     * to give a graphics system the chance to play with its
+     * device-specific information (stored in systemSpecific)
+     * There are two parameters:  an "event" to tell the graphics
+     * system why the graphics engine has called this function,
+     * and the systemSpecific pointer.  The graphics engine
+     * has to pass the systemSpecific pointer because only
+     * the graphics engine will know what array index to use.
+     */
+    GEcallback callback;
+} GESystemDesc;
+
+struct _GEDevDesc {
+    /*
+     * Stuff that the devices can see (and modify).
+     * All detailed in GraphicsDevice.h
+     */
+    pDevDesc dev;
+    /*
+     * Stuff about the device that only the graphics engine sees
+     * (the devices don't see it).
+     */
+    Rboolean displayListOn;  /* toggle for display list status */
+    SEXP displayList;        /* display list */
+    SEXP DLlastElt;          /* A pointer to the end of the display list
+				to avoid tranversing pairlists */
+    SEXP savedSnapshot;      /* The last element of the display list
+			      * just prior to when the display list
+			      * was last initialised
+			      */
+    Rboolean dirty;          /* Has the device received any output? */
+    Rboolean recordGraphics; /* Should a graphics call be stored
+			      * on the display list?
+			      * Set to FALSE by do_recordGraphics,
+			      * do_dotcallgr, and do_Externalgr
+			      * so that nested calls are not
+			      * recorded on the display list
+			      */
+    /*
+     * Stuff about the device that only graphics systems see.
+     * The graphics engine has no idea what is in here.
+     * Used by graphics systems to store system state per device.
+     */
+    GESystemDesc *gesd[MAX_GRAPHICS_SYSTEMS];
+
+    /* per-device setting for 'ask' (use NewFrameConfirm) */
+    Rboolean ask;
+};
+
+typedef GEDevDesc* pGEDevDesc;
+
+/* functions from devices.c for use by graphics devices */
+
+#define desc2GEDesc		Rf_desc2GEDesc
+/* map DevDesc to enclosing GEDevDesc */
+pGEDevDesc desc2GEDesc(pDevDesc dd);
+int GEdeviceNumber(pGEDevDesc);
+pGEDevDesc GEgetDevice(int);
+void GEaddDevice(pGEDevDesc);
+void GEaddDevice2(pGEDevDesc, const char *);
+void GEkillDevice(pGEDevDesc);
+pGEDevDesc GEcreateDevDesc(pDevDesc dev);
+
+void GEdestroyDevDesc(pGEDevDesc dd);
+void *GEsystemState(pGEDevDesc dd, int index);
+void GEregisterWithDevice(pGEDevDesc dd);
+void GEregisterSystem(GEcallback callback, int *systemRegisterIndex);
+void GEunregisterSystem(int registerIndex);
+SEXP GEhandleEvent(GEevent event, pDevDesc dev, SEXP data);
+
+#define fromDeviceX		GEfromDeviceX
+#define toDeviceX		GEtoDeviceX
+#define fromDeviceY		GEfromDeviceY
+#define toDeviceY		GEtoDeviceY
+#define fromDeviceWidth		GEfromDeviceWidth
+#define toDeviceWidth		GEtoDeviceWidth
+#define fromDeviceHeight	GEfromDeviceHeight
+#define toDeviceHeight		GEtoDeviceHeight
+
+double fromDeviceX(double value, GEUnit to, pGEDevDesc dd);
+double toDeviceX(double value, GEUnit from, pGEDevDesc dd);
+double fromDeviceY(double value, GEUnit to, pGEDevDesc dd);
+double toDeviceY(double value, GEUnit from, pGEDevDesc dd);
+double fromDeviceWidth(double value, GEUnit to, pGEDevDesc dd);
+double toDeviceWidth(double value, GEUnit from, pGEDevDesc dd);
+double fromDeviceHeight(double value, GEUnit to, pGEDevDesc dd);
+double toDeviceHeight(double value, GEUnit from, pGEDevDesc dd);
+
+/*-------------------------------------------------------------------
+ *
+ *  COLOUR CODE is concerned with the internals of R colour representation
+ *
+ *  From colors.c, used in par.c, grid/src/gpar.c
+ */
+
+#define RGBpar			Rf_RGBpar
+#define RGBpar3			Rf_RGBpar3
+#define col2name                Rf_col2name
+#define name2col		Rf_name2col
+
+/* Convert an element of a R colour specification (which might be a
+   number or a string) into an internal colour specification. */
+unsigned int RGBpar(SEXP, int);
+unsigned int RGBpar3(SEXP, int, unsigned int);
+
+/* Convert an internal colour specification to/from a colour name */
+const char *col2name(unsigned int col); /* used in par.c, grid */
+unsigned int name2col(const char *);    /* used by plotmath.c */
+
+/* Convert either a name or a #RRGGBB[AA] string to internal.
+   Because people were using it, it also converts "1", "2" ...
+   to a colour in the palette, and "0" to transparent white.
+*/
+unsigned int R_GE_str2col(const char *s);
+
+
+
+/*
+ *	Some Notes on Line Textures
+ *
+ *	Line textures are stored as an array of 4-bit integers within
+ *	a single 32-bit word.  These integers contain the lengths of
+ *	lines to be drawn with the pen alternately down and then up.
+ *	The device should try to arrange that these values are measured
+ *	in points if possible, although pixels is ok on most displays.
+ *
+ *	If newlty contains a line texture description it is decoded
+ *	as follows:
+ *
+ *		ndash = 0;
+ *		for(i=0 ; i<8 && newlty & 15 ; i++) {
+ *			dashlist[ndash++] = newlty & 15;
+ *			newlty = newlty>>4;
+ *		}
+ *		dashlist[0] = length of pen-down segment
+ *		dashlist[1] = length of pen-up segment
+ *		etc
+ *
+ *	An integer containing a zero terminates the pattern.  Hence
+ *	ndash in this code fragment gives the length of the texture
+ *	description.  If a description contains an odd number of
+ *	elements it is replicated to create a pattern with an
+ *	even number of elements.  (If this is a pain, do something
+ *	different its not crucial).
+ *
+ */
+
+/*--- The basic numbered & names line types; Here device-independent:
+  e.g. "dashed" == "44",  "dotdash" == "1343"
+*/
+
+/* NB: was also in Rgraphics.h in R < 2.7.0 */
+#define LTY_BLANK	-1
+#define LTY_SOLID	0
+#define LTY_DASHED	4 + (4<<4)
+#define LTY_DOTTED	1 + (3<<4)
+#define LTY_DOTDASH	1 + (3<<4) + (4<<8) + (3<<12)
+#define LTY_LONGDASH	7 + (3<<4)
+#define LTY_TWODASH	2 + (2<<4) + (6<<8) + (2<<12)
+
+R_GE_lineend GE_LENDpar(SEXP value, int ind);
+SEXP GE_LENDget(R_GE_lineend lend);
+R_GE_linejoin GE_LJOINpar(SEXP value, int ind);
+SEXP GE_LJOINget(R_GE_linejoin ljoin);
+
+void GESetClip(double x1, double y1, double x2, double y2, pGEDevDesc dd);
+void GENewPage(const pGEcontext gc, pGEDevDesc dd);
+void GELine(double x1, double y1, double x2, double y2,
+	    const pGEcontext gc, pGEDevDesc dd);
+void GEPolyline(int n, double *x, double *y,
+		const pGEcontext gc, pGEDevDesc dd);
+void GEPolygon(int n, double *x, double *y,
+	       const pGEcontext gc, pGEDevDesc dd);
+SEXP GEXspline(int n, double *x, double *y, double *s, Rboolean open,
+	       Rboolean repEnds, Rboolean draw,
+	       const pGEcontext gc, pGEDevDesc dd);
+void GECircle(double x, double y, double radius,
+	      const pGEcontext gc, pGEDevDesc dd);
+void GERect(double x0, double y0, double x1, double y1,
+	    const pGEcontext gc, pGEDevDesc dd);
+void GEPath(double *x, double *y,
+            int npoly, int *nper,
+            Rboolean winding,
+            const pGEcontext gc, pGEDevDesc dd);
+void GERaster(unsigned int *raster, int w, int h,
+              double x, double y, double width, double height,
+              double angle, Rboolean interpolate,
+              const pGEcontext gc, pGEDevDesc dd);
+SEXP GECap(pGEDevDesc dd);
+void GEText(double x, double y, const char * const str, cetype_t enc,
+	    double xc, double yc, double rot,
+	    const pGEcontext gc, pGEDevDesc dd);
+void GEMode(int mode, pGEDevDesc dd);
+void GESymbol(double x, double y, int pch, double size,
+	      const pGEcontext gc, pGEDevDesc dd);
+void GEPretty(double *lo, double *up, int *ndiv);
+void GEMetricInfo(int c, const pGEcontext gc,
+		  double *ascent, double *descent, double *width,
+		  pGEDevDesc dd);
+double GEStrWidth(const char *str, cetype_t enc,
+		  const pGEcontext gc, pGEDevDesc dd);
+double GEStrHeight(const char *str, cetype_t enc,
+		  const pGEcontext gc, pGEDevDesc dd);
+void GEStrMetric(const char *str, cetype_t enc, const pGEcontext gc,
+                 double *ascent, double *descent, double *width,
+                 pGEDevDesc dd);
+int GEstring_to_pch(SEXP pch);
+
+/*-------------------------------------------------------------------
+ *
+ *  LINE TEXTURE CODE is concerned with the internals of R
+ *  line texture representation.
+ */
+unsigned int GE_LTYpar(SEXP, int);
+SEXP GE_LTYget(unsigned int);
+
+/*
+ * Raster operations
+ */
+void R_GE_rasterScale(unsigned int *sraster, int sw, int sh,
+                      unsigned int *draster, int dw, int dh);
+void R_GE_rasterInterpolate(unsigned int *sraster, int sw, int sh,
+                            unsigned int *draster, int dw, int dh);
+void R_GE_rasterRotatedSize(int w, int h, double angle,
+                            int *wnew, int *hnew);
+void R_GE_rasterRotatedOffset(int w, int h, double angle, int botleft,
+                              double *xoff, double *yoff);
+void R_GE_rasterResizeForRotation(unsigned int *sraster,
+                                  int w, int h,
+                                  unsigned int *newRaster,
+                                  int wnew, int hnew,
+                                  const pGEcontext gc);
+void R_GE_rasterRotate(unsigned int *sraster, int w, int h, double angle,
+                       unsigned int *draster, const pGEcontext gc,
+                       Rboolean perPixelAlpha);
+
+
+/*
+ * From plotmath.c
+ */
+double GEExpressionWidth(SEXP expr,
+			 const pGEcontext gc, pGEDevDesc dd);
+double GEExpressionHeight(SEXP expr,
+			  const pGEcontext gc, pGEDevDesc dd);
+void GEExpressionMetric(SEXP expr, const pGEcontext gc,
+                        double *ascent, double *descent, double *width,
+                        pGEDevDesc dd);
+void GEMathText(double x, double y, SEXP expr,
+		double xc, double yc, double rot,
+		const pGEcontext gc, pGEDevDesc dd);
+/*
+ * (End from plotmath.c)
+ */
+
+/*
+ * From plot3d.c : used in package clines
+ */
+SEXP GEcontourLines(double *x, int nx, double *y, int ny,
+		    double *z, double *levels, int nl);
+/*
+ * (End from plot3d.c)
+ */
+
+/*
+ * From vfonts.c
+ */
+double R_GE_VStrWidth(const char *s, cetype_t enc, const pGEcontext gc, pGEDevDesc dd);
+
+double R_GE_VStrHeight(const char *s, cetype_t enc, const pGEcontext gc, pGEDevDesc dd);
+void R_GE_VText(double x, double y, const char * const s, cetype_t enc,
+		double x_justify, double y_justify, double rotation,
+		const pGEcontext gc, pGEDevDesc dd);
+/*
+ * (End from vfonts.c)
+ */
+
+/* Also in Graphics.h */
+#define	DEG2RAD 0.01745329251994329576
+
+pGEDevDesc GEcurrentDevice(void);
+Rboolean GEdeviceDirty(pGEDevDesc dd);
+void GEdirtyDevice(pGEDevDesc dd);
+Rboolean GEcheckState(pGEDevDesc dd);
+Rboolean GErecording(SEXP call, pGEDevDesc dd);
+void GErecordGraphicOperation(SEXP op, SEXP args, pGEDevDesc dd);
+void GEinitDisplayList(pGEDevDesc dd);
+void GEplayDisplayList(pGEDevDesc dd);
+void GEcopyDisplayList(int fromDevice);
+SEXP GEcreateSnapshot(pGEDevDesc dd);
+void GEplaySnapshot(SEXP snapshot, pGEDevDesc dd);
+void GEonExit(void);
+void GEnullDevice(void);
+
+
+/* From ../../main/plot.c, used by ../../library/grid/src/grid.c */
+#define CreateAtVector		Rf_CreateAtVector
+SEXP CreateAtVector(double*, double*, int, Rboolean);
+/* From ../../main/graphics.c, used by ../../library/grDevices/src/axis_scales.c */
+#define GAxisPars 		Rf_GAxisPars
+void GAxisPars(double *min, double *max, int *n, Rboolean log, int axis);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* R_GRAPHICSENGINE_ */
diff --git a/sourcecodes/localscore/Lapack.h b/sourcecodes/localscore/Lapack.h
new file mode 100644
index 00000000..ad044ef7
--- /dev/null
+++ b/sourcecodes/localscore/Lapack.h
@@ -0,0 +1,3072 @@
+/*
+ *  R : A Computer Language for Statistical Data Analysis
+ *  Copyright (C) 2003-12 The R Core Team.
+ *  Copyright (C) 2008   The R Foundation
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation; either version 2.1 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this program; if not, a copy is available at
+ *  http://www.r-project.org/Licenses/
+ */
+
+/* 
+   C declarations of LAPACK Fortran subroutines included in R.
+   Just those used (currently or previously) by C routines in R itself.
+
+   Part of the API.
+
+   R packages that use these should have PKG_LIBS in src/Makevars include 
+   $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
+ */
+
+
+#ifndef R_LAPACK_H
+#define R_LAPACK_H
+
+#include <R_ext/RS.h>		/* for F77_... */
+#include <R_ext/Complex.h>	/* for Rcomplex */
+#include <R_ext/BLAS.h>
+
+/*
+  LAPACK function names are [dz]<name>(), where d denotes the real
+  version of the function, z the complex version.  (Only
+  double-precision versions are used in R.)
+*/
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+
+// Never defined by R itself.
+#ifndef La_extern
+#define La_extern extern
+#endif
+
+/* Utilities for Lapack-using packages : */
+
+/* matrix norms: converting typstr[]  to one of {'M', 'O', 'I', 'F'}
+ * or signal error(): */
+La_extern char La_norm_type(const char *typstr);
+
+/* matrix (reciprocal) condition numbers: convert typstr[]  to 'O'(ne) or 'I'(nf)
+ * or signal error(): */
+La_extern char La_rcond_type(const char *typstr);
+
+
+
+/* Selected Double Precision Lapack Routines
+   ========
+ */
+
+/* Double precision BiDiagonal matrices */
+
+/* DBDSQR - compute the singular value decomposition (SVD) of a real */
+/* N-by-N (upper or lower) bidiagonal matrix B */
+La_extern void
+F77_NAME(dbdsqr)(const char* uplo, const int* n, const int* ncvt,
+		 const int* nru, const int* ncc, double* d, double* e,
+		 double* vt, const int* ldvt, double* u, const int* ldu,
+		 double* c, const int* ldc, double* work, int* info);
+/* DDISNA - compute the reciprocal condition numbers for the */
+/* eigenvectors of a real symmetric or complex Hermitian matrix or */
+/* for the left or right singular vectors of a general m-by-n */
+/* matrix */
+La_extern void
+F77_NAME(ddisna)(const char* job, const int* m, const int* n,
+		 double* d, double* sep, int* info);
+
+/* Double precision General Banded matrices */
+
+/* DGBBRD - reduce a real general m-by-n band matrix A to upper */
+/* bidiagonal form B by an orthogonal transformation  */
+La_extern void
+F77_NAME(dgbbrd)(const char* vect, const int* m, const int* n,
+		 const int* ncc, const int* kl, const int* ku,
+		 double* ab, const int* ldab,
+		 double* d, double* e, double* q,
+		 const int* ldq, double* pt, const int* ldpt,
+		 double* c, const int* ldc,
+		 double* work, int* info);
+/* DGBCON - estimate the reciprocal of the condition number of a */
+/* real general band matrix A, in either the 1-norm or the */
+/* infinity-norm */
+La_extern void
+F77_NAME(dgbcon)(const char* norm, const int* n, const int* kl,
+		 const int* ku, double* ab, const int* ldab,
+		 int* ipiv, const double* anorm, double* rcond,
+		 double* work, int* iwork, int* info);
+/* DGBEQU - compute row and column scalings intended to equilibrate */
+/* an M-by-N band matrix A and reduce its condition number */
+La_extern void
+F77_NAME(dgbequ)(const int* m, const int* n, const int* kl, const int* ku,
+		 double* ab, const int* ldab, double* r, double* c,
+		 double* rowcnd, double* colcnd, double* amax, int* info);
+/* DGBRFS - improve the computed solution to a system of linear */
+/* equations when the coefficient matrix is banded, and provides */
+/* error bounds and backward error estimates for the solution */
+La_extern void
+F77_NAME(dgbrfs)(const char* trans, const int* n, const int* kl,
+		 const int* ku, const int* nrhs, double* ab,
+		 const int* ldab, double* afb, const int* ldafb,
+		 int* ipiv, double* b, const int* ldb,
+		 double* x, const int* ldx, double* ferr, double* berr,
+		 double* work, int* iwork, int* info);
+/* DGBSV - compute the solution to a real system of linear */
+/* equations A * X = B, where A is a band matrix of order N with */
+/* KL subdiagonals and KU superdiagonals, and X and B are */
+/* N-by-NRHS matrices */
+La_extern void
+F77_NAME(dgbsv)(const int* n, const int* kl,const int* ku,
+		const int* nrhs, double* ab, const int* ldab,
+		int* ipiv, double* b, const int* ldb, int* info);
+/* DGBSVX - use the LU factorization to compute the solution to a */
+/* real system of linear equations A * X = B or A**T * X = B */
+La_extern void
+F77_NAME(dgbsvx)(const int* fact, const char* trans,
+		 const int* n, const int* kl,const int* ku,
+		 const int* nrhs, double* ab, const int* ldab,
+		 double* afb, const int* ldafb, int* ipiv,
+		 const char* equed, double* r, double* c,
+		 double* b, const int* ldb,
+		 double* x, const int* ldx,
+		 double* rcond, double* ferr, double* berr,
+		 double* work, int* iwork, int* info);
+/* DGBTF2 - compute an LU factorization of a real m-by-n band */
+/* matrix A using partial pivoting with row interchanges */
+La_extern void
+F77_NAME(dgbtf2)(const int* m, const int* n, const int* kl,const int* ku,
+		 double* ab, const int* ldab, int* ipiv, int* info);
+/* DGBTRF - compute an LU factorization of a real m-by-n band */
+/* matrix A using partial pivoting with row interchanges */
+La_extern void
+F77_NAME(dgbtrf)(const int* m, const int* n, const int* kl,const int* ku,
+		  double* ab, const int* ldab, int* ipiv, int* info);
+/* DGBTRS - solve a system of linear equations	A * X = B or  */
+/* A' * X = B with a general band matrix A using the LU */
+/* factorization computed by DGBTRF */
+La_extern void
+F77_NAME(dgbtrs)(const char* trans, const int* n,
+		 const int* kl, const int* ku, const int* nrhs,
+		 const double* ab, const int* ldab, const int* ipiv,
+		 double* b, const int* ldb, int* info);
+
+/* Double precision GEneral matrices */
+
+/* DGEBAK - form the right or left eigenvectors of a real general */
+/* matrix by backward transformation on the computed eigenvectors */
+/* of the balanced matrix output by DGEBAL  */
+La_extern void
+F77_NAME(dgebak)(const char* job, const char* side, const int* n,
+		 const int* ilo, const int* ihi, double* scale,
+		 const int* m, double* v, const int* ldv, int* info);
+/* DGEBAL - balance a general real matrix A */
+La_extern void
+F77_NAME(dgebal)(const char* job, const int* n, double* a, const int* lda,
+		  int* ilo, int* ihi, double* scale, int* info);
+/* DGEBD2 - reduce a real general m by n matrix A to upper or */
+/* lower bidiagonal form B by an orthogonal transformation */
+La_extern void
+F77_NAME(dgebd2)(const int* m, const int* n, double* a, const int* lda,
+		 double* d, double* e, double* tauq, double* taup,
+		 double* work, int* info);
+/* DGEBRD - reduce a general real M-by-N matrix A to upper or */
+/* lower bidiagonal form B by an orthogonal transformation */
+La_extern void
+F77_NAME(dgebrd)(const int* m, const int* n, double* a, const int* lda,
+		 double* d, double* e, double* tauq, double* taup,
+		 double* work, const int* lwork, int* info);
+/* DGECON - estimate the reciprocal of the condition number of a */
+/* general real matrix A, in either the 1-norm or the */
+/* infinity-norm, using the LU factorization computed by DGETRF */
+La_extern void
+F77_NAME(dgecon)(const char* norm, const int* n,
+		 const double* a, const int* lda,
+		 const double* anorm, double* rcond,
+		 double* work, int* iwork, int* info);
+/* DGEEQU - compute row and column scalings intended to equilibrate */
+/* an M-by-N matrix A and reduce its condition number */
+La_extern void
+F77_NAME(dgeequ)(const int* m, const int* n, double* a, const int* lda,
+		 double* r, double* c, double* rowcnd, double* colcnd,
+		 double* amax, int* info);
+/* DGEES - compute for an N-by-N real nonsymmetric matrix A, the */
+/* eigenvalues, the real Schur form T, and, optionally, the matrix */
+/* of Schur vectors Z */
+La_extern void
+F77_NAME(dgees)(const char* jobvs, const char* sort,
+		int (*select)(const double*, const double*),
+		const int* n, double* a, const int* lda,
+		int* sdim, double* wr, double* wi,
+		double* vs, const int* ldvs,
+		double* work, const int* lwork, int* bwork, int* info);
+/* DGEESX - compute for an N-by-N real nonsymmetric matrix A, the */
+/* eigenvalues, the real Schur form T, and, optionally, the matrix */
+/* of Schur vectors Z */
+La_extern void
+F77_NAME(dgeesx)(const char* jobvs, const char* sort,
+		 int (*select)(const double*, const double*),
+		 const char* sense, const int* n, double* a,
+		 const int* lda, int* sdim, double* wr, double* wi,
+		 double* vs, const int* ldvs, double* rconde,
+		 double* rcondv, double* work, const int* lwork,
+		 int* iwork, const int* liwork, int* bwork, int* info);
+/* DGEEV - compute for an N-by-N real nonsymmetric matrix A, the */
+/* eigenvalues and, optionally, the left and/or right eigenvectors */
+La_extern void
+F77_NAME(dgeev)(const char* jobvl, const char* jobvr,
+		const int* n, double* a, const int* lda,
+		double* wr, double* wi, double* vl, const int* ldvl,
+		double* vr, const int* ldvr,
+		double* work, const int* lwork, int* info);
+/* DGEEVX - compute for an N-by-N real nonsymmetric matrix A, the */
+/* eigenvalues and, optionally, the left and/or right eigenvectors */
+La_extern void
+F77_NAME(dgeevx)(const char* balanc, const char* jobvl, const char* jobvr,
+		 const char* sense, const int* n, double* a, const int* lda,
+		 double* wr, double* wi, double* vl, const int* ldvl,
+		 double* vr, const int* ldvr, int* ilo, int* ihi,
+		 double* scale, double* abnrm, double* rconde, double* rcondv,
+		 double* work, const int* lwork, int* iwork, int* info);
+/* DGEGV - compute for a pair of n-by-n real nonsymmetric */
+/* matrices A and B, the generalized eigenvalues (alphar +/- */
+/* alphai*i, beta);, and optionally, the left and/or right */
+/* generalized eigenvectors (VL and VR); */
+La_extern void
+F77_NAME(dgegv)(const char* jobvl, const char* jobvr,
+		const int* n, double* a, const int* lda,
+		double* b, const int* ldb,
+		double* alphar, double* alphai,
+		const double* beta, double* vl, const int* ldvl,
+		double* vr, const int* ldvr,
+		double* work, const int* lwork, int* info);
+/* DGEHD2 - reduce a real general matrix A to upper Hessenberg */
+/* form H by an orthogonal similarity transformation */
+La_extern void
+F77_NAME(dgehd2)(const int* n, const int* ilo, const int* ihi,
+		 double* a, const int* lda, double* tau,
+		 double* work, int* info);
+/* DGEHRD - reduce a real general matrix A to upper Hessenberg */
+/* form H by an orthogonal similarity transformation */
+La_extern void
+F77_NAME(dgehrd)(const int* n, const int* ilo, const int* ihi,
+		 double* a, const int* lda, double* tau,
+		 double* work, const int* lwork, int* info);
+/* DGELQ2 - compute an LQ factorization of a real m by n matrix A */
+La_extern void
+F77_NAME(dgelq2)(const int* m, const int* n,
+		 double* a, const int* lda, double* tau,
+		 double* work, int* info);
+/* DGELQF - compute an LQ factorization of a real M-by-N matrix A */
+La_extern void
+F77_NAME(dgelqf)(const int* m, const int* n,
+		 double* a, const int* lda, double* tau,
+		 double* work, const int* lwork, int* info);
+/* DGELS - solve overdetermined or underdetermined real linear */
+/* systems involving an M-by-N matrix A, or its transpose, using a */
+/* QR or LQ factorization of A */
+La_extern void
+F77_NAME(dgels)(const char* trans, const int* m, const int* n,
+		const int* nrhs, double* a, const int* lda,
+		double* b, const int* ldb,
+		double* work, const int* lwork, int* info);
+/* DGELSS - compute the minimum norm solution to a real linear */
+/* least squares problem */
+La_extern void
+F77_NAME(dgelss)(const int* m, const int* n, const int* nrhs,
+		 double* a, const int* lda, double* b, const int* ldb,
+		 double* s, double* rcond, int* rank,
+		 double* work, const int* lwork, int* info);
+/* DGELSY - compute the minimum-norm solution to a real linear */
+/* least squares problem */
+La_extern void
+F77_NAME(dgelsy)(const int* m, const int* n, const int* nrhs,
+		 double* a, const int* lda, double* b, const int* ldb,
+		 int* jpvt, const double* rcond, int* rank,
+		 double* work, const int* lwork, int* info);
+/* DGEQL2 - compute a QL factorization of a real m by n matrix A */
+La_extern void
+F77_NAME(dgeql2)(const int* m, const int* n, double* a, const int* lda,
+		 double* tau, double* work, int* info);
+/* DGEQLF - compute a QL factorization of a real M-by-N matrix A */
+La_extern void
+F77_NAME(dgeqlf)(const int* m, const int* n,
+		 double* a, const int* lda, double* tau,
+		 double* work, const int* lwork, int* info);
+/* DGEQP3 - compute a QR factorization with column pivoting of a */
+/* real M-by-N matrix A using level 3 BLAS */
+La_extern void
+F77_NAME(dgeqp3)(const int* m, const int* n, double* a, const int* lda,
+		 int* jpvt, double* tau, double* work, const int* lwork,
+		 int* info);
+/* DGEQPF - compute a QR factorization with column pivoting of a */
+/* real M-by-N matrix A */
+La_extern void
+F77_NAME(dgeqpf)(const int* m, const int* n, double* a, const int* lda,
+		 int* jpvt, double* tau, double* work, int* info);
+/* DGEQR2 - compute a QR factorization of a real m by n matrix A */
+La_extern void
+F77_NAME(dgeqr2)(const int* m, const int* n, double* a, const int* lda,
+		 double* tau, double* work, int* info);
+/* DGEQRF - compute a QR factorization of a real M-by-N matrix A */
+La_extern void
+F77_NAME(dgeqrf)(const int* m, const int* n, double* a, const int* lda,
+		 double* tau, double* work, const int* lwork, int* info);
+/* DGERFS - improve the computed solution to a system of linear */
+/* equations and provides error bounds and backward error */
+/* estimates for the solution */
+La_extern void
+F77_NAME(dgerfs)(const char* trans, const int* n, const int* nrhs,
+		 double* a, const int* lda, double* af, const int* ldaf,
+		 int* ipiv, double* b, const int* ldb,
+		 double* x, const int* ldx, double* ferr, double* berr,
+		 double* work, int* iwork, int* info);
+/* DGERQ2 - compute an RQ factorization of a real m by n matrix A */
+La_extern void
+F77_NAME(dgerq2)(const int* m, const int* n, double* a, const int* lda,
+		 double* tau, double* work, int* info);
+/* DGERQF - compute an RQ factorization of a real M-by-N matrix A */
+La_extern void
+F77_NAME(dgerqf)(const int* m, const int* n, double* a, const int* lda,
+		 double* tau, double* work, const int* lwork, int* info);
+/* DGESV - compute the solution to a real system of linear */
+/* equations  A * X = B, */
+La_extern void
+F77_NAME(dgesv)(const int* n, const int* nrhs, double* a, const int* lda,
+		int* ipiv, double* b, const int* ldb, int* info);
+/* DGESVD - compute the singular value decomposition (SVD); of a */
+/* real M-by-N matrix A, optionally computing the left and/or */
+/* right singular vectors */
+La_extern void
+F77_NAME(dgesvd)(const char* jobu, const char* jobvt, const int* m,
+		 const int* n, double* a, const int* lda, double* s,
+		 double* u, const int* ldu, double* vt, const int* ldvt,
+		 double* work, const int* lwork, int* info);
+/* DGESVX - use the LU factorization to compute the solution to a */
+/* real system of linear equations  A * X = B, */
+La_extern void
+F77_NAME(dgesvx)(const int* fact, const char* trans, const int* n,
+		 const int* nrhs, double* a, const int* lda,
+		 double* af, const int* ldaf, int* ipiv,
+		 char *equed, double* r, double* c,
+		 double* b, const int* ldb,
+		 double* x, const int* ldx,
+		 double* rcond, double* ferr, double* berr,
+		 double* work, int* iwork, int* info);
+/* DGETF2 - compute an LU factorization of a general m-by-n */
+/* matrix A using partial pivoting with row interchanges */
+La_extern void
+F77_NAME(dgetf2)(const int* m, const int* n, double* a, const int* lda,
+		 int* ipiv, int* info);
+/* DGETRF - compute an LU factorization of a general M-by-N */
+/* matrix A using partial pivoting with row interchanges */
+La_extern void
+F77_NAME(dgetrf)(const int* m, const int* n, double* a, const int* lda,
+		 int* ipiv, int* info);
+/* DGETRI - compute the inverse of a matrix using the LU */
+/* factorization computed by DGETRF */
+La_extern void
+F77_NAME(dgetri)(const int* n, double* a, const int* lda,
+		 int* ipiv, double* work, const int* lwork, int* info);
+/* DGETRS - solve a system of linear equations	A * X = B or A' * */
+/* X = B with a general N-by-N matrix A using the LU factorization */
+/* computed by DGETRF */
+La_extern void
+F77_NAME(dgetrs)(const char* trans, const int* n, const int* nrhs,
+		 const double* a, const int* lda, const int* ipiv,
+		 double* b, const int* ldb, int* info);
+
+/* Double precision General matrices Generalized problems */
+
+/* DGGBAK - form the right or left eigenvectors of a real */
+/* generalized eigenvalue problem A*x = lambda*B*x, by backward */
+/* transformation on the computed eigenvectors of the balanced */
+/* pair of matrices output by DGGBAL */
+La_extern void
+F77_NAME(dggbak)(const char* job, const char* side,
+		 const int* n, const int* ilo, const int* ihi,
+		 double* lscale, double* rscale, const int* m,
+		 double* v, const int* ldv, int* info);
+/* DGGBAL - balance a pair of general real matrices (A,B); */
+La_extern void
+F77_NAME(dggbal)(const char* job, const int* n, double* a, const int* lda,
+		 double* b, const int* ldb, int* ilo, int* ihi,
+		 double* lscale, double* rscale, double* work, int* info);
+/* DGGES - compute for a pair of N-by-N real nonsymmetric */
+/* matrices A, B the generalized eigenvalues, the generalized */
+/* real Schur form (S,T), optionally, the left and/or right matrices */
+/* of Schur vectors (VSL and VSR)*/
+La_extern void
+F77_NAME(dgges)(const char* jobvsl, const char* jobvsr, const char* sort,
+		int (*delztg)(double*, double*, double*),
+		const int* n, double* a, const int* lda,
+		double* b, const int* ldb, double* alphar,
+		double* alphai, const double* beta,
+		double* vsl, const int* ldvsl,
+		double* vsr, const int* ldvsr,
+		double* work, const int* lwork, int* bwork, int* info);
+
+/* DGGGLM - solve a general Gauss-Markov linear model (GLM) problem */
+La_extern void
+F77_NAME(dggglm)(const int* n, const int* m, const int* p,
+		 double* a, const int* lda, double* b, const int* ldb,
+		 double* d, double* x, double* y,
+		 double* work, const int* lwork, int* info);
+/* DGGHRD - reduce a pair of real matrices (A,B); to generalized */
+/* upper Hessenberg form using orthogonal transformations, where A */
+/* is a general matrix and B is upper triangular */
+La_extern void
+F77_NAME(dgghrd)(const char* compq, const char* compz, const int* n,
+		 const int* ilo, const int* ihi, double* a, const int* lda,
+		 double* b, const int* ldb, double* q, const int* ldq,
+		 double* z, const int* ldz, int* info);
+/* DGGLSE - solve the linear equality-constrained least squares */
+/* (LSE) problem */
+La_extern void
+F77_NAME(dgglse)(const int* m, const int* n, const int* p,
+		 double* a, const int* lda,
+		 double* b, const int* ldb,
+		 double* c, double* d, double* x,
+		 double* work, const int* lwork, int* info);
+/* DGGQRF - compute a generalized QR factorization of an N-by-M */
+/* matrix A and an N-by-P matrix B */
+La_extern void
+F77_NAME(dggqrf)(const int* n, const int* m, const int* p,
+		 double* a, const int* lda, double* taua,
+		 double* b, const int* ldb, double* taub,
+		 double* work, const int* lwork, int* info);
+/* DGGRQF - compute a generalized RQ factorization of an M-by-N */
+/* matrix A and a P-by-N matrix B */
+La_extern void
+F77_NAME(dggrqf)(const int* m, const int* p, const int* n,
+		 double* a, const int* lda, double* taua,
+		 double* b, const int* ldb, double* taub,
+		 double* work, const int* lwork, int* info);
+/* DGGSVD - compute the generalized singular value decomposition */
+/* (GSVD) of an M-by-N real matrix A and P-by-N real matrix B */
+La_extern void
+F77_NAME(dggsvd)(const char* jobu, const char* jobv, const char* jobq,
+		 const int* m, const int* n, const int* p,
+		 const int* k, const int* l,
+		 double* a, const int* lda,
+		 double* b, const int* ldb,
+		 const double* alpha, const double* beta,
+		 double* u, const int* ldu,
+		 double* v, const int* ldv,
+		 double* q, const int* ldq,
+		 double* work, int* iwork, int* info);
+
+/* Double precision General Tridiagonal matrices */
+
+/* DGTCON - estimate the reciprocal of the condition number of a real */
+/* tridiagonal matrix A using the LU factorization as computed by DGTTRF */
+La_extern void
+F77_NAME(dgtcon)(const char* norm, const int* n, double* dl, double* d,
+		 double* du, double* du2, int* ipiv, const double* anorm,
+		 double* rcond, double* work, int* iwork, int* info);
+/* DGTRFS - improve the computed solution to a system of linear equations */
+/* when the coefficient matrix is tridiagonal, and provides error bounds */
+/* and backward error estimates for the solution */
+La_extern void
+F77_NAME(dgtrfs)(const char* trans, const int* n, const int* nrhs,
+		 double* dl, double* d, double* du, double* dlf,
+		 double* df, double* duf, double* du2,
+		 int* ipiv, double* b, const int* ldb,
+		 double* x, const int* ldx,
+		 double* ferr, double* berr,
+		 double* work, int* iwork, int* info);
+/* DGTSV - solve the equation	A*X = B, */
+La_extern void
+F77_NAME(dgtsv)(const int* n, const int* nrhs,
+		double* dl, double* d, double* du,
+		double* b, const int* ldb, int* info);
+/* DGTSVX - use the LU factorization to compute the solution to a */
+/* real system of linear equations A * X = B or A**T * X = B, */
+La_extern void
+F77_NAME(dgtsvx)(const int* fact, const char* trans,
+		 const int* n, const int* nrhs,
+		 double* dl, double* d, double* du,
+		 double* dlf, double* df, double* duf,
+		 double* du2, int* ipiv,
+		 double* b, const int* ldb,
+		 double* x, const int* ldx,
+		 double* rcond, double* ferr, double* berr,
+		 double* work, int* iwork, int* info);
+/* DGTTRF - compute an LU factorization of a real tridiagonal matrix */
+/* A using elimination with partial pivoting and row interchanges */
+La_extern void
+F77_NAME(dgttrf)(const int* n, double* dl, double* d,
+		 double* du, double* du2, int* ipiv, int* info);
+/* DGTTRS - solve one of the systems of equations  A*X = B or */
+/* A'*X = B, */
+La_extern void
+F77_NAME(dgttrs)(const char* trans, const int* n, const int* nrhs,
+		 double* dl, double* d, double* du, double* du2,
+		 int* ipiv, double* b, const int* ldb, int* info);
+
+/* Double precision Orthogonal matrices */
+
+/* DOPGTR - generate a real orthogonal matrix Q which is defined */
+/* as the product of n-1 elementary reflectors H(i); of order n, */
+/* as returned by DSPTRD using packed storage */
+La_extern void
+F77_NAME(dopgtr)(const char* uplo, const int* n,
+		 const double* ap, const double* tau,
+		 double* q, const int* ldq,
+		 double* work, int* info);
+/* DOPMTR - overwrite the general real M-by-N matrix C with */
+/* SIDE = 'L' SIDE = 'R' TRANS = 'N' */
+La_extern void
+F77_NAME(dopmtr)(const char* side, const char* uplo,
+		 const char* trans, const int* m, const int* n,
+		 const double* ap, const double* tau,
+		 double* c, const int* ldc,
+		 double* work, int* info);
+/* DORG2L - generate an m by n real matrix Q with orthonormal */
+/* columns, */
+La_extern void
+F77_NAME(dorg2l)(const int* m, const int* n, const int* k,
+		 double* a, const int* lda,
+		 const double* tau, double* work, int* info);
+/* DORG2R - generate an m by n real matrix Q with orthonormal */
+/* columns, */
+La_extern void
+F77_NAME(dorg2r)(const int* m, const int* n, const int* k,
+		 double* a, const int* lda,
+		 const double* tau, double* work, int* info);
+/* DORGBR - generate one of the real orthogonal matrices Q or */
+/* P**T determined by DGEBRD when reducing a real matrix A to */
+/* bidiagonal form */
+La_extern void
+F77_NAME(dorgbr)(const char* vect, const int* m,
+		 const int* n, const int* k,
+		 double* a, const int* lda,
+		 const double* tau, double* work,
+		 const int* lwork, int* info);
+/* DORGHR - generate a real orthogonal matrix Q which is defined */
+/* as the product of IHI-ILO elementary reflectors of order N, as */
+/* returned by DGEHRD */
+La_extern void
+F77_NAME(dorghr)(const int* n, const int* ilo, const int* ihi,
+		 double* a, const int* lda, const double* tau,
+		 double* work, const int* lwork, int* info);
+/* DORGL2 - generate an m by n real matrix Q with orthonormal */
+/* rows, */
+La_extern void
+F77_NAME(dorgl2)(const int* m, const int* n, const int* k,
+		 double* a, const int* lda, const double* tau,
+		 double* work, int* info);
+/* DORGLQ - generate an M-by-N real matrix Q with orthonormal */
+/* rows, */
+La_extern void
+F77_NAME(dorglq)(const int* m, const int* n, const int* k,
+		 double* a, const int* lda,
+		 const double* tau, double* work,
+		 const int* lwork, int* info);
+/* DORGQL - generate an M-by-N real matrix Q with orthonormal */
+/* columns, */
+La_extern void
+F77_NAME(dorgql)(const int* m, const int* n, const int* k,
+		 double* a, const int* lda,
+		 const double* tau, double* work,
+		 const int* lwork, int* info);
+/* DORGQR - generate an M-by-N real matrix Q with orthonormal */
+/* columns, */
+La_extern void
+F77_NAME(dorgqr)(const int* m, const int* n, const int* k,
+		 double* a, const int* lda, const double* tau,
+		 double* work, const int* lwork, int* info);
+/* DORGR2 - generate an m by n real matrix Q with orthonormal */
+/* rows, */
+La_extern void
+F77_NAME(dorgr2)(const int* m, const int* n, const int* k,
+		 double* a, const int* lda, const double* tau,
+		 double* work, int* info);
+/* DORGRQ - generate an M-by-N real matrix Q with orthonormal rows */
+La_extern void
+F77_NAME(dorgrq)(const int* m, const int* n, const int* k,
+		 double* a, const int* lda, const double* tau,
+		 double* work, const int* lwork, int* info);
+/* DORGTR - generate a real orthogonal matrix Q which is defined */
+/* as the product of n-1 elementary reflectors of order const int* n, as */
+/* returned by DSYTRD */
+La_extern void
+F77_NAME(dorgtr)(const char* uplo, const int* n,
+		 double* a, const int* lda, const double* tau,
+		 double* work, const int* lwork, int* info);
+/* DORM2L - overwrite the general real m by n matrix C with   Q * */
+/* C if SIDE = 'L' and TRANS = 'N', or	 Q'* C if SIDE = 'L' and */
+/* TRANS = 'T', or   C * Q if SIDE = 'R' and TRANS = 'N', or   C * */
+/* Q' if SIDE = 'R' and TRANS = 'T', */
+La_extern void
+F77_NAME(dorm2l)(const char* side, const char* trans,
+		 const int* m, const int* n, const int* k,
+		 const double* a, const int* lda,
+		 const double* tau, double* c, const int* ldc,
+		 double* work, int* info);
+/* DORM2R - overwrite the general real m by n matrix C with   Q * C */
+/* if SIDE = 'L' and TRANS = 'N', or   Q'* C if SIDE = 'L' and */
+/* TRANS = 'T', or   C * Q if SIDE = 'R' and TRANS = 'N', or   C * */
+/* Q' if SIDE = 'R' and TRANS = 'T', */
+La_extern void
+F77_NAME(dorm2r)(const char* side, const char* trans,
+		 const int* m, const int* n, const int* k,
+		 const double* a, const int* lda, const double* tau,
+		 double* c, const int* ldc, double* work, int* info);
+/* DORMBR - VECT = 'Q', DORMBR overwrites the general real M-by-N */
+/* matrix C with  SIDE = 'L' SIDE = 'R' TRANS = 'N' */
+La_extern void
+F77_NAME(dormbr)(const char* vect, const char* side, const char* trans,
+		 const int* m, const int* n, const int* k,
+		 const double* a, const int* lda, const double* tau,
+		 double* c, const int* ldc,
+		 double* work, const int* lwork, int* info);
+/* DORMHR - overwrite the general real M-by-N matrix C with */
+/* SIDE = 'L' SIDE = 'R' TRANS = 'N' */
+La_extern void
+F77_NAME(dormhr)(const char* side, const char* trans, const int* m,
+		 const int* n, const int* ilo, const int* ihi,
+		 const double* a, const int* lda, const double* tau,
+		 double* c, const int* ldc,
+		 double* work, const int* lwork, int* info);
+/* DORML2 - overwrite the general real m by n matrix C with   Q * */
+/* C if SIDE = 'L' and TRANS = 'N', or	 Q'* C if SIDE = 'L' and */
+/* TRANS = 'T', or   C * Q if SIDE = 'R' and TRANS = 'N', or   C * */
+/* Q' if SIDE = 'R' and TRANS = 'T', */
+La_extern void
+F77_NAME(dorml2)(const char* side, const char* trans,
+		 const int* m, const int* n, const int* k,
+		 const double* a, const int* lda, const double* tau,
+		 double* c, const int* ldc, double* work, int* info);
+/* DORMLQ - overwrite the general real M-by-N matrix C with */
+/* SIDE = 'L' SIDE = 'R' TRANS = 'N'  */
+La_extern void
+F77_NAME(dormlq)(const char* side, const char* trans,
+		 const int* m, const int* n, const int* k,
+		 const double* a, const int* lda,
+		 const double* tau, double* c, const int* ldc,
+		 double* work, const int* lwork, int* info);
+/* DORMQL - overwrite the general real M-by-N matrix C with */
+/* SIDE = 'L' SIDE = 'R' TRANS = 'N' */
+La_extern void
+F77_NAME(dormql)(const char* side, const char* trans,
+		 const int* m, const int* n, const int* k,
+		 const double* a, const int* lda,
+		 const double* tau, double* c, const int* ldc,
+		 double* work, const int* lwork, int* info);
+/* DORMQR - overwrite the general real M-by-N matrix C with   SIDE = */
+/* 'L' SIDE = 'R' TRANS = 'N' */
+La_extern void
+F77_NAME(dormqr)(const char* side, const char* trans,
+		 const int* m, const int* n, const int* k,
+		 const double* a, const int* lda,
+		 const double* tau, double* c, const int* ldc,
+		 double* work, const int* lwork, int* info);
+/* DORMR2 - overwrite the general real m by n matrix C with   Q * */
+/* C if SIDE = 'L' and TRANS = 'N', or	 Q'* C if SIDE = 'L' and */
+/* TRANS = 'T', or   C * Q if SIDE = 'R' and TRANS = 'N', or   C * */
+/* Q' if SIDE = 'R' and TRANS = 'T', */
+La_extern void
+F77_NAME(dormr2)(const char* side, const char* trans,
+		 const int* m, const int* n, const int* k,
+		 const double* a, const int* lda,
+		 const double* tau, double* c, const int* ldc,
+		 double* work, int* info);
+/* DORMRQ - overwrite the general real M-by-N matrix C with */
+/* SIDE = 'L' SIDE = 'R' TRANS = 'N' */
+La_extern void
+F77_NAME(dormrq)(const char* side, const char* trans,
+		 const int* m, const int* n, const int* k,
+		 const double* a, const int* lda,
+		 const double* tau, double* c, const int* ldc,
+		 double* work, const int* lwork, int* info);
+/* DORMTR - overwrite the general real M-by-N matrix C with */
+/* SIDE = 'L' SIDE = 'R' TRANS = 'N' */
+La_extern void
+F77_NAME(dormtr)(const char* side, const char* uplo,
+		 const char* trans, const int* m, const int* n,
+		 const double* a, const int* lda,
+		 const double* tau, double* c, const int* ldc,
+		 double* work, const int* lwork, int* info);
+
+/* Double precision Positive definite Band matrices */
+
+/* DPBCON - estimate the reciprocal of the condition number (in */
+/* the 1-norm); of a real symmetric positive definite band matrix */
+/* using the Cholesky factorization A = U**T*U or A = L*L**T */
+/* computed by DPBTRF */
+La_extern void
+F77_NAME(dpbcon)(const char* uplo, const int* n, const int* kd,
+		 const double* ab, const int* ldab,
+		 const double* anorm, double* rcond,
+		 double* work, int* iwork, int* info);
+/* DPBEQU - compute row and column scalings intended to */
+/* equilibrate a symmetric positive definite band matrix A and */
+/* reduce its condition number (with respect to the two-norm); */
+La_extern void
+F77_NAME(dpbequ)(const char* uplo, const int* n, const int* kd,
+		 const double* ab, const int* ldab,
+		 double* s, double* scond, double* amax, int* info);
+/* DPBRFS - improve the computed solution to a system of linear */
+/* equations when the coefficient matrix is symmetric positive */
+/* definite and banded, and provides error bounds and backward */
+/* error estimates for the solution */
+La_extern void
+F77_NAME(dpbrfs)(const char* uplo, const int* n,
+		 const int* kd, const int* nrhs,
+		 const double* ab, const int* ldab,
+		 const double* afb, const int* ldafb,
+		 const double* b, const int* ldb,
+		 double* x, const int* ldx,
+		 double* ferr, double* berr,
+		 double* work, int* iwork, int* info);
+/* DPBSTF - compute a split Cholesky factorization of a real */
+/* symmetric positive definite band matrix A */
+La_extern void
+F77_NAME(dpbstf)(const char* uplo, const int* n, const int* kd,
+		 double* ab, const int* ldab, int* info);
+/* DPBSV - compute the solution to a real system of linear */
+/* equations  A * X = B, */
+La_extern void
+F77_NAME(dpbsv)(const char* uplo, const int* n,
+		const int* kd, const int* nrhs,
+		double* ab, const int* ldab,
+		double* b, const int* ldb, int* info);
+/* DPBSVX - use the Cholesky factorization A = U**T*U or A = */
+/* L*L**T to compute the solution to a real system of linear */
+/* equations  A * X = B, */
+La_extern void
+F77_NAME(dpbsvx)(const int* fact, const char* uplo, const int* n,
+		 const int* kd, const int* nrhs,
+		 double* ab, const int* ldab,
+		 double* afb, const int* ldafb,
+		 char* equed, double* s,
+		 double* b, const int* ldb,
+		 double* x, const int* ldx, double* rcond,
+		 double* ferr, double* berr,
+		 double* work, int* iwork, int* info);
+/* DPBTF2 - compute the Cholesky factorization of a real */
+/* symmetric positive definite band matrix A */
+La_extern void
+F77_NAME(dpbtf2)(const char* uplo, const int* n, const int* kd,
+		 double* ab, const int* ldab, int* info);
+/* DPBTRF - compute the Cholesky factorization of a real */
+/* symmetric positive definite band matrix A */
+La_extern void
+F77_NAME(dpbtrf)(const char* uplo, const int* n, const int* kd,
+		 double* ab, const int* ldab, int* info);
+/* DPBTRS - solve a system of linear equations A*X = B with a */
+/* symmetric positive definite band matrix A using the Cholesky */
+/* factorization A = U**T*U or A = L*L**T computed by DPBTRF */
+La_extern void
+F77_NAME(dpbtrs)(const char* uplo, const int* n,
+		 const int* kd, const int* nrhs,
+		 const double* ab, const int* ldab,
+		 double* b, const int* ldb, int* info);
+
+/* Double precision Positive definite matrices */
+
+/* DPOCON - estimate the reciprocal of the condition number (in */
+/* the 1-norm); of a real symmetric positive definite matrix using */
+/* the Cholesky factorization A = U**T*U or A = L*L**T computed by */
+/* DPOTRF */
+La_extern void
+F77_NAME(dpocon)(const char* uplo, const int* n,
+		 const double* a, const int* lda,
+		 const double* anorm, double* rcond,
+		 double* work, int* iwork, int* info);
+/* DPOEQU - compute row and column scalings intended to */
+/* equilibrate a symmetric positive definite matrix A and reduce */
+/* its condition number (with respect to the two-norm); */
+La_extern void
+F77_NAME(dpoequ)(const int* n, const double* a, const int* lda,
+		 double* s, double* scond, double* amax, int* info);
+/* DPORFS - improve the computed solution to a system of linear */
+/* equations when the coefficient matrix is symmetric positive */
+/* definite, */
+La_extern void
+F77_NAME(dporfs)(const char* uplo, const int* n, const int* nrhs,
+		 const double* a, const int* lda,
+		 const double* af, const int* ldaf,
+		 const double* b, const int* ldb,
+		 double* x, const int* ldx,
+		 double* ferr, double* berr,
+		 double* work, int* iwork, int* info);
+/* DPOSV - compute the solution to a real system of linear */
+/* equations  A * X = B, */
+La_extern void
+F77_NAME(dposv)(const char* uplo, const int* n, const int* nrhs,
+		double* a, const int* lda,
+		double* b, const int* ldb, int* info);
+/* DPOSVX - use the Cholesky factorization A = U**T*U or A = */
+/* L*L**T to compute the solution to a real system of linear */
+/* equations  A * X = B, */
+La_extern void
+F77_NAME(dposvx)(const int* fact, const char* uplo,
+		 const int* n, const int* nrhs,
+		 double* a, const int* lda,
+		 double* af, const int* ldaf, char* equed,
+		 double* s, double* b, const int* ldb,
+		 double* x, const int* ldx, double* rcond,
+		 double* ferr, double* berr, double* work,
+		 int* iwork, int* info);
+/* DPOTF2 - compute the Cholesky factorization of a real */
+/* symmetric positive definite matrix A */
+La_extern void
+F77_NAME(dpotf2)(const char* uplo, const int* n,
+		 double* a, const int* lda, int* info);
+/* DPOTRF - compute the Cholesky factorization of a real */
+/* symmetric positive definite matrix A */
+La_extern void
+F77_NAME(dpotrf)(const char* uplo, const int* n,
+		 double* a, const int* lda, int* info);
+/* DPOTRI - compute the inverse of a real symmetric positive */
+/* definite matrix A using the Cholesky factorization A = U**T*U */
+/* or A = L*L**T computed by DPOTRF */
+La_extern void
+F77_NAME(dpotri)(const char* uplo, const int* n,
+		 double* a, const int* lda, int* info);
+/* DPOTRS - solve a system of linear equations A*X = B with a */
+/* symmetric positive definite matrix A using the Cholesky */
+/* factorization A = U**T*U or A = L*L**T computed by DPOTRF */
+La_extern void
+F77_NAME(dpotrs)(const char* uplo, const int* n,
+		 const int* nrhs, const double* a, const int* lda,
+		 double* b, const int* ldb, int* info);
+/* DPPCON - estimate the reciprocal of the condition number (in */
+/* the 1-norm); of a real symmetric positive definite packed */
+/* matrix using the Cholesky factorization A = U**T*U or A = */
+/* L*L**T computed by DPPTRF */
+La_extern void
+F77_NAME(dppcon)(const char* uplo, const int* n,
+		 const double* ap, const double* anorm, double* rcond,
+		 double* work, int* iwork, int* info);
+/* DPPEQU - compute row and column scalings intended to */
+/* equilibrate a symmetric positive definite matrix A in packed */
+/* storage and reduce its condition number (with respect to the */
+/* two-norm); */
+La_extern void
+F77_NAME(dppequ)(const char* uplo, const int* n,
+		 const double* ap, double* s, double* scond,
+		 double* amax, int* info);
+
+/* Double precision Positive definite matrices in Packed storage */
+
+/* DPPRFS - improve the computed solution to a system of linear */
+/* equations when the coefficient matrix is symmetric positive */
+/* definite and packed, and provides error bounds and backward */
+/* error estimates for the solution */
+La_extern void
+F77_NAME(dpprfs)(const char* uplo, const int* n, const int* nrhs,
+		 const double* ap, const double* afp,
+		 const double* b, const int* ldb,
+		 double* x, const int* ldx,
+		 double* ferr, double* berr,
+		 double* work, int* iwork, int* info);
+/* DPPSV - compute the solution to a real system of linear */
+/* equations  A * X = B, */
+La_extern void
+F77_NAME(dppsv)(const char* uplo, const int* n,
+		const int* nrhs, const double* ap,
+		double* b, const int* ldb, int* info);
+/* DPPSVX - use the Cholesky factorization A = U**T*U or A = */
+/* L*L**T to compute the solution to a real system of linear */
+/* equations  A * X = B, */
+La_extern void
+F77_NAME(dppsvx)(const int* fact, const char* uplo,
+		 const int* n, const int* nrhs, double* ap,
+		 double* afp, char* equed, double* s,
+		 double* b, const int* ldb,
+		 double* x, const int* ldx,
+		 double* rcond, double* ferr, double* berr,
+		 double* work, int* iwork, int* info);
+/* DPPTRF - compute the Cholesky factorization of a real */
+/* symmetric positive definite matrix A stored in packed format */
+La_extern void
+F77_NAME(dpptrf)(const char* uplo, const int* n, double* ap, int* info);
+/* DPPTRI - compute the inverse of a real symmetric positive */
+/* definite matrix A using the Cholesky factorization A = U**T*U */
+/* or A = L*L**T computed by DPPTRF  */
+La_extern void
+F77_NAME(dpptri)(const char* uplo, const int* n, double* ap, int* info);
+/* DPPTRS - solve a system of linear equations A*X = B with a */
+/* symmetric positive definite matrix A in packed storage using */
+/* the Cholesky factorization A = U**T*U or A = L*L**T computed by */
+/* DPPTRF */
+La_extern void
+F77_NAME(dpptrs)(const char* uplo, const int* n,
+		 const int* nrhs, const double* ap,
+		 double* b, const int* ldb, int* info);
+
+/* Double precision symmetric Positive definite Tridiagonal matrices */
+
+/* DPTCON - compute the reciprocal of the condition number (in */
+/* the 1-norm); of a real symmetric positive definite tridiagonal */
+/* matrix using the factorization A = L*D*L**T or A = U**T*D*U */
+/* computed by DPTTRF */
+La_extern void
+F77_NAME(dptcon)(const int* n,
+		 const double* d, const double* e,
+		 const double* anorm, double* rcond,
+		 double* work, int* info);
+/* DPTEQR - compute all eigenvalues and, optionally, eigenvectors */
+/* of a symmetric positive definite tridiagonal matrix by first */
+/* factoring the matrix using DPTTRF, and then calling DBDSQR to */
+/* compute the singular values of the bidiagonal factor */
+La_extern void
+F77_NAME(dpteqr)(const char* compz, const int* n, double* d,
+		 double* e, double* z, const int* ldz,
+		 double* work, int* info);
+/* DPTRFS - improve the computed solution to a system of linear */
+/* equations when the coefficient matrix is symmetric positive */
+/* definite and tridiagonal, and provides error bounds and */
+/* backward error estimates for the solution */
+La_extern void
+F77_NAME(dptrfs)(const int* n, const int* nrhs,
+		 const double* d, const double* e,
+		 const double* df, const double* ef,
+		 const double* b, const int* ldb,
+		 double* x, const int* ldx,
+		 double* ferr, double* berr,
+		 double* work, int* info);
+/* DPTSV - compute the solution to a real system of linear */
+/* equations A*X = B, where A is an N-by-N symmetric positive */
+/* definite tridiagonal matrix, and X and B are N-by-NRHS matrices */
+La_extern void
+F77_NAME(dptsv)(const int* n, const int* nrhs, double* d,
+		double* e, double* b, const int* ldb, int* info);
+/* DPTSVX - use the factorization A = L*D*L**T to compute the */
+/* solution to a real system of linear equations A*X = B, where A */
+/* is an N-by-N symmetric positive definite tridiagonal matrix and */
+/* X and B are N-by-NRHS matrices */
+La_extern void
+F77_NAME(dptsvx)(const int* fact, const int* n,
+		 const int* nrhs,
+		 const double* d, const double* e,
+		 double* df, double* ef,
+		 const double* b, const int* ldb,
+		 double* x, const int* ldx, double* rcond,
+		 double* ferr, double* berr,
+		 double* work, int* info);
+/* DPTTRF - compute the factorization of a real symmetric */
+/* positive definite tridiagonal matrix A */
+La_extern void
+F77_NAME(dpttrf)(const int* n, double* d, double* e, int* info);
+/* DPTTRS - solve a system of linear equations A * X = B with a */
+/* symmetric positive definite tridiagonal matrix A using the */
+/* factorization A = L*D*L**T or A = U**T*D*U computed by DPTTRF */
+La_extern void
+F77_NAME(dpttrs)(const int* n, const int* nrhs,
+		 const double* d, const double* e,
+		 double* b, const int* ldb, int* info);
+/* DRSCL - multiply an n-element real vector x by the real scalar */
+/* 1/a */
+La_extern void
+F77_NAME(drscl)(const int* n, const double* da,
+		double* x, const int* incx);
+
+/* Double precision Symmetric Band matrices */
+
+/* DSBEV - compute all the eigenvalues and, optionally, */
+/* eigenvectors of a real symmetric band matrix A */
+La_extern void
+F77_NAME(dsbev)(const char* jobz, const char* uplo,
+		const int* n, const int* kd,
+		double* ab, const int* ldab,
+		double* w, double* z, const int* ldz,
+		double* work, int* info);
+/* DSBEVD - compute all the eigenvalues and, optionally, */
+/* eigenvectors of a real symmetric band matrix A */
+La_extern void
+F77_NAME(dsbevd)(const char* jobz, const char* uplo,
+		 const int* n, const int* kd,
+		 double* ab, const int* ldab,
+		 double* w, double* z, const int* ldz,
+		 double* work, const int* lwork,
+		 int* iwork, const int* liwork, int* info);
+/* DSBEVX - compute selected eigenvalues and, optionally, */
+/* eigenvectors of a real symmetric band matrix A */
+La_extern void
+F77_NAME(dsbevx)(const char* jobz, const char* range,
+		 const char* uplo, const int* n, const int* kd,
+		 double* ab, const int* ldab,
+		 double* q, const int* ldq,
+		 const double* vl, const double* vu,
+		 const int* il, const int* iu,
+		 const double* abstol,
+		 int* m, double* w,
+		 double* z, const int* ldz,
+		 double* work, int* iwork,
+		 int* ifail, int* info);
+/* DSBGST - reduce a real symmetric-definite banded generalized */
+/* eigenproblem A*x = lambda*B*x to standard form C*y = lambda*y, */
+La_extern void
+F77_NAME(dsbgst)(const char* vect, const char* uplo,
+		 const int* n, const int* ka, const int* kb,
+		 double* ab, const int* ldab,
+		 double* bb, const int* ldbb,
+		 double* x, const int* ldx,
+		 double* work, int* info);
+/* DSBGV - compute all the eigenvalues, and optionally, the */
+/* eigenvectors of a real generalized symmetric-definite banded */
+/* eigenproblem, of the form A*x=(lambda);*B*x */
+La_extern void
+F77_NAME(dsbgv)(const char* jobz, const char* uplo,
+		const int* n, const int* ka, const int* kb,
+		double* ab, const int* ldab,
+		double* bb, const int* ldbb,
+		double* w, double* z, const int* ldz,
+		double* work, int* info);
+/* DSBTRD - reduce a real symmetric band matrix A to symmetric */
+/* tridiagonal form T by an orthogonal similarity transformation */
+La_extern void
+F77_NAME(dsbtrd)(const char* vect, const char* uplo,
+		 const int* n, const int* kd,
+		 double* ab, const int* ldab,
+		 double* d, double* e,
+		 double* q, const int* ldq,
+		 double* work, int* info);
+
+/* Double precision Symmetric Packed matrices */
+
+/* DSPCON - estimate the reciprocal of the condition number (in */
+/* the 1-norm); of a real symmetric packed matrix A using the */
+/* factorization A = U*D*U**T or A = L*D*L**T computed by DSPTRF */
+La_extern void
+F77_NAME(dspcon)(const char* uplo, const int* n,
+		 const double* ap, const int* ipiv,
+		 const double* anorm, double* rcond,
+		 double* work, int* iwork, int* info);
+/* DSPEV - compute all the eigenvalues and, optionally, */
+/* eigenvectors of a real symmetric matrix A in packed storage */
+La_extern void
+F77_NAME(dspev)(const char* jobz, const char* uplo, const int* n,
+		double* ap, double* w, double* z, const int* ldz,
+		double* work, int* info);
+/* DSPEVD - compute all the eigenvalues and, optionally, */
+/* eigenvectors of a real symmetric matrix A in packed storage */
+La_extern void
+F77_NAME(dspevd)(const char* jobz, const char* uplo,
+		 const int* n, double* ap, double* w,
+		 double* z, const int* ldz,
+		 double* work, const int* lwork,
+		 int* iwork, const int* liwork, int* info);
+/* DSPEVX - compute selected eigenvalues and, optionally, */
+/* eigenvectors of a real symmetric matrix A in packed storage */
+La_extern void
+F77_NAME(dspevx)(const char* jobz, const char* range,
+		 const char* uplo, const int* n, double* ap,
+		 const double* vl, const double* vu,
+		 const int* il, const int* iu,
+		 const double* abstol,
+		 int* m, double* w,
+		 double* z, const int* ldz,
+		 double* work, int* iwork,
+		 int* ifail, int* info);
+/* DSPGST - reduce a real symmetric-definite generalized */
+/* eigenproblem to standard form, using packed storage */
+La_extern void
+F77_NAME(dspgst)(const int* itype, const char* uplo,
+		 const int* n, double* ap, double* bp, int* info);
+/* DSPGV - compute all the eigenvalues and, optionally, the */
+/* eigenvectors of a real generalized symmetric-definite */
+/* eigenproblem, of the form A*x=(lambda)*B*x, A*Bx=(lambda)*x, */
+/* or B*A*x=(lambda)*x */
+La_extern void
+F77_NAME(dspgv)(const int* itype, const char* jobz,
+		const char* uplo, const int* n,
+		double* ap, double* bp, double* w,
+		double* z, const int* ldz,
+		double* work, int* info);
+
+/* DSPRFS - improve the computed solution to a system of linear */
+/* equations when the coefficient matrix is symmetric indefinite */
+/* and packed, and provides error bounds and backward error */
+/* estimates for the solution */
+La_extern void
+F77_NAME(dsprfs)(const char* uplo, const int* n,
+		 const int* nrhs, const double* ap,
+		 const double* afp, const int* ipiv,
+		 const double* b, const int* ldb,
+		 double* x, const int* ldx,
+		 double* ferr, double* berr,
+		 double* work, int* iwork, int* info);
+
+/* DSPSV - compute the solution to a real system of linear */
+/* equations  A * X = B, */
+La_extern void
+F77_NAME(dspsv)(const char* uplo, const int* n,
+		const int* nrhs, double* ap, int* ipiv,
+		double* b, const int* ldb, int* info);
+
+/* DSPSVX - use the diagonal pivoting factorization A = U*D*U**T */
+/* or A = L*D*L**T to compute the solution to a real system of */
+/* linear equations A * X = B, where A is an N-by-N symmetric */
+/* matrix stored in packed format and X and B are N-by-NRHS */
+/* matrices */
+La_extern void
+F77_NAME(dspsvx)(const int* fact, const char* uplo,
+		 const int* n, const int* nrhs,
+		 const double* ap, double* afp, int* ipiv,
+		 const double* b, const int* ldb,
+		 double* x, const int* ldx,
+		 double* rcond, double* ferr, double* berr,
+		 double* work, int* iwork, int* info);
+
+/* DSPTRD - reduce a real symmetric matrix A stored in packed */
+/* form to symmetric tridiagonal form T by an orthogonal */
+/* similarity transformation */
+La_extern void
+F77_NAME(dsptrd)(const char* uplo, const int* n,
+		 double* ap, double* d, double* e,
+		 double* tau, int* info);
+
+/* DSPTRF - compute the factorization of a real symmetric matrix */
+/* A stored in packed format using the Bunch-Kaufman diagonal */
+/* pivoting method */
+La_extern void
+F77_NAME(dsptrf)(const char* uplo, const int* n,
+		 double* ap, int* ipiv, int* info);
+
+/* DSPTRI - compute the inverse of a real symmetric indefinite */
+/* matrix A in packed storage using the factorization A = U*D*U**T */
+/* or A = L*D*L**T computed by DSPTRF */
+La_extern void
+F77_NAME(dsptri)(const char* uplo, const int* n,
+		 double* ap, const int* ipiv,
+		 double* work, int* info);
+
+/* DSPTRS - solve a system of linear equations A*X = B with a */
+/* real symmetric matrix A stored in packed format using the */
+/* factorization A = U*D*U**T or A = L*D*L**T computed by DSPTRF */
+La_extern void
+F77_NAME(dsptrs)(const char* uplo, const int* n,
+		 const int* nrhs, const double* ap,
+		 const int* ipiv, double* b, const int* ldb, int* info);
+
+/* Double precision Symmetric Tridiagonal matrices */
+
+/* DSTEBZ - compute the eigenvalues of a symmetric tridiagonal */
+/* matrix T */
+La_extern void
+F77_NAME(dstebz)(const char* range, const char* order, const int* n,
+		 const double* vl, const double* vu,
+		 const int* il, const int* iu,
+		 const double *abstol,
+		 const double* d, const double* e,
+		 int* m, int* nsplit, double* w,
+		 int* iblock, int* isplit,
+		 double* work, int* iwork,
+		 int* info);
+/* DSTEDC - compute all eigenvalues and, optionally, eigenvectors */
+/* of a symmetric tridiagonal matrix using the divide and conquer */
+/* method */
+La_extern void
+F77_NAME(dstedc)(const char* compz, const int* n,
+		 double* d, double* e,
+		 double* z, const int* ldz,
+		 double* work, const int* lwork,
+		 int* iwork, const int* liwork, int* info);
+/* DSTEIN - compute the eigenvectors of a real symmetric */
+/* tridiagonal matrix T corresponding to specified eigenvalues, */
+/* using inverse iteration */
+La_extern void
+F77_NAME(dstein)(const int* n, const double* d, const double* e,
+		 const int* m, const double* w,
+		 const int* iblock, const int* isplit,
+		 double* z, const int* ldz,
+		 double* work, int* iwork,
+		 int* ifail, int* info);
+/* DSTEQR - compute all eigenvalues and, optionally, eigenvectors */
+/* of a symmetric tridiagonal matrix using the implicit QL or QR */
+/* method */
+La_extern void
+F77_NAME(dsteqr)(const char* compz, const int* n, double* d, double* e,
+		 double* z, const int* ldz, double* work, int* info);
+/* DSTERF - compute all eigenvalues of a symmetric tridiagonal */
+/* matrix using the Pal-Walker-Kahan variant of the QL or QR */
+/* algorithm */
+La_extern void
+F77_NAME(dsterf)(const int* n, double* d, double* e, int* info);
+/* DSTEV - compute all eigenvalues and, optionally, eigenvectors */
+/* of a real symmetric tridiagonal matrix A */
+La_extern void
+F77_NAME(dstev)(const char* jobz, const int* n,
+		double* d, double* e,
+		double* z, const int* ldz,
+		double* work, int* info);
+/* DSTEVD - compute all eigenvalues and, optionally, eigenvectors */
+/* of a real symmetric tridiagonal matrix */
+La_extern void
+F77_NAME(dstevd)(const char* jobz, const int* n,
+		 double* d, double* e,
+		 double* z, const int* ldz,
+		 double* work, const int* lwork,
+		 int* iwork, const int* liwork, int* info);
+/* DSTEVX - compute selected eigenvalues and, optionally, */
+/* eigenvectors of a real symmetric tridiagonal matrix A */
+La_extern void
+F77_NAME(dstevx)(const char* jobz, const char* range,
+		 const int* n, double* d, double* e,
+		 const double* vl, const double* vu,
+		 const int* il, const int* iu,
+		 const double* abstol,
+		 int* m, double* w,
+		 double* z, const int* ldz,
+		 double* work, int* iwork,
+		 int* ifail, int* info);
+
+/* Double precision SYmmetric matrices */
+
+/* DSYCON - estimate the reciprocal of the condition number (in */
+/* the 1-norm); of a real symmetric matrix A using the */
+/* factorization A = U*D*U**T or A = L*D*L**T computed by DSYTRF */
+La_extern void
+F77_NAME(dsycon)(const char* uplo, const int* n,
+		 const double* a, const int* lda,
+		 const int* ipiv,
+		 const double* anorm, double* rcond,
+		 double* work, int* iwork, int* info);
+/* DSYEV - compute all eigenvalues and, optionally, eigenvectors */
+/* of a real symmetric matrix A */
+La_extern void
+F77_NAME(dsyev)(const char* jobz, const char* uplo,
+		const int* n, double* a, const int* lda,
+		double* w, double* work, const int* lwork, int* info);
+/* DSYEVD - compute all eigenvalues and, optionally, eigenvectors */
+/* of a real symmetric matrix A */
+La_extern void
+F77_NAME(dsyevd)(const char* jobz, const char* uplo,
+		 const int* n, double* a, const int* lda,
+		 double* w, double* work, const int* lwork,
+		 int* iwork, const int* liwork, int* info);
+/* DSYEVX - compute selected eigenvalues and, optionally, */
+/* eigenvectors of a real symmetric matrix A */
+La_extern void
+F77_NAME(dsyevx)(const char* jobz, const char* range,
+		 const char* uplo, const int* n,
+		 double* a, const int* lda,
+		 const double* vl, const double* vu,
+		 const int* il, const int* iu,
+		 const double* abstol,
+		 int* m, double* w,
+		 double* z, const int* ldz,
+		 double* work, const int* lwork, int* iwork,
+		 int* ifail, int* info);
+/* DSYEVR - compute all eigenvalues and, optionally, eigenvectors   */
+/* of a real symmetric matrix A					   */
+La_extern void
+F77_NAME(dsyevr)(const char *jobz, const char *range, const char *uplo,
+		 const int *n, double *a, const int *lda,
+		 const double *vl, const double *vu,
+		 const int *il, const int *iu,
+		 const double *abstol, int *m, double *w,
+		 double *z, const int *ldz, int *isuppz,
+		 double *work, const int *lwork,
+		 int *iwork, const int *liwork,
+		 int *info);
+/* DSYGS2 - reduce a real symmetric-definite generalized */
+/* eigenproblem to standard form */
+La_extern void
+F77_NAME(dsygs2)(const int* itype, const char* uplo,
+		 const int* n, double* a, const int* lda,
+		 const double* b, const int* ldb, int* info);
+/* DSYGST - reduce a real symmetric-definite generalized */
+/* eigenproblem to standard form */
+La_extern void
+F77_NAME(dsygst)(const int* itype, const char* uplo,
+		 const int* n, double* a, const int* lda,
+		 const double* b, const int* ldb, int* info);
+/* DSYGV - compute all the eigenvalues, and optionally, the */
+/* eigenvectors of a real generalized symmetric-definite */
+/* eigenproblem, of the form A*x=(lambda);*B*x, A*Bx=(lambda);*x, */
+/* or B*A*x=(lambda);*x */
+La_extern void
+F77_NAME(dsygv)(const int* itype, const char* jobz,
+		const char* uplo, const int* n,
+		double* a, const int* lda,
+		double* b, const int* ldb,
+		double* w, double* work, const int* lwork,
+		int* info);
+/* DSYRFS - improve the computed solution to a system of linear */
+/* equations when the coefficient matrix is symmetric indefinite, */
+/* and provides error bounds and backward error estimates for the */
+/* solution */
+La_extern void
+F77_NAME(dsyrfs)(const char* uplo, const int* n,
+		 const int* nrhs,
+		 const double* a, const int* lda,
+		 const double* af, const int* ldaf,
+		 const int* ipiv,
+		 const double* b, const int* ldb,
+		 double* x, const int* ldx,
+		 double* ferr, double* berr,
+		 double* work, int* iwork, int* info);
+
+/* DSYSV - compute the solution to a real system of linear */
+/* equations  A * X = B, */
+La_extern void
+F77_NAME(dsysv)(const char* uplo, const int* n,
+		const int* nrhs,
+		double* a, const int* lda, int* ipiv,
+		double* b, const int* ldb,
+		double* work, const int* lwork, int* info);
+
+/* DSYSVX - use the diagonal pivoting factorization to compute */
+/* the solution to a real system of linear equations A * X = B, */
+La_extern void
+F77_NAME(dsysvx)(const int* fact, const char* uplo,
+		 const int* n, const int* nrhs,
+		 const double* a, const int* lda,
+		 double* af, const int* ldaf, int* ipiv,
+		 const double* b, const int* ldb,
+		 double* x, const int* ldx, double* rcond,
+		 double* ferr, double* berr,
+		 double* work, const int* lwork,
+		 int* iwork, int* info);
+
+/* DSYTD2 - reduce a real symmetric matrix A to symmetric */
+/* tridiagonal form T by an orthogonal similarity transformation */
+La_extern void
+F77_NAME(dsytd2)(const char* uplo, const int* n,
+		 double* a, const int* lda,
+		 double* d, double* e, double* tau,
+		 int* info);
+
+/* DSYTF2 - compute the factorization of a real symmetric matrix */
+/* A using the Bunch-Kaufman diagonal pivoting method */
+La_extern void
+F77_NAME(dsytf2)(const char* uplo, const int* n,
+		 double* a, const int* lda,
+		 int* ipiv, int* info);
+
+/* DSYTRD - reduce a real symmetric matrix A to real symmetric */
+/* tridiagonal form T by an orthogonal similarity transformation */
+La_extern void
+F77_NAME(dsytrd)(const char* uplo, const int* n,
+		 double* a, const int* lda,
+		 double* d, double* e, double* tau,
+		 double* work, const int* lwork, int* info);
+
+/* DSYTRF - compute the factorization of a real symmetric matrix */
+/* A using the Bunch-Kaufman diagonal pivoting method */
+La_extern void
+F77_NAME(dsytrf)(const char* uplo, const int* n,
+		 double* a, const int* lda, int* ipiv,
+		 double* work, const int* lwork, int* info);
+
+/* DSYTRI - compute the inverse of a real symmetric indefinite */
+/* matrix A using the factorization A = U*D*U**T or A = L*D*L**T */
+/* computed by DSYTRF */
+La_extern void
+F77_NAME(dsytri)(const char* uplo, const int* n,
+		 double* a, const int* lda, const int* ipiv,
+		 double* work, int* info);
+
+/* DSYTRS - solve a system of linear equations A*X = B with a */
+/* real symmetric matrix A using the factorization A = U*D*U**T or */
+/* A = L*D*L**T computed by DSYTRF */
+La_extern void
+F77_NAME(dsytrs)(const char* uplo, const int* n,
+		 const int* nrhs,
+		 const double* a, const int* lda,
+		 const int* ipiv,
+		 double* b, const int* ldb, int* info);
+
+/* Double precision Triangular Band matrices */
+
+/* DTBCON - estimate the reciprocal of the condition number of a */
+/* triangular band matrix A, in either the 1-norm or the */
+/* infinity-norm */
+La_extern void
+F77_NAME(dtbcon)(const char* norm, const char* uplo,
+		 const char* diag, const int* n, const int* kd,
+		 const double* ab, const int* ldab,
+		 double* rcond, double* work,
+		 int* iwork, int* info);
+/* DTBRFS - provide error bounds and backward error estimates for */
+/* the solution to a system of linear equations with a triangular */
+/* band coefficient matrix */
+La_extern void
+F77_NAME(dtbrfs)(const char* uplo, const char* trans,
+		 const char* diag, const int* n, const int* kd,
+		 const int* nrhs,
+		 const double* ab, const int* ldab,
+		 const double* b, const int* ldb,
+		 double* x, const int* ldx,
+		 double* ferr, double* berr,
+		 double* work, int* iwork, int* info);
+/* DTBTRS - solve a triangular system of the form   A * X = B or */
+/* A**T * X = B,  */
+La_extern void
+F77_NAME(dtbtrs)(const char* uplo, const char* trans,
+		 const char* diag, const int* n,
+		 const int* kd, const int* nrhs,
+		 const double* ab, const int* ldab,
+		 double* b, const int* ldb, int* info);
+
+/* Double precision Triangular matrices Generalized problems */
+
+/* DTGEVC - compute some or all of the right and/or left */
+/* generalized eigenvectors of a pair of real upper triangular */
+/* matrices (A,B); */
+La_extern void
+F77_NAME(dtgevc)(const char* side, const char* howmny,
+		 const int* select, const int* n,
+		 const double* a, const int* lda,
+		 const double* b, const int* ldb,
+		 double* vl, const int* ldvl,
+		 double* vr, const int* ldvr,
+		 const int* mm, int* m, double* work, int* info);
+
+/* DTGSJA - compute the generalized singular value decomposition */
+/* (GSVD); of two real upper triangular (or trapezoidal); matrices */
+/* A and B */
+La_extern void
+F77_NAME(dtgsja)(const char* jobu, const char* jobv, const char* jobq,
+		 const int* m, const int* p, const int* n,
+		 const int* k, const int* l,
+		 double* a, const int* lda,
+		 double* b, const int* ldb,
+		 const double* tola, const double* tolb,
+		 double* alpha, double* beta,
+		 double* u, const int* ldu,
+		 double* v, const int* ldv,
+		 double* q, const int* ldq,
+		 double* work, int* ncycle, int* info);
+
+/* Double precision Triangular matrices Packed storage */
+
+/* DTPCON - estimate the reciprocal of the condition number of a */
+/* packed triangular matrix A, in either the 1-norm or the */
+/* infinity-norm */
+La_extern void
+F77_NAME(dtpcon)(const char* norm, const char* uplo,
+		 const char* diag, const int* n,
+		 const double* ap, double* rcond,
+		 double* work, int* iwork, int* info);
+
+/* DTPRFS - provide error bounds and backward error estimates for */
+/* the solution to a system of linear equations with a triangular */
+/* packed coefficient matrix */
+La_extern void
+F77_NAME(dtprfs)(const char* uplo, const char* trans,
+		 const char* diag, const int* n,
+		 const int* nrhs, const double* ap,
+		 const double* b, const int* ldb,
+		 double* x, const int* ldx,
+		 double* ferr, double* berr,
+		 double* work, int* iwork, int* info);
+
+/* Double precision TRiangular matrices */
+
+/* DTPTRI - compute the inverse of a real upper or lower */
+/* triangular matrix A stored in packed format */
+La_extern void
+F77_NAME(dtptri)(const char* uplo, const char* diag,
+		 const int* n, double* ap, int* info);
+
+/* DTPTRS - solve a triangular system of the form   A * X = B or */
+/* A**T * X = B, */
+La_extern void
+F77_NAME(dtptrs)(const char* uplo, const char* trans,
+		 const char* diag, const int* n,
+		 const int* nrhs, const double* ap,
+		 double* b, const int* ldb, int* info);
+
+/* DTRCON - estimate the reciprocal of the condition number of a */
+/* triangular matrix A, in either the 1-norm or the infinity-norm */
+La_extern void
+F77_NAME(dtrcon)(const char* norm, const char* uplo,
+		 const char* diag, const int* n,
+		 const double* a, const int* lda,
+		 double* rcond, double* work,
+		 int* iwork, int* info);
+
+/* DTREVC - compute some or all of the right and/or left */
+/* eigenvectors of a real upper quasi-triangular matrix T */
+La_extern void
+F77_NAME(dtrevc)(const char* side, const char* howmny,
+		 const int* select, const int* n,
+		 const double* t, const int* ldt,
+		 double* vl, const int* ldvl,
+		 double* vr, const int* ldvr,
+		 const int* mm, int* m, double* work, int* info);
+
+/* DTREXC - reorder the real Schur factorization of a real matrix */
+/* A = Q*T*Q**T, so that the diagonal block of T with row index */
+/* IFST is moved to row ILST */
+La_extern void
+F77_NAME(dtrexc)(const char* compq, const int* n,
+		 double* t, const int* ldt,
+		 double* q, const int* ldq,
+		 int* ifst, int* ILST,
+		 double* work, int* info);
+
+/* DTRRFS - provide error bounds and backward error estimates for */
+/* the solution to a system of linear equations with a triangular */
+/* coefficient matrix */
+La_extern void
+F77_NAME(dtrrfs)(const char* uplo, const char* trans,
+		 const char* diag, const int* n, const int* nrhs,
+		 const double* a, const int* lda,
+		 const double* b, const int* ldb,
+		 double* x, const int* ldx,
+		 double* ferr, double* berr,
+		 double* work, int* iwork, int* info);
+
+/* DTRSEN - reorder the real Schur factorization of a real matrix */
+/* A = Q*T*Q**T, so that a selected cluster of eigenvalues appears */
+/* in the leading diagonal blocks of the upper quasi-triangular */
+/* matrix T, */
+La_extern void
+F77_NAME(dtrsen)(const char* job, const char* compq,
+		 const int* select, const int* n,
+		 double* t, const int* ldt,
+		 double* q, const int* ldq,
+		 double* wr, double* wi,
+		 int* m, double* s, double* sep,
+		 double* work, const int* lwork,
+		 int* iwork, const int* liwork, int* info);
+
+/* DTRSNA - estimate reciprocal condition numbers for specified */
+/* eigenvalues and/or right eigenvectors of a real upper */
+/* quasi-triangular matrix T (or of any matrix Q*T*Q**T with Q */
+/* orthogonal); */
+La_extern void
+F77_NAME(dtrsna)(const char* job, const char* howmny,
+		 const int* select, const int* n,
+		 const double* t, const int* ldt,
+		 const double* vl, const int* ldvl,
+		 const double* vr, const int* ldvr,
+		 double* s, double* sep, const int* mm,
+		 int* m, double* work, const int* lwork,
+		 int* iwork, int* info);
+
+/* DTRSYL - solve the real Sylvester matrix equation */
+La_extern void
+F77_NAME(dtrsyl)(const char* trana, const char* tranb,
+		 const int* isgn, const int* m, const int* n,
+		 const double* a, const int* lda,
+		 const double* b, const int* ldb,
+		 double* c, const int* ldc,
+		 double* scale, int* info);
+
+/* DTRTI2 - compute the inverse of a real upper or lower */
+/* triangular matrix */
+La_extern void
+F77_NAME(dtrti2)(const char* uplo, const char* diag,
+		 const int* n, double* a, const int* lda,
+		 int* info);
+
+/* DTRTRI - compute the inverse of a real upper or lower */
+/* triangular matrix A */
+La_extern void
+F77_NAME(dtrtri)(const char* uplo, const char* diag,
+		 const int* n, double* a, const int* lda,
+		 int* info);
+
+/* DTRTRS - solve a triangular system of the form   A * X = B or */
+/* A**T * X = B	 */
+La_extern void
+F77_NAME(dtrtrs)(const char* uplo, const char* trans,
+		 const char* diag, const int* n, const int* nrhs,
+		 const double* a, const int* lda,
+		 double* b, const int* ldb, int* info);
+
+/* DTZRQF - reduce the M-by-N ( M<=N ); real upper trapezoidal */
+/* matrix A to upper triangular form by means of orthogonal */
+/* transformations  */
+La_extern void
+F77_NAME(dtzrqf)(const int* m, const int* n,
+		 double* a, const int* lda,
+		 double* tau, int* info);
+
+
+
+/* Double precision utilties in Lapack */
+/* DHGEQZ - implement a single-/double-shift version of the QZ */
+/* method for finding the generalized eigenvalues */
+/* w(j);=(ALPHAR(j); + i*ALPHAI(j););/BETAR(j); of the equation */
+/* det( A - w(i); B ); = 0  In addition, the pair A,B may be */
+/* reduced to generalized Schur form */
+La_extern void
+F77_NAME(dhgeqz)(const char* job, const char* compq, const char* compz,
+		 const int* n, const int *ILO, const int* IHI,
+		 double* a, const int* lda,
+		 double* b, const int* ldb,
+		 double* alphar, double* alphai, const double* beta,
+		 double* q, const int* ldq,
+		 double* z, const int* ldz,
+		 double* work, const int* lwork, int* info);
+/* DHSEIN - use inverse iteration to find specified right and/or */
+/* left eigenvectors of a real upper Hessenberg matrix H */
+La_extern void
+F77_NAME(dhsein)(const char* side, const char* eigsrc,
+		 const char* initv, int* select,
+		 const int* n, double* h, const int* ldh,
+		 double* wr, double* wi,
+		 double* vl, const int* ldvl,
+		 double* vr, const int* ldvr,
+		 const int* mm, int* m, double* work,
+		 int* ifaill, int* ifailr, int* info);
+/* DHSEQR - compute the eigenvalues of a real upper Hessenberg */
+/* matrix H and, optionally, the matrices T and Z from the Schur */
+/* decomposition H = Z T Z**T, where T is an upper */
+/* quasi-triangular matrix (the Schur form);, and Z is the */
+/* orthogonal matrix of Schur vectors */
+La_extern void
+F77_NAME(dhseqr)(const char* job, const char* compz, const int* n,
+		 const int* ilo, const int* ihi,
+		 double* h, const int* ldh,
+		 double* wr, double* wi,
+		 double* z, const int* ldz,
+		 double* work, const int* lwork, int* info);
+/* DLABAD - take as input the values computed by SLAMCH for */
+/* underflow and overflow, and returns the square root of each of */
+/* these values if the log of LARGE is sufficiently large */
+La_extern void
+F77_NAME(dlabad)(double* small, double* large);
+/* DLABRD - reduce the first NB rows and columns of a real */
+/* general m by n matrix A to upper or lower bidiagonal form by an */
+/* orthogonal transformation Q' * A * P, and returns the matrices */
+/* X and Y which are needed to apply the transformation to the */
+/* unreduced part of A */
+La_extern void
+F77_NAME(dlabrd)(const int* m, const int* n, const int* nb,
+		 double* a, const int* lda, double* d, double* e,
+		 double* tauq, double* taup,
+		 double* x, const int* ldx, double* y, const int* ldy);
+/* DLACON - estimate the 1-norm of a square, real matrix A */
+La_extern void
+F77_NAME(dlacon)(const int* n, double* v, double* x,
+		 int* isgn, double* est, int* kase);
+/* DLACPY - copy all or part of a two-dimensional matrix A to */
+/* another matrix B */
+La_extern void
+F77_NAME(dlacpy)(const char* uplo, const int* m, const int* n,
+		 const double* a, const int* lda,
+		 double* b, const int* ldb);
+/* DLADIV - perform complex division in real arithmetic	 */
+La_extern void
+F77_NAME(dladiv)(const double* a, const double* b,
+		 const double* c, const double* d,
+		 double* p, double* q);
+/* DLAE2 - compute the eigenvalues of a 2-by-2 symmetric matrix [ A B ] */
+/*								[ B C ] */
+La_extern void
+F77_NAME(dlae2)(const double* a, const double* b, const double* c,
+		double* rt1, double* rt2);
+/* DLAEBZ - contain the iteration loops which compute and use the */
+/* function N(w);, which is the count of eigenvalues of a */
+/* symmetric tridiagonal matrix T less than or equal to its */
+/* argument w  */
+La_extern void
+F77_NAME(dlaebz)(const int* ijob, const int* nitmax, const int* n,
+		 const int* mmax, const int* minp, const int* nbmin,
+		 const double* abstol, const double* reltol,
+		 const double* pivmin, double* d, double* e,
+		 double* e2, int* nval, double* ab, double* c,
+		 int* mout, int* nab, double* work, int* iwork,
+		 int* info);
+/* DLAED0 - compute all eigenvalues and corresponding */
+/* eigenvectors of a symmetric tridiagonal matrix using the divide */
+/* and conquer method */
+La_extern void
+F77_NAME(dlaed0)(const int* icompq, const int* qsiz, const int* n,
+		 double* d, double* e, double* q, const int* ldq,
+		 double* qstore, const int* ldqs,
+		 double* work, int* iwork, int* info);
+/* DLAED1 - compute the updated eigensystem of a diagonal matrix */
+/* after modification by a rank-one symmetric matrix */
+La_extern void
+F77_NAME(dlaed1)(const int* n, double* d, double* q, const int* ldq,
+		 int* indxq, const double* rho, const int* cutpnt,
+		 double* work, int* iwork, int* info);
+/* DLAED2 - merge the two sets of eigenvalues together into a */
+/* single sorted set */
+La_extern void
+F77_NAME(dlaed2)(const int* k, const int* n, double* d,
+		 double* q, const int* ldq, int* indxq,
+		 double* rho, const int* cutpnt, double* z,
+		 double* dlamda, double* q2, const int *ldq2,
+		 int* indxc, int* w, int* indxp, int* indx,
+		 int* coltyp, int* info);
+/* DLAED3 - find the roots of the secular equation, as defined by */
+/* the values in double* d, W, and RHO, between KSTART and KSTOP */
+La_extern void
+F77_NAME(dlaed3)(const int* k, const int* kstart,
+		 const int *kstop, const int* n,
+		 double* d, double* q, const int* ldq,
+		 const double* rho, const int* cutpnt,
+		 double* dlamda, int* q2, const int* ldq2,
+		 int* indxc, int* ctot, double* w,
+		 double* s, const int* lds, int* info);
+/* DLAED4 - subroutine computes the I-th updated eigenvalue of a */
+/* symmetric rank-one modification to a diagonal matrix whose */
+/* elements are given in the array d, and that	 D(i); < D(j); for */
+/* i < j  and that RHO > 0 */
+La_extern void
+F77_NAME(dlaed4)(const int* n, const int* i, const double* d,
+		 const double* z, const double* delta,
+		 const double* rho, double* dlam, int* info);
+/* DLAED5 - subroutine computes the I-th eigenvalue of a */
+/* symmetric rank-one modification of a 2-by-2 diagonal matrix */
+/* diag( D ); + RHO  The diagonal elements in the array D are */
+/* assumed to satisfy	D(i); < D(j); for i < j	 */
+La_extern void
+F77_NAME(dlaed5)(const int* i, const double* d, const double* z,
+		 double* delta, const double* rho, double* dlam);
+/* DLAED6 - compute the positive or negative root (closest to the */
+/* origin); of	z(1); z(2); z(3); f(x); = rho + --------- + */
+/* ---------- + ---------  d(1);-x d(2);-x d(3);-x  It is assumed */
+/* that	  if ORGATI = .true  */
+La_extern void
+F77_NAME(dlaed6)(const int* kniter, const int* orgati,
+		 const double* rho, const double* d,
+		 const double* z, const double* finit,
+		 double* tau, int* info);
+/* DLAED7 - compute the updated eigensystem of a diagonal matrix */
+/* after modification by a rank-one symmetric matrix */
+La_extern void
+F77_NAME(dlaed7)(const int* icompq, const int* n,
+		 const int* qsiz, const int* tlvls,
+		 const int* curlvl, const int* curpbm,
+		 double* d, double* q, const int* ldq,
+		 int* indxq, const double* rho, const int* cutpnt,
+		 double* qstore, double* qptr, const int* prmptr,
+		 const int* perm, const int* givptr,
+		 const int* givcol, const double* givnum,
+		 double* work, int* iwork, int* info);
+/* DLAED8 - merge the two sets of eigenvalues together into a */
+/* single sorted set */
+La_extern void
+F77_NAME(dlaed8)(const int* icompq, const int* k,
+		 const int* n, const int* qsiz,
+		 double* d, double* q, const int* ldq,
+		 const int* indxq, double* rho,
+		 const int* cutpnt, const double* z,
+		 double* dlamda, double* q2, const int* ldq2,
+		 double* w, int* perm, int* givptr,
+		 int* givcol, double* givnum, int* indxp,
+		 int* indx, int* info);
+/* DLAED9 - find the roots of the secular equation, as defined by */
+/* the values in double* d, Z, and RHO, between KSTART and KSTOP */
+La_extern void
+F77_NAME(dlaed9)(const int* k, const int* kstart, const int* kstop,
+		 const int* n, double* d, double* q, const int* ldq,
+		 const double* rho, const double* dlamda,
+		 const double* w, double* s, const int* lds, int* info);
+/* DLAEDA - compute the Z vector corresponding to the merge step */
+/* in the CURLVLth step of the merge process with TLVLS steps for */
+/* the CURPBMth problem */
+La_extern void
+F77_NAME(dlaeda)(const int* n, const int* tlvls, const int* curlvl,
+		 const int* curpbm, const int* prmptr, const int* perm,
+		 const int* givptr, const int* givcol,
+		 const double* givnum, const double* q,
+		 const int* qptr, double* z, double* ztemp, int* info);
+/* DLAEIN - use inverse iteration to find a right or left */
+/* eigenvector corresponding to the eigenvalue (WR,WI); of a real */
+/* upper Hessenberg matrix H */
+La_extern void
+F77_NAME(dlaein)(const int* rightv, const int* noinit, const int* n,
+		 const double* h, const int* ldh,
+		 const double* wr, const double* wi,
+		 double* vr, double* vi,
+		 double* b, const int* ldb, double* work,
+		 const double* eps3, const double* smlnum,
+		 const double* bignum, int* info);
+/* DLAEV2 - compute the eigendecomposition of a 2-by-2 symmetric */
+/* matrix  [ A B ]  [ B C ] */
+La_extern void
+F77_NAME(dlaev2)(const double* a, const double* b, const double* c,
+		 double* rt1, double* rt2, double* cs1, double *sn1);
+/* DLAEXC - swap adjacent diagonal blocks T11 and T22 of order 1 */
+/* or 2 in an upper quasi-triangular matrix T by an orthogonal */
+/* similarity transformation */
+La_extern void
+F77_NAME(dlaexc)(const int* wantq, const int* n, double* t, const int* ldt,
+		  double* q, const int* ldq, const int* j1,
+		 const int* n1, const int* n2, double* work, int* info);
+/* DLAG2 - compute the eigenvalues of a 2 x 2 generalized */
+/* eigenvalue problem A - w B, with scaling as necessary to aextern void */
+/* over-/underflow */
+La_extern void
+F77_NAME(dlag2)(const double* a, const int* lda, const double* b,
+		const int* ldb, const double* safmin,
+		double* scale1, double* scale2,
+		double* wr1, double* wr2, double* wi);
+/* DLAGS2 - compute 2-by-2 orthogonal matrices U, V and Q, such */
+/* that if ( UPPER ); then   U'*A*Q = U'*( A1 A2 );*Q = ( x 0 ); */
+/* ( 0 A3 ); ( x x ); and  V'*B*Q = V'*( B1 B2 );*Q = ( x 0 );	( */
+/* 0 B3 ); ( x x );  or if ( .NOT.UPPER ); then	  U'*A*Q = U'*( A1 */
+/* 0 );*Q = ( x x );  ( A2 A3 ); ( 0 x ); and  V'*B*Q = V'*( B1 0 */
+/* );*Q = ( x x );  ( B2 B3 ); ( 0 x );	 The rows of the */
+/* transformed A and B are parallel, where   U = ( CSU SNU );, V = */
+/* ( CSV SNV );, Q = ( CSQ SNQ );  ( -SNU CSU ); ( -SNV CSV ); ( */
+/* -SNQ CSQ );	Z' denotes the transpose of Z */
+La_extern void
+F77_NAME(dlags2)(const int* upper,
+		 const double* a1, const double* a2, const double* a3,
+		 const double* b1, const double* b2, const double* b3,
+		 double* csu, double* snu,
+		 double* csv, double* snv, double *csq, double *snq);
+/* DLAGTF - factorize the matrix (T - lambda*I);, where T is an n */
+/* by n tridiagonal matrix and lambda is a scalar, as	T - */
+/* lambda*I = PLU, */
+La_extern void
+F77_NAME(dlagtf)(const int* n, double* a, const double* lambda,
+		 double* b, double* c, const double *tol,
+		 double* d, int* in, int* info);
+/* DLAGTM - perform a matrix-vector product of the form	  B := */
+/* alpha * A * X + beta * B  where A is a tridiagonal matrix of */
+/* order N, B and X are N by NRHS matrices, and alpha and beta are */
+/* real scalars, each of which may be 0., 1., or -1 */
+La_extern void
+F77_NAME(dlagtm)(const char* trans, const int* n, const int* nrhs,
+		 const double* alpha, const double* dl,
+		 const double* d, const double* du,
+		 const double* x, const int* ldx, const double* beta,
+		 double* b, const int* ldb);
+/* DLAGTS - may be used to solve one of the systems of equations */
+/* (T - lambda*I);*x = y or (T - lambda*I);'*x = y, */
+La_extern void
+F77_NAME(dlagts)(const int* job, const int* n,
+		 const double* a, const double* b,
+		 const double* c, const double* d,
+		 const int* in, double* y, double* tol, int* info);
+/* DLAHQR - an auxiliary routine called by DHSEQR to update the */
+/* eigenvalues and Schur decomposition already computed by DHSEQR, */
+/* by dealing with the Hessenberg submatrix in rows and columns */
+/* ILO to IHI */
+La_extern void
+F77_NAME(dlahqr)(const int* wantt, const int* wantz, const int* n,
+		 const int* ilo, const int* ihi,
+		 double* H, const int* ldh, double* wr, double* wi,
+		 const int* iloz, const int* ihiz,
+		 double* z, const int* ldz, int* info);
+/* DLAHRD - reduce the first NB columns of a real general */
+/* n-by-(n-k+1); matrix A so that elements below the k-th */
+/* subdiagonal are zero */
+La_extern void
+F77_NAME(dlahrd)(const int* n, const int* k, const int* nb,
+		 double* a, const int* lda,
+		 double* tau, double* t, const int* ldt,
+		 double* y, const int* ldy);
+/* DLAIC1 - apply one step of incremental condition estimation in */
+/* its simplest version */
+La_extern void
+F77_NAME(dlaic1)(const int* job, const int* j, const double* x,
+		 const double* sest, const double* w,
+		 const double* gamma, double* sestpr,
+		 double* s, double* c);
+/* DLALN2 - solve a system of the form (ca A - w D ); X = s B or */
+/* (ca A' - w D); X = s B with possible scaling ("s"); and */
+/* perturbation of A */
+La_extern void
+F77_NAME(dlaln2)(const int* ltrans, const int* na, const int* nw,
+		 const double* smin, const double* ca,
+		 const double* a, const int* lda,
+		 const double* d1, const double* d2,
+		 const double* b, const int* ldb,
+		 const double* wr, const double* wi,
+		 double* x, const int* ldx, double* scale,
+		 double* xnorm, int* info);
+/* DLAMCH - determine double precision machine parameters */
+La_extern double
+F77_NAME(dlamch)(const char* cmach);
+/* DLAMRG - will create a permutation list which will merge the */
+/* elements of A (which is composed of two independently sorted */
+/* sets); into a single set which is sorted in ascending order */
+La_extern void
+F77_NAME(dlamrg)(const int* n1, const int* n2, const double* a,
+		 const int* dtrd1, const int* dtrd2, int* index);
+/* DLANGB - return the value of the one norm, or the Frobenius */
+/* norm, or the infinity norm, or the element of largest absolute */
+/* value of an n by n band matrix A, with kl sub-diagonals and ku */
+/* super-diagonals */
+La_extern double
+F77_NAME(dlangb)(const char* norm, const int* n,
+		 const int* kl, const int* ku, const double* ab,
+		 const int* ldab, double* work);
+/* DLANGE - return the value of the one norm, or the Frobenius */
+/* norm, or the infinity norm, or the element of largest absolute */
+/* value of a real matrix A */
+La_extern double
+F77_NAME(dlange)(const char* norm, const int* m, const int* n,
+		 const double* a, const int* lda, double* work);
+/* DLANGT - return the value of the one norm, or the Frobenius */
+/* norm, or the infinity norm, or the element of largest absolute */
+/* value of a real tridiagonal matrix A */
+La_extern double
+F77_NAME(dlangt)(const char* norm, const int* n,
+		 const double* dl, const double* d,
+		 const double* du);
+/* DLANHS - return the value of the one norm, or the Frobenius */
+/* norm, or the infinity norm, or the element of largest absolute */
+/* value of a Hessenberg matrix A */
+La_extern double
+F77_NAME(dlanhs)(const char* norm, const int* n,
+		 const double* a, const int* lda, double* work);
+/* DLANSB - return the value of the one norm, or the Frobenius */
+/* norm, or the infinity norm, or the element of largest absolute */
+/* value of an n by n symmetric band matrix A, with k */
+/* super-diagonals */
+La_extern double
+F77_NAME(dlansb)(const char* norm, const char* uplo,
+		 const int* n, const int* k,
+		 const double* ab, const int* ldab, double* work);
+/* DLANSP - return the value of the one norm, or the Frobenius */
+/* norm, or the infinity norm, or the element of largest absolute */
+/* value of a real symmetric matrix A, supplied in packed form */
+La_extern double
+F77_NAME(dlansp)(const char* norm, const char* uplo,
+		 const int* n, const double* ap, double* work);
+/* DLANST - return the value of the one norm, or the Frobenius */
+/* norm, or the infinity norm, or the element of largest absolute */
+/* value of a real symmetric tridiagonal matrix A */
+La_extern double
+F77_NAME(dlanst)(const char* norm, const int* n,
+		 const double* d, const double* e);
+/* DLANSY - return the value of the one norm, or the Frobenius */
+/* norm, or the infinity norm, or the element of largest absolute */
+/* value of a real symmetric matrix A */
+La_extern double
+F77_NAME(dlansy)(const char* norm, const char* uplo, const int* n,
+		 const double* a, const int* lda, double* work);
+/* DLANTB - return the value of the one norm, or the Frobenius */
+/* norm, or the infinity norm, or the element of largest absolute */
+/* value of an n by n triangular band matrix A, with ( k + 1 ) diagonals */
+La_extern double
+F77_NAME(dlantb)(const char* norm, const char* uplo,
+		 const char* diag, const int* n, const int* k,
+		 const double* ab, const int* ldab, double* work);
+/* DLANTP - return the value of the one norm, or the Frobenius */
+/* norm, or the infinity norm, or the element of largest absolute */
+/* value of a triangular matrix A, supplied in packed form */
+La_extern double
+F77_NAME(dlantp)(const char* norm, const char* uplo, const char* diag,
+		 const int* n, const double* ap, double* work);
+/* DLANTR - return the value of the one norm, or the Frobenius */
+/* norm, or the infinity norm, or the element of largest absolute */
+/* value of a trapezoidal or triangular matrix A */
+La_extern double
+F77_NAME(dlantr)(const char* norm, const char* uplo,
+		 const char* diag, const int* m, const int* n,
+		 const double* a, const int* lda, double* work);
+/* DLANV2 - compute the Schur factorization of a real 2-by-2 */
+/* nonsymmetric matrix in standard form */
+La_extern void
+F77_NAME(dlanv2)(double* a, double* b, double* c, double* d,
+		 double* rt1r, double* rt1i, double* rt2r, double* rt2i,
+		 double* cs, double *sn);
+/* DLAPLL - two column vectors X and Y, let A = ( X Y ); */
+La_extern void
+F77_NAME(dlapll)(const int* n, double* x, const int* incx,
+		 double* y, const int* incy, double* ssmin);
+/* DLAPMT - rearrange the columns of the M by N matrix X as */
+/* specified by the permutation K(1);,K(2);,...,K(N); of the */
+/* integers 1,...,N */
+La_extern void
+F77_NAME(dlapmt)(const int* forwrd, const int* m, const int* n,
+		 double* x, const int* ldx, const int* k);
+/* DLAPY2 - return sqrt(x**2+y**2);, taking care not to cause */
+/* unnecessary overflow */
+La_extern double
+F77_NAME(dlapy2)(const double* x, const double* y);
+/* DLAPY3 - return sqrt(x**2+y**2+z**2);, taking care not to */
+/* cause unnecessary overflow */
+La_extern double
+F77_NAME(dlapy3)(const double* x, const double* y, const double* z);
+/* DLAQGB - equilibrate a general M by N band matrix A with KL */
+/* subdiagonals and KU superdiagonals using the row and scaling */
+/* factors in the vectors R and C */
+La_extern void
+F77_NAME(dlaqgb)(const int* m, const int* n,
+		 const int* kl, const int* ku,
+		 double* ab, const int* ldab,
+		 double* r, double* c,
+		 double* rowcnd, double* colcnd,
+		 const double* amax, char* equed);
+/* DLAQGE - equilibrate a general M by N matrix A using the row */
+/* and scaling factors in the vectors R and C */
+La_extern void
+F77_NAME(dlaqge)(const int* m, const int* n,
+		 double* a, const int* lda,
+		 double* r, double* c,
+		 double* rowcnd, double* colcnd,
+		 const double* amax, char* equed);
+/* DLAQSB - equilibrate a symmetric band matrix A using the */
+/* scaling factors in the vector S */
+La_extern void
+F77_NAME(dlaqsb)(const char* uplo, const int* n, const int* kd,
+		 double* ab, const int* ldab, const double* s,
+		 const double* scond, const double* amax, char* equed);
+/* DLAQSP - equilibrate a symmetric matrix A using the scaling */
+/* factors in the vector S */
+La_extern void
+F77_NAME(dlaqsp)(const char* uplo, const int* n,
+		 double* ap, const double* s, const double* scond,
+		 const double* amax, int* equed);
+/* DLAQSY - equilibrate a symmetric matrix A using the scaling */
+/* factors in the vector S */
+La_extern void
+F77_NAME(dlaqsy)(const char* uplo, const int* n,
+		 double* a, const int* lda,
+		 const double* s, const double* scond,
+		 const double* amax, int* equed);
+/* DLAQTR - solve the real quasi-triangular system   */
+/* op(T) * p = scale*c */
+La_extern void
+F77_NAME(dlaqtr)(const int* ltran, const int* lreal, const int* n,
+		 const double* t, const int* ldt,
+		 const double* b, const double* w,
+		 double* scale, double* x, double* work, int* info);
+/* DLAR2V - apply a vector of real plane rotations from both */
+/* sides to a sequence of 2-by-2 real symmetric matrices, defined */
+/* by the elements of the vectors x, y and z  */
+La_extern void
+F77_NAME(dlar2v)(const int* n, double* x, double* y,
+		 double* z, const int* incx,
+		 const double* c, const double* s,
+		 const int* incc);
+/* DLARF - apply a real elementary reflector H to a real m by n */
+/* matrix C, from either the left or the right */
+La_extern void
+F77_NAME(dlarf)(const char* side, const int* m, const int* n,
+		const double* v, const int* incv, const double* tau,
+		double* c, const int* ldc, double* work);
+/* DLARFB - apply a real block reflector H or its transpose H' */
+/* to a real m by n matrix C, from either the left or the right */
+La_extern void
+F77_NAME(dlarfb)(const char* side, const char* trans,
+		 const char* direct, const char* storev,
+		 const int* m, const int* n, const int* k,
+		 const double* v, const int* ldv,
+		 const double* t, const int* ldt,
+		 double* c, const int* ldc,
+		 double* work, const int* lwork);
+/* DLARFG - generate a real elementary reflector H of order n, */
+/* such that   H * ( alpha ) = ( beta ), H' * H = I */
+La_extern void
+F77_NAME(dlarfg)(const int* n, const double* alpha,
+		 double* x, const int* incx, double* tau);
+/* DLARFT - form the triangular factor T of a real block */
+/* reflector H of order n, which is defined as a product of k */
+/* elementary reflectors */
+La_extern void
+F77_NAME(dlarft)(const char* direct, const char* storev,
+		 const int* n, const int* k, double* v, const int* ldv,
+		 const double* tau, double* t, const int* ldt);
+/* DLARFX - apply a real elementary reflector H to a real m by n */
+/* matrix C, from either the left or the right */
+La_extern void
+F77_NAME(dlarfx)(const char* side, const int* m, const int* n,
+		 const double* v, const double* tau,
+		 double* c, const int* ldc, double* work);
+/* DLARGV - generate a vector of real plane rotations, determined */
+/* by elements of the real vectors x and y */
+La_extern void
+F77_NAME(dlargv)(const int* n, double* x, const int* incx,
+		 double* y, const int* incy, double* c, const int* incc);
+/* DLARNV - return a vector of n random real numbers from a */
+/* uniform or normal distribution */
+La_extern void
+F77_NAME(dlarnv)(const int* idist, int* iseed, const int* n, double* x);
+/* DLARTG - generate a plane rotation so that	[ CS SN ]  */
+La_extern void
+F77_NAME(dlartg)(const double* f, const double* g, double* cs,
+		 double* sn, double *r);
+/* DLARTV - apply a vector of real plane rotations to elements of */
+/* the real vectors x and y */
+La_extern void
+F77_NAME(dlartv)(const int* n, double* x, const int* incx,
+		 double* y, const int* incy,
+		 const double* c, const double* s,
+		 const int* incc);
+/* DLARUV - return a vector of n random real numbers from a */
+/* uniform (0,1); */
+La_extern void
+F77_NAME(dlaruv)(int* iseed, const int* n, double* x);
+
+/* DLAS2 - compute the singular values of the 2-by-2 matrix */
+/* [ F G ]  [ 0 H ] */
+La_extern void
+F77_NAME(dlas2)(const double* f, const double* g, const double* h,
+		 double* ssmin, double* ssmax);
+
+/* DLASCL - multiply the M by N real matrix A by the real scalar */
+/* CTO/CFROM */
+La_extern void
+F77_NAME(dlascl)(const char* type,
+		 const int* kl,const int* ku,
+		 double* cfrom, double* cto,
+		 const int* m, const int* n,
+		 double* a, const int* lda, int* info);
+
+/* DLASET - initialize an m-by-n matrix A to BETA on the diagonal */
+/* and ALPHA on the offdiagonals */
+La_extern void
+F77_NAME(dlaset)(const char* uplo, const int* m, const int* n,
+		 const double* alpha, const double* beta,
+		 double* a, const int* lda);
+/* DLASQ1 - DLASQ1 computes the singular values of a real N-by-N */
+/* bidiagonal  matrix with diagonal D and off-diagonal E */
+La_extern void
+F77_NAME(dlasq1)(const int* n, double* d, double* e,
+		 double* work, int* info);
+/* DLASQ2 - DLASQ2 computes the singular values of a real N-by-N */
+/* unreduced  bidiagonal matrix with squared diagonal elements in */
+/* Q and  squared off-diagonal elements in E */
+La_extern void
+F77_NAME(dlasq2)(const int* m, double* q, double* e,
+		 double* qq, double* ee, const double* eps,
+		 const double* tol2, const double* small2,
+		 double* sup, int* kend, int* info);
+/* DLASQ3 - DLASQ3 is the workhorse of the whole bidiagonal SVD */
+/* algorithm */
+La_extern void
+F77_NAME(dlasq3)(int* n, double* q, double* e, double* qq,
+		 double* ee, double* sup, double *sigma,
+		 int* kend, int* off, int* iphase,
+		 const int* iconv, const double* eps,
+		 const double* tol2, const double* small2);
+/* DLASQ4 - DLASQ4 estimates TAU, the smallest eigenvalue of a */
+/* matrix */
+La_extern void
+F77_NAME(dlasq4)(const int* n, const double* q, const double* e,
+		 double* tau, double* sup);
+/* DLASR - perform the transformation	A := P*A, when SIDE = 'L' */
+/* or 'l' ( Left-hand side );	A := A*P', when SIDE = 'R' or 'r' */
+/* ( Right-hand side );	 where A is an m by n real matrix and P is */
+/* an orthogonal matrix, */
+La_extern void
+F77_NAME(dlasr)(const char* side, const char* pivot,
+		const char* direct, const int* m, const int* n,
+		const double* c, const double* s,
+		double* a, const int* lda);
+/* DLASRT - the numbers in D in increasing order (if ID = 'I'); */
+/* or in decreasing order (if ID = 'D' ); */
+La_extern void
+F77_NAME(dlasrt)(const char* id, const int* n, double* d, int* info);
+/* DLASSQ - return the values scl and smsq such that   ( scl**2 */
+/* );*smsq = x( 1 );**2 +...+ x( n );**2 + ( scale**2 );*sumsq, */
+La_extern void
+F77_NAME(dlassq)(const int* n, const double* x, const int* incx,
+		 double* scale, double* sumsq);
+/* DLASV2 - compute the singular value decomposition of a 2-by-2 */
+/* triangular matrix  [ F G ]  [ 0 H ] */
+La_extern void
+F77_NAME(dlasv2)(const double* f, const double* g, const double* h,
+		 double* ssmin, double* ssmax, double* snr, double* csr,
+		 double* snl, double* csl);
+/* DLASWP - perform a series of row interchanges on the matrix A */
+La_extern void
+F77_NAME(dlaswp)(const int* n, double* a, const int* lda,
+		 const int* k1, const int* k2,
+		 const int* ipiv, const int* incx);
+/* DLASY2 - solve for the N1 by N2 matrix double* x, 1 <= N1,N2 <= 2, in */
+/* op(TL);*X + ISGN*X*op(TR); = SCALE*B, */
+La_extern void
+F77_NAME(dlasy2)(const int* ltranl, const int* ltranr,
+		 const int* isgn, const int* n1, const int* n2,
+		 const double* tl, const int* ldtl,
+		 const double* tr, const int* ldtr,
+		 const double* b, const int* ldb,
+		 double* scale, double* x, const int* ldx,
+		 double* xnorm, int* info);
+/* DLASYF - compute a partial factorization of a real symmetric */
+/* matrix A using the Bunch-Kaufman diagonal pivoting method */
+La_extern void
+F77_NAME(dlasyf)(const char* uplo, const int* n,
+		 const int* nb, const int* kb,
+		 double* a, const int* lda, int* ipiv,
+		 double* w, const int* ldw, int* info);
+/* DLATBS - solve one of the triangular systems	  A *x = s*b or */
+/* A'*x = s*b  with scaling to prevent overflow, where A is an */
+/* upper or lower triangular band matrix */
+La_extern void
+F77_NAME(dlatbs)(const char* uplo, const char* trans,
+		 const char* diag, const char* normin,
+		 const int* n, const int* kd,
+		 const double* ab, const int* ldab,
+		 double* x, double* scale, double* cnorm, int* info);
+/* DLATPS - solve one of the triangular systems	  A *x = s*b or */
+/* A'*x = s*b  with scaling to prevent overflow, where A is an */
+/* upper or lower triangular matrix stored in packed form */
+La_extern void
+F77_NAME(dlatps)(const char* uplo, const char* trans,
+		 const char* diag, const char* normin,
+		 const int* n, const double* ap,
+		 double* x, double* scale, double* cnorm, int* info);
+/* DLATRD - reduce NB rows and columns of a real symmetric matrix */
+/* A to symmetric tridiagonal form by an orthogonal similarity */
+/* transformation Q' * A * Q, and returns the matrices V and W */
+/* which are needed to apply the transformation to the unreduced */
+/* part of A */
+La_extern void
+F77_NAME(dlatrd)(const char* uplo, const int* n, const int* nb,
+		 double* a, const int* lda, double* e, double* tau,
+		 double* w, const int* ldw);
+/* DLATRS - solve one of the triangular systems	  A *x = s*b or */
+/* A'*x = s*b  with scaling to prevent overflow */
+La_extern void
+F77_NAME(dlatrs)(const char* uplo, const char* trans,
+		 const char* diag, const char* normin,
+		 const int* n, const double* a, const int* lda,
+		 double* x, double* scale, double* cnorm, int* info);
+/* DLATZM - apply a Householder matrix generated by DTZRQF to a */
+/* matrix */
+La_extern void
+F77_NAME(dlatzm)(const char* side, const int* m, const int* n,
+		 const double* v, const int* incv,
+		 const double* tau, double* c1, double* c2,
+		 const int* ldc, double* work);
+/* DLAUU2 - compute the product U * U' or L' * const int* l, where the */
+/* triangular factor U or L is stored in the upper or lower */
+/* triangular part of the array A */
+La_extern void
+F77_NAME(dlauu2)(const char* uplo, const int* n,
+		 double* a, const int* lda, int* info);
+/* DLAUUM - compute the product U * U' or L' * L, where the */
+/* triangular factor U or L is stored in the upper or lower */
+/* triangular part of the array A */
+La_extern void
+F77_NAME(dlauum)(const char* uplo, const int* n,
+		 double* a, const int* lda, int* info);
+
+
+/* ======================================================================== */
+
+/* Selected Double Complex Lapack Routines
+   ========
+ */
+
+/* IZMAX1 finds the index of the element whose real part has maximum
+ * absolute value. */
+La_extern int
+F77_NAME(izmax1)(const int *n, Rcomplex *cx, const int *incx);
+
+
+/*  ZGECON estimates the reciprocal of the condition number of a general
+ *  complex matrix A, in either the 1-norm or the infinity-norm, using
+ *  the LU factorization computed by ZGETRF.
+ */
+La_extern void
+F77_NAME(zgecon)(const char *norm, const int *n,
+		 const Rcomplex *a, const int *lda,
+		 const double *anorm, double *rcond,
+		 Rcomplex *work, double *rwork, int *info);
+
+/* ZGESV computes the solution to a complex system of linear equations */
+La_extern void
+F77_NAME(zgesv)(const int *n, const int *nrhs, Rcomplex *a,
+		const int *lda, int *ipiv, Rcomplex *b,
+		const int *ldb, int *info);
+
+/*  ZGEQP3 computes a QR factorization with column pivoting */
+La_extern void
+F77_NAME(zgeqp3)(const int *m, const int *n,
+		 Rcomplex *a, const int *lda,
+		 int *jpvt, Rcomplex *tau,
+		 Rcomplex *work, const int *lwork,
+		 double *rwork, int *info);
+
+/* ZUNMQR applies Q or Q**H from the Left or Right */
+La_extern void
+F77_NAME(zunmqr)(const char *side, const char *trans,
+		 const int *m, const int *n, const int *k,
+		 Rcomplex *a, const int *lda,
+		 Rcomplex *tau,
+		 Rcomplex *c, const int *ldc,
+		 Rcomplex *work, const int *lwork, int *info);
+
+/*  ZTRTRS solves triangular systems */
+La_extern void
+F77_NAME(ztrtrs)(const char *uplo, const char *trans, const char *diag,
+		 const int *n, const int *nrhs,
+		 Rcomplex *a, const int *lda,
+		 Rcomplex *b, const int *ldb, int *info);
+/* ZGESVD - compute the singular value decomposition (SVD); of a   */
+/* real M-by-N matrix A, optionally computing the left and/or	   */
+/* right singular vectors					   */
+La_extern void
+F77_NAME(zgesvd)(const char *jobu, const char *jobvt,
+		 const int *m, const int *n,
+		 Rcomplex *a, const int *lda, double *s,
+		 Rcomplex *u, const int *ldu,
+		 Rcomplex *vt, const int *ldvt,
+		 Rcomplex *work, const int *lwork, double *rwork,
+		 int *info);
+
+/* ZGHEEV - compute all eigenvalues and, optionally, eigenvectors */
+/* of a Hermitian matrix A */
+La_extern void
+F77_NAME(zheev)(const char *jobz, const char *uplo,
+		const int *n, Rcomplex *a, const int *lda,
+		double *w, Rcomplex *work, const int *lwork,
+		double *rwork, int *info);
+
+/* ZGGEEV - compute all eigenvalues and, optionally, eigenvectors */
+/* of a complex non-symmetric matrix A */
+La_extern void
+F77_NAME(zgeev)(const char *jobvl, const char *jobvr,
+		const int *n, Rcomplex *a, const int *lda,
+		Rcomplex *wr, Rcomplex *vl, const int *ldvl,
+		Rcomplex *vr, const int *ldvr,
+		Rcomplex *work, const int *lwork,
+		double *rwork, int *info);
+
+
+/* NOTE: The following entry points were traditionally in this file,
+   but are not provided by R's libRlapack */
+
+/* DZSUM1 - take the sum of the absolute values of a complex */
+/* vector and returns a double precision result	 */
+La_extern double
+F77_NAME(dzsum1)(const int *n, Rcomplex *CX, const int *incx);
+
+/*  ZLACN2 estimates the 1-norm of a square, complex matrix A.
+ *  Reverse communication is used for evaluating matrix-vector products.
+*/
+La_extern void
+F77_NAME(zlacn2)(const int *n, Rcomplex *v, Rcomplex *x,
+                 double *est, int *kase, int *isave);
+
+/* ZLANTR  -  return the value of the one norm, or the Frobenius norm, */
+/* or the infinity norm, or the element of largest absolute value of */
+/* a trapezoidal or triangular matrix A */
+La_extern double
+F77_NAME(zlantr)(const char *norm, const char *uplo, const char *diag,
+		 const int *m, const int *n, Rcomplex *a,
+		 const int *lda, double *work);
+
+/* ======================================================================== */
+
+/* Other double precision and double complex Lapack routines
+   provided by libRlapack.
+
+   These are extracted from the CLAPACK headers.
+*/
+
+La_extern void
+F77_NAME(dbdsdc)(char *uplo, char *compq, int *n, double *
+	d, double *e, double *u, int *ldu, double *vt,
+	int *ldvt, double *q, int *iq, double *work, int * iwork, int *info);
+
+La_extern void
+F77_NAME(dgegs)(char *jobvsl, char *jobvsr, int *n,
+	double *a, int *lda, double *b, int *ldb, double *
+	alphar, double *alphai, double *beta, double *vsl,
+	int *ldvsl, double *vsr, int *ldvsr, double *work,
+	int *lwork, int *info);
+
+La_extern void
+F77_NAME(dgelsd)(int *m, int *n, int *nrhs,
+	double *a, int *lda, double *b, int *ldb, double *
+	s, double *rcond, int *rank, double *work, int *lwork,
+	 int *iwork, int *info);
+
+La_extern void
+F77_NAME(dgelsx)(int *m, int *n, int *nrhs,
+	double *a, int *lda, double *b, int *ldb, int *
+	jpvt, double *rcond, int *rank, double *work, int *
+	info);
+
+La_extern void
+F77_NAME(dgesc2)(int *n, double *a, int *lda,
+	double *rhs, int *ipiv, int *jpiv, double *scale);
+
+/* DGESDD - compute the singular value decomposition (SVD); of a   */
+/* real M-by-N matrix A, optionally computing the left and/or	   */
+/* right singular vectors.  If singular vectors are desired, it uses a */
+/* divide-and-conquer algorithm.				   */
+La_extern void
+F77_NAME(dgesdd)(const char *jobz,
+		 const int *m, const int *n,
+		 double *a, const int *lda, double *s,
+		 double *u, const int *ldu,
+		 double *vt, const int *ldvt,
+		 double *work, const int *lwork, int *iwork, int *info);
+
+La_extern void
+F77_NAME(dgetc2)(int *n, double *a, int *lda, int
+	*ipiv, int *jpiv, int *info);
+
+typedef int (*L_fp)();
+La_extern void
+F77_NAME(dggesx)(char *jobvsl, char *jobvsr, char *sort, L_fp
+	delctg, char *sense, int *n, double *a, int *lda,
+	double *b, int *ldb, int *sdim, double *alphar,
+	double *alphai, double *beta, double *vsl, int *ldvsl,
+	 double *vsr, int *ldvsr, double *rconde, double *
+	rcondv, double *work, int *lwork, int *iwork, int *
+	liwork, int *bwork, int *info);
+
+La_extern void
+F77_NAME(dggev)(char *jobvl, char *jobvr, int *n, double *
+	a, int *lda, double *b, int *ldb, double *alphar,
+	double *alphai, double *beta, double *vl, int *ldvl,
+	double *vr, int *ldvr, double *work, int *lwork,
+	int *info);
+
+La_extern void
+F77_NAME(dggevx)(char *balanc, char *jobvl, char *jobvr, char *
+	sense, int *n, double *a, int *lda, double *b,
+	int *ldb, double *alphar, double *alphai, double *
+	beta, double *vl, int *ldvl, double *vr, int *ldvr,
+	int *ilo, int *ihi, double *lscale, double *rscale,
+	double *abnrm, double *bbnrm, double *rconde, double *
+	rcondv, double *work, int *lwork, int *iwork, int *
+	bwork, int *info);
+
+La_extern void
+F77_NAME(dggsvp)(char *jobu, char *jobv, char *jobq, int *m,
+	int *p, int *n, double *a, int *lda, double *b,
+	int *ldb, double *tola, double *tolb, int *k, int
+	*l, double *u, int *ldu, double *v, int *ldv,
+	double *q, int *ldq, int *iwork, double *tau,
+	double *work, int *info);
+
+La_extern void
+F77_NAME(dgtts2)(int *itrans, int *n, int *nrhs,
+	double *dl, double *d, double *du, double *du2,
+	int *ipiv, double *b, int *ldb);
+La_extern void
+F77_NAME(dlagv2)(double *a, int *lda, double *b, int *ldb, double *alphar,
+		 double *alphai, double * beta, double *csl, double *snl,
+		 double *csr, double * snr);
+
+La_extern void
+F77_NAME(dlals0)(int *icompq, int *nl, int *nr,
+	int *sqre, int *nrhs, double *b, int *ldb, double
+	*bx, int *ldbx, int *perm, int *givptr, int *givcol,
+	int *ldgcol, double *givnum, int *ldgnum, double *
+	poles, double *difl, double *difr, double *z, int *
+	k, double *c, double *s, double *work, int *info);
+
+La_extern void
+F77_NAME(dlalsa)(int *icompq, int *smlsiz, int *n,
+	int *nrhs, double *b, int *ldb, double *bx, int *
+	ldbx, double *u, int *ldu, double *vt, int *k,
+	double *difl, double *difr, double *z, double *
+	poles, int *givptr, int *givcol, int *ldgcol, int *
+	perm, double *givnum, double *c, double *s, double *
+	work, int *iwork, int *info);
+
+La_extern void
+F77_NAME(dlalsd)(char *uplo, int *smlsiz, int *n, int
+	*nrhs, double *d, double *e, double *b, int *ldb,
+	double *rcond, int *rank, double *work, int *iwork,
+	int *info);
+
+La_extern void
+F77_NAME(dlamc1)(int *beta, int *t, int *rnd, int
+	*ieee1);
+
+La_extern void
+F77_NAME(dlamc2)(int *beta, int *t, int *rnd,
+	double *eps, int *emin, double *rmin, int *emax,
+	double *rmax);
+
+La_extern double
+F77_NAME(dlamc3)(double *a, double *b);
+
+La_extern void
+F77_NAME(dlamc4)(int *emin, double *start, int *base);
+
+La_extern void
+F77_NAME(dlamc5)(int *beta, int *p, int *emin,
+	int *ieee, int *emax, double *rmax);
+
+La_extern void
+F77_NAME(dlaqp2)(int *m, int *n, int *offset,
+	double *a, int *lda, int *jpvt, double *tau,
+	double *vn1, double *vn2, double *work);
+
+La_extern void
+F77_NAME(dlaqps)(int *m, int *n, int *offset, int
+	*nb, int *kb, double *a, int *lda, int *jpvt,
+	double *tau, double *vn1, double *vn2, double *auxv,
+	double *f, int *ldf);
+
+La_extern void
+F77_NAME(dlar1v)(int *n, int *b1, int *bn, double
+	*sigma, double *d, double *l, double *ld, double *
+	lld, double *gersch, double *z, double *ztz, double
+	*mingma, int *r, int *isuppz, double *work);
+
+La_extern void
+F77_NAME(dlarrb)(int *n, double *d, double *l,
+	double *ld, double *lld, int *ifirst, int *ilast,
+	double *sigma, double *reltol, double *w, double *
+	wgap, double *werr, double *work, int *iwork, int *
+	info);
+
+La_extern void
+F77_NAME(dlarre)(int *n, double *d, double *e,
+	double *tol, int *nsplit, int *isplit, int *m,
+	double *w, double *woff, double *gersch, double *work,
+	 int *info);
+
+La_extern void
+F77_NAME(dlarrf)(int *n, double *d, double *l,
+	double *ld, double *lld, int *ifirst, int *ilast,
+	double *w, double *dplus, double *lplus, double *work,
+	 int *iwork, int *info);
+
+La_extern void
+F77_NAME(dlarrv)(int *n, double *d, double *l,
+	int *isplit, int *m, double *w, int *iblock,
+	double *gersch, double *tol, double *z, int *ldz,
+	int *isuppz, double *work, int *iwork, int *info);
+
+La_extern void
+F77_NAME(dlarz)(char *side, int *m, int *n, int *l,
+	double *v, int *incv, double *tau, double *c,
+	int *ldc, double *work);
+
+La_extern void
+F77_NAME(dlarzb)(char *side, char *trans, char *direct, char *
+	storev, int *m, int *n, int *k, int *l, double *v,
+	 int *ldv, double *t, int *ldt, double *c, int *
+	ldc, double *work, int *ldwork);
+
+La_extern void
+F77_NAME(dlarzt)(char *direct, char *storev, int *n, int *
+	k, double *v, int *ldv, double *tau, double *t,
+	int *ldt);
+
+La_extern void
+F77_NAME(dlasd0)(int *n, int *sqre, double *d,
+	double *e, double *u, int *ldu, double *vt, int *
+	ldvt, int *smlsiz, int *iwork, double *work, int *
+	info);
+
+La_extern void
+F77_NAME(dlasd1)(int *nl, int *nr, int *sqre,
+	double *d, double *alpha, double *beta, double *u,
+	int *ldu, double *vt, int *ldvt, int *idxq, int *
+	iwork, double *work, int *info);
+
+La_extern void
+F77_NAME(dlasd2)(int *nl, int *nr, int *sqre, int
+	*k, double *d, double *z, double *alpha, double *
+	beta, double *u, int *ldu, double *vt, int *ldvt,
+	double *dsigma, double *u2, int *ldu2, double *vt2,
+	int *ldvt2, int *idxp, int *idx, int *idxc, int *
+	idxq, int *coltyp, int *info);
+
+La_extern void
+F77_NAME(dlasd3)(int *nl, int *nr, int *sqre, int
+	*k, double *d, double *q, int *ldq, double *dsigma,
+	double *u, int *ldu, double *u2, int *ldu2,
+	double *vt, int *ldvt, double *vt2, int *ldvt2,
+	int *idxc, int *ctot, double *z, int *info);
+
+La_extern void
+F77_NAME(dlasd4)(int *n, int *i, double *d,
+	double *z, double *delta, double *rho, double *
+	sigma, double *work, int *info);
+
+La_extern void
+F77_NAME(dlasd5)(int *i, double *d, double *z,
+	double *delta, double *rho, double *dsigma, double *
+	work);
+
+La_extern void
+F77_NAME(dlasd6)(int *icompq, int *nl, int *nr,
+	int *sqre, double *d, double *vf, double *vl,
+	double *alpha, double *beta, int *idxq, int *perm,
+	int *givptr, int *givcol, int *ldgcol, double *givnum,
+	 int *ldgnum, double *poles, double *difl, double *
+	difr, double *z, int *k, double *c, double *s,
+	double *work, int *iwork, int *info);
+
+La_extern void
+F77_NAME(dlasd7)(int *icompq, int *nl, int *nr,
+	int *sqre, int *k, double *d, double *z,
+	double *zw, double *vf, double *vfw, double *vl,
+	double *vlw, double *alpha, double *beta, double *
+	dsigma, int *idx, int *idxp, int *idxq, int *perm,
+	int *givptr, int *givcol, int *ldgcol, double *givnum,
+	 int *ldgnum, double *c, double *s, int *info);
+
+La_extern void
+F77_NAME(dlasd8)(int *icompq, int *k, double *d,
+	double *z, double *vf, double *vl, double *difl,
+	double *difr, int *lddifr, double *dsigma, double *
+	work, int *info);
+
+La_extern void
+F77_NAME(dlasd9)(int *icompq, int *ldu, int *k,
+	double *d, double *z, double *vf, double *vl,
+	double *difl, double *difr, double *dsigma, double *
+	work, int *info);
+
+La_extern void
+F77_NAME(dlasda)(int *icompq, int *smlsiz, int *n,
+	int *sqre, double *d, double *e, double *u, int
+	*ldu, double *vt, int *k, double *difl, double *difr,
+	double *z, double *poles, int *givptr, int *givcol,
+	int *ldgcol, int *perm, double *givnum, double *c,
+	double *s, double *work, int *iwork, int *info);
+
+La_extern void
+F77_NAME(dlasdq)(char *uplo, int *sqre, int *n, int *
+	ncvt, int *nru, int *ncc, double *d, double *e,
+	double *vt, int *ldvt, double *u, int *ldu,
+	double *c, int *ldc, double *work, int *info);
+
+La_extern void
+F77_NAME(dlasdt)(int *n, int *lvl, int *nd, int *
+	inode, int *ndiml, int *ndimr, int *msub);
+
+La_extern void
+F77_NAME(dlasq5)(int *i0, int *n0, double *z,
+	int *pp, double *tau, double *dmin, double *dmin1,
+	double *dmin2, double *dn, double *dnm1, double *dnm2,
+	 int *ieee);
+
+La_extern void
+F77_NAME(dlasq6)(int *i0, int *n0, double *z,
+	int *pp, double *dmin, double *dmin1, double *dmin2,
+	 double *dn, double *dnm1, double *dnm2);
+
+La_extern void
+F77_NAME(dlatdf)(int *ijob, int *n, double *z,
+	int *ldz, double *rhs, double *rdsum, double *rdscal,
+	int *ipiv, int *jpiv);
+
+La_extern void
+F77_NAME(dlatrz)(int *m, int *n, int *l, double *
+	a, int *lda, double *tau, double *work);
+
+La_extern void
+F77_NAME(dormr3)(char *side, char *trans, int *m, int *n,
+	int *k, int *l, double *a, int *lda, double *tau,
+	double *c, int *ldc, double *work, int *info);
+
+La_extern void
+F77_NAME(dormrz)(char *side, char *trans, int *m, int *n,
+	int *k, int *l, double *a, int *lda, double *tau,
+	double *c, int *ldc, double *work, int *lwork,
+	int *info);
+
+La_extern void
+F77_NAME(dptts2)(int *n, int *nrhs, double *d,
+	double *e, double *b, int *ldb);
+
+La_extern void
+F77_NAME(dsbgvd)(char *jobz, char *uplo, int *n, int *ka,
+	int *kb, double *ab, int *ldab, double *bb, int *
+	ldbb, double *w, double *z, int *ldz, double *work,
+	int *lwork, int *iwork, int *liwork, int *info);
+
+La_extern void
+F77_NAME(dsbgvx)(char *jobz, char *range, char *uplo, int *n,
+	int *ka, int *kb, double *ab, int *ldab, double *
+	bb, int *ldbb, double *q, int *ldq, double *vl,
+	double *vu, int *il, int *iu, double *abstol, int
+	*m, double *w, double *z, int *ldz, double *work,
+	int *iwork, int *ifail, int *info);
+
+La_extern void
+F77_NAME(dspgvd)(int *itype, char *jobz, char *uplo, int *
+	n, double *ap, double *bp, double *w, double *z,
+	int *ldz, double *work, int *lwork, int *iwork,
+	int *liwork, int *info);
+
+La_extern void
+F77_NAME(dspgvx)(int *itype, char *jobz, char *range, char *
+	uplo, int *n, double *ap, double *bp, double *vl,
+	double *vu, int *il, int *iu, double *abstol, int
+	*m, double *w, double *z, int *ldz, double *work,
+	int *iwork, int *ifail, int *info);
+
+La_extern void
+F77_NAME(dstegr)(char *jobz, char *range, int *n, double *
+	d, double *e, double *vl, double *vu, int *il,
+	int *iu, double *abstol, int *m, double *w,
+	double *z, int *ldz, int *isuppz, double *work,
+	int *lwork, int *iwork, int *liwork, int *info);
+
+La_extern void
+F77_NAME(dstevr)(char *jobz, char *range, int *n, double *
+	d, double *e, double *vl, double *vu, int *il,
+	int *iu, double *abstol, int *m, double *w,
+	double *z, int *ldz, int *isuppz, double *work,
+	int *lwork, int *iwork, int *liwork, int *info);
+
+La_extern void
+F77_NAME(dsygvd)(int *itype, char *jobz, char *uplo, int *
+	n, double *a, int *lda, double *b, int *ldb,
+	double *w, double *work, int *lwork, int *iwork,
+	int *liwork, int *info);
+
+La_extern void
+F77_NAME(dsygvx)(int *itype, char *jobz, char *range, char *
+	uplo, int *n, double *a, int *lda, double *b, int
+	*ldb, double *vl, double *vu, int *il, int *iu,
+	double *abstol, int *m, double *w, double *z,
+	int *ldz, double *work, int *lwork, int *iwork,
+	int *ifail, int *info);
+
+La_extern void
+F77_NAME(dtgex2)(int *wantq, int *wantz, int *n,
+	double *a, int *lda, double *b, int *ldb, double *
+	q, int *ldq, double *z, int *ldz, int *j1, int *
+	n1, int *n2, double *work, int *lwork, int *info);
+
+La_extern void
+F77_NAME(dtgexc)(int *wantq, int *wantz, int *n,
+	double *a, int *lda, double *b, int *ldb, double *
+	q, int *ldq, double *z, int *ldz, int *ifst,
+	int *ilst, double *work, int *lwork, int *info);
+
+La_extern void
+F77_NAME(dtgsen)(int *ijob, int *wantq, int *wantz,
+	int *select, int *n, double *a, int *lda, double *
+	b, int *ldb, double *alphar, double *alphai, double *
+	beta, double *q, int *ldq, double *z, int *ldz,
+	int *m, double *pl, double *pr, double *dif,
+	double *work, int *lwork, int *iwork, int *liwork,
+	int *info);
+
+La_extern void
+F77_NAME(dtgsna)(char *job, char *howmny, int *select,
+	int *n, double *a, int *lda, double *b, int *ldb,
+	double *vl, int *ldvl, double *vr, int *ldvr,
+	double *s, double *dif, int *mm, int *m, double *
+	work, int *lwork, int *iwork, int *info);
+
+La_extern void
+F77_NAME(dtgsy2)(char *trans, int *ijob, int *m, int *
+	n, double *a, int *lda, double *b, int *ldb,
+	double *c, int *ldc, double *d, int *ldd,
+	double *e, int *lde, double *f, int *ldf, double *
+	scale, double *rdsum, double *rdscal, int *iwork, int
+	*pq, int *info);
+
+La_extern void
+F77_NAME(dtgsyl)(char *trans, int *ijob, int *m, int *
+	n, double *a, int *lda, double *b, int *ldb,
+	double *c, int *ldc, double *d, int *ldd,
+	double *e, int *lde, double *f, int *ldf, double *
+	scale, double *dif, double *work, int *lwork, int *
+	iwork, int *info);
+
+La_extern void
+F77_NAME(dtzrzf)(int *m, int *n, double *a, int *
+	lda, double *tau, double *work, int *lwork, int *info);
+
+La_extern void
+F77_NAME(dpstrf)(const char* uplo, const int* n,
+		 double* a, const int* lda, int* piv, int* rank,
+		 double* tol, double *work, int* info);
+
+
+La_extern int
+F77_NAME(lsame)(char *ca, char *cb);
+
+La_extern void
+F77_NAME(zbdsqr)(char *uplo, int *n, int *ncvt, int *
+	nru, int *ncc, double *d, double *e, Rcomplex *vt,
+	int *ldvt, Rcomplex *u, int *ldu, Rcomplex *c,
+	int *ldc, double *rwork, int *info);
+
+La_extern void
+F77_NAME(zdrot)(int *n, Rcomplex *cx, int *incx,
+	Rcomplex *cy, int *incy, double *c, double *s);
+
+La_extern void
+F77_NAME(zgebak)(char *job, char *side, int *n, int *ilo,
+	int *ihi, double *scale, int *m, Rcomplex *v,
+	int *ldv, int *info);
+
+La_extern void
+F77_NAME(zgebal)(char *job, int *n, Rcomplex *a, int
+	*lda, int *ilo, int *ihi, double *scale, int *info);
+
+La_extern void
+F77_NAME(zgebd2)(int *m, int *n, Rcomplex *a,
+	int *lda, double *d, double *e, Rcomplex *tauq,
+	Rcomplex *taup, Rcomplex *work, int *info);
+
+La_extern void
+F77_NAME(zgebrd)(int *m, int *n, Rcomplex *a,
+	int *lda, double *d, double *e, Rcomplex *tauq,
+	Rcomplex *taup, Rcomplex *work, int *lwork, int *
+	info);
+La_extern void
+F77_NAME(zgehd2)(int *n, int *ilo, int *ihi,
+	Rcomplex *a, int *lda, Rcomplex *tau, Rcomplex *
+	work, int *info);
+
+La_extern void
+F77_NAME(zgehrd)(int *n, int *ilo, int *ihi,
+	Rcomplex *a, int *lda, Rcomplex *tau, Rcomplex *
+	work, int *lwork, int *info);
+
+La_extern void
+F77_NAME(zgelq2)(int *m, int *n, Rcomplex *a,
+	int *lda, Rcomplex *tau, Rcomplex *work, int *info);
+
+La_extern void
+F77_NAME(zgelqf)(int *m, int *n, Rcomplex *a,
+	int *lda, Rcomplex *tau, Rcomplex *work, int *lwork,
+	 int *info);
+
+La_extern void
+F77_NAME(zgeqr2)(int *m, int *n, Rcomplex *a,
+	int *lda, Rcomplex *tau, Rcomplex *work, int *info);
+
+La_extern void
+F77_NAME(zgeqrf)(int *m, int *n, Rcomplex *a,
+		 int *lda, Rcomplex *tau, Rcomplex *work, int *lwork,
+		 int *info);
+
+La_extern void
+F77_NAME(zgetf2)(int *m, int *n, Rcomplex *a,
+	int *lda, int *ipiv, int *info);
+
+La_extern void
+F77_NAME(zgetrf)(int *m, int *n, Rcomplex *a,
+	int *lda, int *ipiv, int *info);
+
+La_extern void
+F77_NAME(zgetrs)(char *trans, int *n, int *nrhs,
+	Rcomplex *a, int *lda, int *ipiv, Rcomplex *b,
+	int *ldb, int *info);
+
+
+La_extern void
+F77_NAME(zhetd2)(char *uplo, int *n, Rcomplex *a, int *lda, double *d,
+		 double *e, Rcomplex *tau, int *info);
+
+La_extern void
+F77_NAME(zhetrd)(char *uplo, int *n, Rcomplex *a,
+	int *lda, double *d, double *e, Rcomplex *tau,
+	Rcomplex *work, int *lwork, int *info);
+
+La_extern void
+F77_NAME(zhseqr)(char *job, char *compz, int *n, int *ilo,
+	 int *ihi, Rcomplex *h, int *ldh, Rcomplex *w,
+	Rcomplex *z, int *ldz, Rcomplex *work, int *lwork,
+	 int *info);
+
+La_extern void
+F77_NAME(zlabrd)(int *m, int *n, int *nb,
+	Rcomplex *a, int *lda, double *d, double *e,
+	Rcomplex *tauq, Rcomplex *taup, Rcomplex *x, int *
+	ldx, Rcomplex *y, int *ldy);
+
+La_extern void
+F77_NAME(zlacgv)(int *n, Rcomplex *x, int *incx);
+
+La_extern void
+F77_NAME(zlacpy)(char *uplo, int *m, int *n,
+	Rcomplex *a, int *lda, Rcomplex *b, int *ldb);
+
+La_extern void
+F77_NAME(zlahqr)(int *wantt, int *wantz, int *n,
+	int *ilo, int *ihi, Rcomplex *h, int *ldh,
+	Rcomplex *w, int *iloz, int *ihiz, Rcomplex *z,
+	int *ldz, int *info);
+
+La_extern void
+F77_NAME(zlahrd)(int *n, int *k, int *nb,
+	Rcomplex *a, int *lda, Rcomplex *tau, Rcomplex *t,
+	int *ldt, Rcomplex *y, int *ldy);
+
+La_extern double
+F77_NAME(zlange)(char *norm, int *m, int *n, Rcomplex *a, int *lda,
+		 double *work);
+
+La_extern double
+F77_NAME(zlanhe)(char *norm,  char *uplo, int *n, Rcomplex *a,
+		 int *lda, double *work);
+
+La_extern double
+F77_NAME(zlanhs)(char *norm, int *n, Rcomplex *a, int *lda, double *work);
+
+
+La_extern void
+F77_NAME(zlaqp2)(int *m, int *n, int *offset,
+	Rcomplex *a, int *lda, int *jpvt, Rcomplex *tau,
+	double *vn1, double *vn2, Rcomplex *work);
+
+La_extern void
+F77_NAME(zlaqps)(int *m, int *n, int *offset, int
+	*nb, int *kb, Rcomplex *a, int *lda, int *jpvt,
+	Rcomplex *tau, double *vn1, double *vn2, Rcomplex *
+	auxv, Rcomplex *f, int *ldf);
+
+La_extern void
+F77_NAME(zlarf)(char *side, int *m, int *n, Rcomplex
+	*v, int *incv, Rcomplex *tau, Rcomplex *c, int *
+	ldc, Rcomplex *work);
+
+La_extern void
+F77_NAME(zlarfb)(char *side, char *trans, char *direct, char *
+	storev, int *m, int *n, int *k, Rcomplex *v, int
+	*ldv, Rcomplex *t, int *ldt, Rcomplex *c, int *
+	ldc, Rcomplex *work, int *ldwork);
+
+La_extern void
+F77_NAME(zlarfg)(int *n, Rcomplex *alpha, Rcomplex *
+	x, int *incx, Rcomplex *tau);
+
+La_extern void
+F77_NAME(zlarft)(char *direct, char *storev, int *n, int *
+	k, Rcomplex *v, int *ldv, Rcomplex *tau, Rcomplex *
+	t, int *ldt);
+
+La_extern void
+F77_NAME(zlarfx)(char *side, int *m, int *n,
+	Rcomplex *v, Rcomplex *tau, Rcomplex *c, int *
+	ldc, Rcomplex *work);
+
+La_extern void
+F77_NAME(zlascl)(char *type, int *kl, int *ku,
+	double *cfrom, double *cto, int *m, int *n,
+	Rcomplex *a, int *lda, int *info);
+
+La_extern void
+F77_NAME(zlaset)(char *uplo, int *m, int *n,
+	Rcomplex *alpha, Rcomplex *beta, Rcomplex *a, int *
+	lda);
+
+La_extern void
+F77_NAME(zlasr)(char *side, char *pivot, char *direct, int *m,
+	 int *n, double *c, double *s, Rcomplex *a,
+	int *lda);
+
+La_extern void
+F77_NAME(zlassq)(int *n, Rcomplex *x, int *incx,
+	double *scale, double *sumsq);
+
+La_extern void
+F77_NAME(zlaswp)(int *n, Rcomplex *a, int *lda,
+	int *k1, int *k2, int *ipiv, int *incx);
+
+La_extern void
+F77_NAME(zlatrd)(char *uplo, int *n, int *nb,
+	Rcomplex *a, int *lda, double *e, Rcomplex *tau,
+	Rcomplex *w, int *ldw);
+
+La_extern void
+F77_NAME(zlatrs)(char *uplo, char *trans, char *diag, char *
+	normin, int *n, Rcomplex *a, int *lda, Rcomplex *x,
+	double *scale, double *cnorm, int *info);
+
+La_extern void
+F77_NAME(zsteqr)(char *compz, int *n, double *d,
+	double *e, Rcomplex *z, int *ldz, double *work,
+	int *info);
+
+/* ZTRCON estimates the reciprocal of the condition number of a
+ * triangular matrix A, in either the 1-norm or the infinity-norm.
+ */
+La_extern void
+F77_NAME(ztrcon)(const char *norm, const char *uplo, const char *diag,
+                 const int *n, const Rcomplex *a, const int *lda,
+		 double *rcond, Rcomplex *work, double *rwork, int *info);
+
+La_extern void
+F77_NAME(ztrevc)(char *side, char *howmny, int *select,
+	int *n, Rcomplex *t, int *ldt, Rcomplex *vl,
+	int *ldvl, Rcomplex *vr, int *ldvr, int *mm, int
+	*m, Rcomplex *work, double *rwork, int *info);
+
+La_extern void
+F77_NAME(zung2l)(int *m, int *n, int *k,
+	Rcomplex *a, int *lda, Rcomplex *tau, Rcomplex *
+	work, int *info);
+
+La_extern void
+F77_NAME(zung2r)(int *m, int *n, int *k,
+	Rcomplex *a, int *lda, Rcomplex *tau, Rcomplex *
+	work, int *info);
+
+La_extern void
+F77_NAME(zungbr)(char *vect, int *m, int *n, int *k,
+	Rcomplex *a, int *lda, Rcomplex *tau, Rcomplex *
+	work, int *lwork, int *info);
+
+La_extern void
+F77_NAME(zunghr)(int *n, int *ilo, int *ihi,
+	Rcomplex *a, int *lda, Rcomplex *tau, Rcomplex *
+	work, int *lwork, int *info);
+
+La_extern void
+F77_NAME(zungl2)(int *m, int *n, int *k,
+	Rcomplex *a, int *lda, Rcomplex *tau, Rcomplex *
+	work, int *info);
+
+La_extern void
+F77_NAME(zunglq)(int *m, int *n, int *k,
+	Rcomplex *a, int *lda, Rcomplex *tau, Rcomplex *
+	work, int *lwork, int *info);
+
+La_extern void
+F77_NAME(zungql)(int *m, int *n, int *k,
+	Rcomplex *a, int *lda, Rcomplex *tau, Rcomplex *
+	work, int *lwork, int *info);
+
+La_extern void
+F77_NAME(zungqr)(int *m, int *n, int *k,
+	Rcomplex *a, int *lda, Rcomplex *tau, Rcomplex *
+	work, int *lwork, int *info);
+
+La_extern void
+F77_NAME(zungr2)(int *m, int *n, int *k,
+	Rcomplex *a, int *lda, Rcomplex *tau, Rcomplex *
+	work, int *info);
+
+La_extern void
+F77_NAME(zungrq)(int *m, int *n, int *k,
+	Rcomplex *a, int *lda, Rcomplex *tau, Rcomplex *
+	work, int *lwork, int *info);
+
+La_extern void
+F77_NAME(zungtr)(char *uplo, int *n, Rcomplex *a,
+	int *lda, Rcomplex *tau, Rcomplex *work, int *lwork,
+	 int *info);
+
+La_extern void
+F77_NAME(zunm2r)(char *side, char *trans, int *m, int *n,
+	int *k, Rcomplex *a, int *lda, Rcomplex *tau,
+	Rcomplex *c, int *ldc, Rcomplex *work, int *info);
+
+La_extern void
+F77_NAME(zunmbr)(char *vect, char *side, char *trans, int *m,
+	int *n, int *k, Rcomplex *a, int *lda, Rcomplex
+	*tau, Rcomplex *c, int *ldc, Rcomplex *work, int *
+	lwork, int *info);
+
+La_extern void
+F77_NAME(zunml2)(char *side, char *trans, int *m, int *n,
+	int *k, Rcomplex *a, int *lda, Rcomplex *tau,
+	Rcomplex *c, int *ldc, Rcomplex *work, int *info);
+
+La_extern void
+F77_NAME(zunmlq)(char *side, char *trans, int *m, int *n,
+	int *k, Rcomplex *a, int *lda, Rcomplex *tau,
+	Rcomplex *c, int *ldc, Rcomplex *work, int *lwork,
+	 int *info);
+
+#ifdef	__cplusplus
+}
+#endif
+
+#endif /* R_LAPACK_H */
diff --git a/sourcecodes/localscore/Linpack.h b/sourcecodes/localscore/Linpack.h
new file mode 100644
index 00000000..95cb753e
--- /dev/null
+++ b/sourcecodes/localscore/Linpack.h
@@ -0,0 +1,89 @@
+/*
+ *  R : A Computer Language for Statistical Data Analysis
+ *  Copyright (C) 1997        Robert Gentleman and Ross Ihaka
+ *  Copyright (C) 1999-2002   The R Core Team.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation; either version 2.1 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this program; if not, a copy is available at
+ *  http://www.r-project.org/Licenses/
+ */
+
+/* 
+   C declarations of double-precision LINPACK Fortran subroutines
+   included in R, and some others.
+   
+   Those which are listed as part of R are in the API
+ */
+
+#ifndef R_LINPACK_H_
+#define R_LINPACK_H_
+
+#include <R_ext/RS.h>		/* for F77_... */
+#include <R_ext/BLAS.h>
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+	/* Double Precision Linpack */
+
+extern void F77_NAME(dchdc)(double*, int*, int*, double*, int*, int*, int*);
+extern void F77_NAME(dpbfa)(double*, int*, int*, int*, int*);
+extern void F77_NAME(dpbsl)(double*, int*, int*, int*, double*);
+extern void F77_NAME(dpoco)(double*, int*, int*, double*, double*, int*);
+extern void F77_NAME(dpodi)(double*, int*, int*, double*, int*);
+extern void F77_NAME(dpofa)(double*, int*, int*, int*);
+extern void F77_NAME(dposl)(double*, int*, int*, double*);
+extern void F77_NAME(dqrdc)(double*, int*, int*, int*, double*, int*, double*, int*);
+extern void F77_NAME(dqrsl)(double*, int*, int*, int*, double*, double*, double*, double*, double*, double*, double*, int*, int*);
+extern void F77_NAME(dsvdc)(double*, int*, int*, int*, double*, double*, double*, int*, double*, int*, double*, int*, int*);
+extern void F77_NAME(dtrco)(double*, int*, int*, double*, double*, int*);
+extern void F77_NAME(dtrsl)(double*, int*, int*, double*, int*, int*);
+
+
+/* The following routines are listed as they have always been declared
+   here, but they are not currently included in R */
+extern void F77_NAME(dchdc)(double*, int*, int*, double*, int*, int*, int*);
+extern void F77_NAME(dchdd)(double*, int*, int*, double*, double*, int*, int*, double*, double*, double*, double*, int*);
+extern void F77_NAME(dchex)(double*, int*, int*, int*, int*, double*, int*, int*, double*, double*, int*);
+extern void F77_NAME(dchud)(double*, int*, int*, double*, double*, int*, int*, double*, double*, double*, double*);
+extern void F77_NAME(dgbco)(double*, int*, int*, int*, int*, int*, double*, double*);
+extern void F77_NAME(dgbdi)(double*, int*, int*, int*, int*, int*, double*);
+extern void F77_NAME(dgbfa)(double*, int*, int*, int*, int*, int*, int*);
+extern void F77_NAME(dgbsl)(double*, int*, int*, int*, int*, int*, double*, int*);
+extern void F77_NAME(dgeco)(double*, int*, int*, int*, double*, double*);
+extern void F77_NAME(dgedi)(double*, int*, int*, int*, double*, double*, int*);
+extern void F77_NAME(dgefa)(double*, int*, int*, int*, int*);
+extern void F77_NAME(dgesl)(double*, int*, int*, int*, double*, int*);
+extern void F77_NAME(dgtsl)(int*, double*, double*, double*, double*, int*);
+extern void F77_NAME(dpbco)(double*, int*, int*, int*, double*, double*, int*);
+extern void F77_NAME(dpbdi)(double*, int*, int*, int*, double*);
+extern void F77_NAME(dppco)(double*, int*, double*, double*, int*);
+extern void F77_NAME(dppdi)(double*, int*, double*, int*);
+extern void F77_NAME(dppfa)(double*, int*, int*);
+extern void F77_NAME(dppsl)(double*, int*, double*);
+extern void F77_NAME(dptsl)(int*, double*, double*, double*);
+extern void F77_NAME(dsico)(double*, int*, int*, int*, double*, double*);
+extern void F77_NAME(dsidi)(double*, int*, int*, int*, double*, int*, double*, int*);
+extern void F77_NAME(dsifa)(double*, int*, int*, int*, int*);
+extern void F77_NAME(dsisl)(double*, int*, int*, int*, double*);
+extern void F77_NAME(dspco)(double*, int*, int*, double*, double*);
+extern void F77_NAME(dspdi)(double*, int*, int*, double*, int*, double*, int*);
+extern void F77_NAME(dspfa)(double*, int*, int*, int*);
+extern void F77_NAME(dspsl)(double*, int*, int*, double*);
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif /* R_LINPACK_H_ */
diff --git a/sourcecodes/localscore/MathThreads.h b/sourcecodes/localscore/MathThreads.h
new file mode 100644
index 00000000..41234442
--- /dev/null
+++ b/sourcecodes/localscore/MathThreads.h
@@ -0,0 +1,39 @@
+/*
+ *  R : A Computer Language for Statistical Data Analysis
+ *  Copyright (C) 2000, 2001 The R Core Team.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation; either version 2.1 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this program; if not, a copy is available at
+ *  http://www.r-project.org/Licenses/
+ */
+
+/*
+  Experimental: included by src/library/stats/src/distance.c
+*/
+
+#ifndef R_EXT_MATHTHREADS_H_
+#define R_EXT_MATHTHREADS_H_
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+#include <R_ext/libextern.h>
+LibExtern int R_num_math_threads;
+LibExtern int R_max_num_math_threads;
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif /* R_EXT_MATHTHREADS_H_ */
diff --git a/sourcecodes/localscore/Memory.h b/sourcecodes/localscore/Memory.h
new file mode 100644
index 00000000..306c9835
--- /dev/null
+++ b/sourcecodes/localscore/Memory.h
@@ -0,0 +1,49 @@
+/*
+ *  R : A Computer Language for Statistical Data Analysis
+ *  Copyright (C) 1998-2007  The R Core Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation; either version 2.1 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this program; if not, a copy is available at
+ *  http://www.r-project.org/Licenses/
+ *
+ *
+ * Memory Allocation (garbage collected) --- INCLUDING S compatibility ---
+ */
+
+/* Included by R.h: API */
+
+#ifndef R_EXT_MEMORY_H_
+#define R_EXT_MEMORY_H_
+
+#ifndef NO_C_HEADERS
+# include <stddef.h> /* for size_t */
+#endif
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+void*	vmaxget(void);
+void	vmaxset(const void *);
+
+void	R_gc(void);
+
+char*	R_alloc(size_t, int);
+char*	S_alloc(long, int);
+char*	S_realloc(char *, long, long, int);
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif /* R_EXT_MEMORY_H_ */
diff --git a/sourcecodes/localscore/Parse.h b/sourcecodes/localscore/Parse.h
new file mode 100644
index 00000000..a1d8cc87
--- /dev/null
+++ b/sourcecodes/localscore/Parse.h
@@ -0,0 +1,47 @@
+/*
+ *  R : A Computer Language for Statistical Data Analysis
+ *  Copyright (C) 1998-2006 R Core Team
+ *
+ *  This program 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.
+ *
+ *  This program 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 this program; if not, a copy is available at
+ *  http://www.r-project.org/Licenses/
+ */
+
+/* NOTE:
+   This file exports a part of the current internal parse interface.
+   It is subject to change at any minor (x.y.0) version of R.
+ */
+
+#ifndef R_EXT_PARSE_H_
+#define R_EXT_PARSE_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* PARSE_NULL will not be returned by R_ParseVector */
+typedef enum {
+    PARSE_NULL,
+    PARSE_OK,
+    PARSE_INCOMPLETE,
+    PARSE_ERROR,
+    PARSE_EOF
+} ParseStatus;
+
+SEXP R_ParseVector(SEXP, int, ParseStatus *, SEXP);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/sourcecodes/localscore/Print.h b/sourcecodes/localscore/Print.h
new file mode 100644
index 00000000..7beeaf17
--- /dev/null
+++ b/sourcecodes/localscore/Print.h
@@ -0,0 +1,50 @@
+/*
+ *  R : A Computer Language for Statistical Data Analysis
+ *  Copyright (C) 1998-2010    The R Core Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation; either version 2.1 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this program; if not, a copy is available at
+ *  http://www.r-project.org/Licenses/
+ */
+
+/* Included by R.h: API */
+
+#ifndef R_EXT_PRINT_H_
+#define R_EXT_PRINT_H_
+
+#ifdef  __cplusplus
+/* If the vprintf interface is defined at all in C++ it may only be
+   defined in namespace std. */
+# ifdef R_USE_C99_IN_CXX
+#  include <cstdarg>
+#  ifdef __SUNPRO_CC
+using _STLP_VENDOR_CSTD::va_list;
+#  endif
+# endif
+extern "C" {
+#else
+# include <stdarg.h>
+#endif
+
+void Rprintf(const char *, ...);
+void REprintf(const char *, ...);
+#if !defined(__cplusplus) || defined R_USE_C99_IN_CXX
+void Rvprintf(const char *, va_list);
+void REvprintf(const char *, va_list);
+#endif
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif /* R_EXT_PRINT_H_ */
diff --git a/sourcecodes/localscore/PrtUtil.h b/sourcecodes/localscore/PrtUtil.h
new file mode 100644
index 00000000..1ef06d9a
--- /dev/null
+++ b/sourcecodes/localscore/PrtUtil.h
@@ -0,0 +1,71 @@
+/*
+ *  R : A Computer Language for Statistical Data Analysis
+ *  Copyright (C) 1998-2012    The R Core Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation; either version 2.1 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this program; if not, a copy is available at
+ *  http://www.r-project.org/Licenses/
+ */
+
+/*
+ *  These functions are not part of the API.
+ */
+#ifndef PRTUTIL_H_
+#define PRTUTIL_H_
+
+#include <R_ext/Complex.h>
+#include <R_ext/Print.h>
+
+#define formatLogical      Rf_formatLogical
+#define formatInteger      Rf_formatInteger
+#define formatReal         Rf_formatReal
+#define formatComplex      Rf_formatComplex
+#define EncodeLogical      Rf_EncodeLogical
+#define EncodeInteger      Rf_EncodeInteger
+#define EncodeReal         Rf_EncodeReal
+#define EncodeComplex      Rf_EncodeComplex
+#define VectorIndex        Rf_VectorIndex
+#define printIntegerVector Rf_printIntegerVector
+#define printRealVector    Rf_printRealVector
+#define printComplexVector Rf_printComplexVector
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+/* Computation of printing formats */
+void formatLogical(int *, int, int *);
+void formatInteger(int *, int, int *);
+void formatReal(double *, int, int *, int *, int *, int);
+void formatComplex(Rcomplex *, int, int *, int *, int *, int *, int *, int *, int);
+
+/* Formating of values */
+const char *EncodeLogical(int, int);
+const char *EncodeInteger(int, int);
+const char *EncodeReal(double, int, int, int, char);
+const char *EncodeComplex(Rcomplex, int, int, int, int, int, int, char);
+
+/* Printing */
+void VectorIndex(int, int);
+
+void printLogicalVector(int *, int, int);
+void printIntegerVector(int *, int, int);
+void printRealVector   (double *, int, int);
+void printComplexVector(Rcomplex *,int, int);
+
+/* char *Rsprintf(char*, ...); */
+#ifdef  __cplusplus
+}
+#endif
+
+#endif /* PRTUTIL_H_ */
diff --git a/sourcecodes/localscore/QuartzDevice.h b/sourcecodes/localscore/QuartzDevice.h
new file mode 100644
index 00000000..ceb513e2
--- /dev/null
+++ b/sourcecodes/localscore/QuartzDevice.h
@@ -0,0 +1,235 @@
+/*
+ *  R : A Computer Language for Statistical Data Analysis
+ *  Copyright (C) 2007  The R Core Team
+ *
+ *  This program 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.
+ *
+ *  This program 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 this program; if not, a copy is available at
+ *  http://www.r-project.org/Licenses/
+ *
+ *---------------------------------------------------------------------
+ *  This header file constitutes the (unofficial) API to the Quartz
+ *  device. Being unofficial, the API may change at any point without
+ *  warning.
+ *
+ *  Quartz is a general device-independent way of drawing in Mac OS X,
+ *  therefore the Quartz device modularizes the actual drawing target
+ *  implementation into separate modules (e.g. Carbon and Cocoa for
+ *  on-screen display and PDF, Bitmap for off-screen drawing). The API
+ *  below is used by the modules to talk to the Quartz device without
+ *  having to know anything about R graphics device API.
+ *
+ *  Key functions are listed here:
+ *  QuartzDevice_Create - creates a Quartz device
+ *  QuartzDevice_ResetContext - should be called after the target
+ *    context has been created to initialize it.
+ *  QuartzDevice_Kill - closes the Quartz device (e.g. on window close)
+ *  QuartzDevice_SetScaledSize - resize device (does not include
+ *    re-painting, it should be followed by a call to
+ *    QuartzDevice_ReplayDisplayList)
+ *  QuartzDevice_ReplayDisplayList - replays all plot commands
+ *
+ *  Key concepts
+ *  - all Quartz modules are expected to provide a device context
+ *    (CGContextRef) for drawing. A device can temporarily return NULL
+ *    (e.g. if the context is not available immediately) and replay
+ *    the display list later to catch up.
+ *
+ *  - interactive devices can use QuartzDevice_SetScaledSize to resize
+ *    the device (no context is necessary), then prepare the context
+ *    (call QuartzDevice_ResetContext if a new context was created)
+ *    and finally re-draw using QuartzDevice_ReplayDisplayList.
+ *
+ *  - snapshots can be created either off the current display list
+ *    (last=0) or off the last known one (last=1). NewPage callback
+ *    can only use last=1 as there is no display list during that
+ *    call. Restored snapshots become the current display list and
+ *    thus can be extended by further painting (yet the original saved
+ *    copy is not influenced). Also note that all snapshots are SEXPs
+ *    (the declaration doesn't use SEXP as to not depend on
+ *    Rinternals.h) therefore must be protected or preserved immediately
+ *    (i.e. the Quartz device does NOT protect them - except in the
+ *    call to RestoreSnapshot).
+ *
+ *  - dirty flag: the dirty flag is not used internally by the Quartz
+ *    device, but can be useful for the modules to determine whether
+ *    the current graphics is a restored copy or in-progress
+ *    drawing. The Quartz device manages the flag as follows: a)
+ *    display list replay does NOT change the flag, b) snapshot
+ *    restoration resets the flag, c) all other paint operations
+ *    (i.e. outside of restore/replay) set the flag. Most common use
+ *    is to determine whether restored snapshots have been
+ *    subsequently modified.
+ *
+ *  - history: currently the history management is not used by any
+ *    modules and as such is untested and strictly experimental. It
+ *    may be removed in the future as it is not clear whether it makes
+ *    sense to be part of the device. See Cocoa module for a
+ *    module-internal implementation of the display history.
+ *
+ *  Quartz device creation path:
+ *    quartz() function -> SEXP Quartz(args) ->
+ *    setup QuartzParameters_t, call backend constructor
+ *    [e.g. QuartzCocoa_DeviceCreate(dd, fn, QuartzParameters_t *pars)] ->
+ *    create backend definition (QuartzBackend_t backend) -> 
+ *    fn->Create(dd, &backend), return the result
+ */
+
+#ifndef R_EXT_QUARTZDEVICE_H_
+#define R_EXT_QUARTZDEVICE_H_
+
+/* FIXME: this is installed, but can it really work without config.h */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif   
+ 
+#if HAVE_AQUA
+#include <ApplicationServices/ApplicationServices.h>
+#else
+    typedef void* CGContextRef;
+#endif
+
+/* flags passed to the newPage callback */
+#define QNPF_REDRAW 0x0001 /* is set when NewPage really means re-draw of an existing page */
+
+/* flags passed to QuartzDevice_Create (as fs parameter) */
+#define QDFLAG_DISPLAY_LIST 0x0001
+#define QDFLAG_INTERACTIVE  0x0002 
+#define QDFLAG_RASTERIZED   0x0004 /* rasterized media - may imply disabling AA paritally for rects etc. */
+
+/* parameter flags (they should not conflict with QDFLAGS to allow chaining) */
+#define QPFLAG_ANTIALIAS 0x0100
+
+typedef void* QuartzDesc_t;
+
+typedef struct QuartzBackend_s {
+    int    size;                          /* structure size */
+    double width, height;
+    double scalex, scaley, pointsize;
+    int    bg, canvas;
+    int    flags;
+    void*  userInfo;
+    CGContextRef (*getCGContext)(QuartzDesc_t dev, void*userInfo); /* Get the context for this device */
+    int          (*locatePoint)(QuartzDesc_t dev, void*userInfo, double*x, double*y);
+    void         (*close)(QuartzDesc_t dev, void*userInfo);
+    void         (*newPage)(QuartzDesc_t dev, void*userInfo, int flags);
+    void         (*state)(QuartzDesc_t dev, void*userInfo, int state);
+    void*        (*par)(QuartzDesc_t dev, void*userInfo, int set, const char *key, void *value);
+    void         (*sync)(QuartzDesc_t dev, void*userInfo);
+    void*        (*cap)(QuartzDesc_t dev, void*userInfo);
+} QuartzBackend_t;
+
+/* parameters that are passed to functions that create backends */
+typedef struct QuartzParameters_s {
+    int        size;                   /* structure size */
+    const char *type, *file, *title;
+    double     x, y, width, height, pointsize;
+    const char *family;
+    int        flags;
+    int        connection;
+    int        bg, canvas;
+    double     *dpi;
+    /* the following parameters can be used to pass custom parameters when desired */
+    double     pard1, pard2;
+    int        pari1, pari2;
+    const char *pars1, *pars2;
+    void       *parv;
+} QuartzParameters_t;
+    
+/* all device implementations have to call this general Quartz device constructor at some point */
+QuartzDesc_t QuartzDevice_Create(void *dd, QuartzBackend_t* def);
+    
+typedef struct QuartzFunctons_s {
+    void*  (*Create)(void *, QuartzBackend_t *);  /* create a new device */
+    int    (*DevNumber)(QuartzDesc_t desc);       /* returns device number */
+    void   (*Kill)(QuartzDesc_t desc);            /* call to close the device */
+    void   (*ResetContext)(QuartzDesc_t desc);    /* notifies Q back-end that the implementation has created a new context */
+    double (*GetWidth)(QuartzDesc_t desc);        /* get device width (in inches) */
+    double (*GetHeight)(QuartzDesc_t desc);       /* get device height (in inches) */
+    void   (*SetSize)(QuartzDesc_t desc, double width, double height); /* set device size (in inches) */
+    
+    double (*GetScaledWidth)(QuartzDesc_t desc);  /* get device width (in pixels) */
+    double (*GetScaledHeight)(QuartzDesc_t desc); /* get device height (in pixels) */
+    void   (*SetScaledSize)(QuartzDesc_t desc, double width, double height); /* set device size (in pixels) */
+
+    double (*GetXScale)(QuartzDesc_t desc);     /* get x scale factor (px/pt ratio) */
+    double (*GetYScale)(QuartzDesc_t desc);     /* get y scale factor (px/pt ratio) */
+    void   (*SetScale)(QuartzDesc_t desc,double scalex, double scaley); /* sets both scale factors (px/pt ratio) */
+
+    void   (*SetTextScale)(QuartzDesc_t desc,double scale); /* sets text scale factor */
+    double (*GetTextScale)(QuartzDesc_t desc);  /* sets text scale factor */
+
+    void   (*SetPointSize)(QuartzDesc_t desc,double ps); /* sets point size */
+    double (*GetPointSize)(QuartzDesc_t desc);  /* gets point size */
+
+    int    (*GetDirty)(QuartzDesc_t desc);        /* sets dirty flag */
+    void   (*SetDirty)(QuartzDesc_t desc,int dirty); /* gets dirty flag */
+
+    void   (*ReplayDisplayList)(QuartzDesc_t desc); /* replay display list
+     Note: it inhibits sync calls during repaint,
+     the caller is responsible for calling sync if needed.
+     Dirty flag is kept unmodified */
+    void*  (*GetSnapshot)(QuartzDesc_t desc, int last);    
+    /* create a (replayable) snapshot of the device contents. 
+       when 'last' is set then the last stored display list is used, 
+       otherwise a new snapshot is created */
+    void   (*RestoreSnapshot)(QuartzDesc_t desc,void* snapshot);
+    /* restore a snapshot. also clears the dirty flag */
+
+    int    (*GetAntialias)(QuartzDesc_t desc);    /* get anti-alias flag */
+    void   (*SetAntialias)(QuartzDesc_t desc, int aa); /* set anti-alias flag */
+
+    int    (*GetBackground)(QuartzDesc_t desc);   /* get background color */
+    void   (*Activate)(QuartzDesc_t desc);        /* activate/select the device */
+    /* get/set Quartz-specific parameters. desc can be NULL for global parameters */
+    void*  (*SetParameter)(QuartzDesc_t desc, const char *key, void *value);
+    void*  (*GetParameter)(QuartzDesc_t desc, const char *key);
+} QuartzFunctions_t;
+
+#define QuartzParam_EmbeddingFlags "embeddeding flags" /* value: int[1] */
+#define QP_Flags_CFLoop 0x0001  /* drives application event loop */
+#define QP_Flags_Cocoa  0x0002  /* Cocoa is fully initialized */
+#define QP_Flags_Front  0x0004  /* is front application */
+
+/* from unix/aqua.c - loads grDevices if necessary and returns NULL on failure */
+QuartzFunctions_t *getQuartzFunctions();
+
+/* type of a Quartz contructor */
+typedef QuartzDesc_t (*quartz_create_fn_t)(void *dd, QuartzFunctions_t *fn, QuartzParameters_t *par);
+
+/* grDevices currently supply following constructors:
+   QuartzCocoa_DeviceCreate, QuartzCarbon_DeviceCreate,
+   QuartzBitmap_DeviceCreate, QuartzPDF_DeviceCreate */
+
+/* embedded Quartz support hook (defined in unix/aqua.c):
+     dd = should be passed-through to QuartzDevice_Create
+     fn = Quartz API functions
+     par = parameters (see above) */
+#ifndef IN_AQUA_C
+    extern
+#endif
+    QuartzDesc_t (*ptr_QuartzBackend)(void *dd, QuartzFunctions_t *fn, QuartzParameters_t *par);
+
+/* C version of the Quartz call (experimental)
+   returns 0 on success, error code on failure */
+QuartzDesc_t Quartz_C(QuartzParameters_t *par, quartz_create_fn_t q_create, int *errorCode);
+
+#ifdef __cplusplus
+}
+#endif   
+
+#endif
diff --git a/sourcecodes/localscore/R-ftp-http.h b/sourcecodes/localscore/R-ftp-http.h
new file mode 100644
index 00000000..665bfb87
--- /dev/null
+++ b/sourcecodes/localscore/R-ftp-http.h
@@ -0,0 +1,65 @@
+/*
+ *  R : A Computer Language for Statistical Data Analysis
+ *  Copyright (C) 2001-6 The R Core Team.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation; either version 2.1 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this program; if not, a copy is available at
+ *  http://www.r-project.org/Licenses/
+ */
+
+/* Advertized entry points, for that part of libxml included in
+ * the internet module.
+ */
+
+#ifndef R_FTP_HTTP_H_
+#define R_FTP_HTTP_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void *R_HTTPOpen(const char *url);
+int   R_HTTPRead(void *ctx, char *dest, int len);
+void  R_HTTPClose(void *ctx);
+
+void *R_FTPOpen(const char *url);
+int   R_FTPRead(void *ctx, char *dest, int len);
+void  R_FTPClose(void *ctx);
+
+void *	RxmlNanoHTTPOpen(const char *URL, char **contentType, const char *headers, int cacheOK);
+int	RxmlNanoHTTPRead(void *ctx, void *dest, int len);
+void	RxmlNanoHTTPClose(void *ctx);
+int 	RxmlNanoHTTPReturnCode(void *ctx);
+char * 	RxmlNanoHTTPStatusMsg(void *ctx);
+int 	RxmlNanoHTTPContentLength(void *ctx);
+char *	RxmlNanoHTTPContentType(void *ctx);
+void	RxmlNanoHTTPTimeout(int delay);
+
+void *	RxmlNanoFTPOpen(const char *URL);
+int	RxmlNanoFTPRead(void *ctx, void *dest, int len);
+int	RxmlNanoFTPClose(void *ctx);
+void	RxmlNanoFTPTimeout(int delay);
+int 	RxmlNanoFTPContentLength(void *ctx);
+
+void    RxmlMessage(int level, const char *format, ...);
+
+/* not currently used */
+
+void RxmlNanoFTPCleanup(void);
+void RxmlNanoHTTPCleanup(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* R_FTP_HTTP_H_ */
diff --git a/sourcecodes/localscore/R.h b/sourcecodes/localscore/R.h
new file mode 100644
index 00000000..5c5696b3
--- /dev/null
+++ b/sourcecodes/localscore/R.h
@@ -0,0 +1,65 @@
+/*
+ *  R : A Computer Language for Statistical Data Analysis
+ *  Copyright (C) 2000-2010 The R Core Team.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation; either version 2.1 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this program; if not, a copy is available at
+ *  http://www.r-project.org/Licenses/
+ */
+
+#ifndef R_R_H
+#define R_R_H
+
+#ifndef USING_R
+# define USING_R
+#endif
+
+#ifndef NO_C_HEADERS
+#include <stdlib.h>
+#include <stdio.h>  /* Used by several packages, remove in due course */
+#include <limits.h> /* for INT_MAX */
+#include <math.h>
+#endif
+
+#include "Rconfig.h"
+#include "Arith.h"      /* R_FINITE, ISNAN, ... */
+#include "Boolean.h"    /* Rboolean type */
+#include "Complex.h"    /* Rcomplex type */
+#include "Constants.h"  /* PI, DOUBLE_EPS, etc */
+#include "Error.h"      /* error and warning */
+#include "Memory.h"     /* R_alloc and S_alloc */
+#include "Print.h"      /* Rprintf etc */
+#include "Random.h"     /* RNG interface */
+#include "Utils.h"      /* sort routines et al */
+#include "RS.h"
+/* for PROBLEM ... Calloc, Realloc, Free, Memcpy, F77_xxxx */
+
+
+typedef double Sfloat;
+typedef int Sint;
+#define SINT_MAX INT_MAX
+#define SINT_MIN INT_MIN
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void R_FlushConsole(void);
+/* always declared, but only usable under Win32 and Aqua */
+void R_ProcessEvents(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !R_R_H */
diff --git a/sourcecodes/localscore/RConverters.h b/sourcecodes/localscore/RConverters.h
new file mode 100644
index 00000000..9ac0da33
--- /dev/null
+++ b/sourcecodes/localscore/RConverters.h
@@ -0,0 +1,131 @@
+/*
+ *  R : A Computer Language for Statistical Data Analysis
+ *  Copyright (C) 1998-2006   The R Core Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation; either version 2.1 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this program; if not, a copy is available at
+ *  http://www.r-project.org/Licenses/
+ *
+ *
+ */
+
+/*
+  Not part of the API, concerns .C() converters which are deprecated.
+ */
+
+#ifndef R_CCONVERTERS_H
+#define R_CCONVERTERS_H
+
+#include <Rinternals.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define freeCConverter RC_freeCConverter
+#define R_addToCConverter RC_addToCConverter
+#define R_converterMatchClass RC_converterMatchClass
+#define R_converterMatchClass RC_converterMatchClass
+#define R_getToCConverterByDescription RC_getToCConverterByDescription
+#define R_getToCConverterByIndex RC_getToCConverterByIndex
+#define R_getToCConverterByIndex RC_getToCConverterByIndex
+#define R_removeToCConverter RC_removeToCConverter
+
+  /* Context information controlling how the conversion is performed, passed 
+     to RObjToCPtr in dotcode.c and the different user level converters. */
+  typedef struct {
+    int  naok;
+    int  narg;
+    int  dup;
+    int  Fort;
+ 
+    char const * name ;
+
+    SEXP classes;
+  } R_CConvertInfo;
+
+
+  /* Typedefs for structs defined below with future/cross-referencing. */
+  typedef struct RtoCConverter R_toCConverter;
+  typedef struct RFromCConvertInfo R_FromCConvertInfo;
+
+
+  /* The matching routine which determines whether the converter can process the given SEXP. */
+  typedef Rboolean (*R_ToCPredicate)(SEXP obj, R_CConvertInfo *info, R_toCConverter *el);
+
+  /* The converter routine that returns the value to be passed to the C routine.
+     (We may have to make the return type a union to handle the different types.) */
+  typedef void*    (*R_ToCConverter)(SEXP obj, R_CConvertInfo *info, R_toCConverter *el);
+
+  /* The reverse converter from the C argument to the R object that is returned via the .C() call. */ 
+  typedef SEXP     (*R_FromCConverter)(void *value, SEXP arg, R_FromCConvertInfo *info, 
+				       R_toCConverter *el);
+
+
+  /* The definition of the converter element which are stored as a linked list. */
+  struct RtoCConverter {
+    R_ToCPredicate    matcher; /* check if converter applies to R object */
+    R_ToCConverter    converter; /* convert the R object to C value */
+    R_FromCConverter  reverse;   /* convert the C value back to an R object. */
+    char             *description; /* user-readable string describing the converter. */
+    void             *userData;    /* additional information used in (any of) the matcher,
+                                      converter, and reverse routines to parameterize them. */
+    Rboolean          active;  /* allows the converter to be in the list but ignored temporarily. */
+
+    R_toCConverter   *next;    /* next element in the linked list. */
+  };
+
+
+  /*   Information used to convert C values to R objects at the end of do_dotCode() */
+  struct RFromCConvertInfo {
+    const char *functionName; /* the name of the routine being called (S's name for it). */
+   
+    int         argIndex; /* the pariticular argument being processed. */
+
+    /* We provide all of the arguments and the corresponding C values. 
+       This gives the full context of the call to the reverse converter */
+    SEXP        allArgs;
+    void      **cargs;
+    int         nargs;
+  };
+
+
+
+  /* Internal mechanism for employing the converter mechanism, used in do_dotCode() in dotcode.c */
+  void *Rf_convertToC(SEXP s, R_CConvertInfo *info, int *success, R_toCConverter **converter);
+
+  /* Converter management facilities. */
+  R_toCConverter *R_addToCConverter(R_ToCPredicate match, R_ToCConverter converter,
+				    R_FromCConverter reverse, 
+				    void *userData, char *desc);
+  R_toCConverter *R_getToCConverterByIndex(int which);
+  R_toCConverter *R_getToCConverterByDescription(const char *desc);
+  void R_removeToCConverter(R_toCConverter *el);
+
+  Rboolean R_converterMatchClass(SEXP obj, R_CConvertInfo *inf, R_toCConverter *el);
+  void freeCConverter(R_toCConverter *el);
+
+  /* The routines corresponding to the .Internal() providing access to the
+     management facilities of the converter list.
+  */
+  SEXP do_getNumRtoCConverters(SEXP call, SEXP op, SEXP args, SEXP env);
+  SEXP do_getRtoCConverterDescriptions(SEXP call, SEXP op, SEXP args, SEXP env);
+  SEXP do_getRtoCConverterStatus(SEXP call, SEXP op, SEXP args, SEXP env);
+  SEXP do_setToCConverterActiveStatus(SEXP call, SEXP op, SEXP args, SEXP env);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* R_CCONVERTERS_H */
diff --git a/sourcecodes/localscore/RS.h b/sourcecodes/localscore/RS.h
new file mode 100644
index 00000000..e8ce2ef2
--- /dev/null
+++ b/sourcecodes/localscore/RS.h
@@ -0,0 +1,96 @@
+/*
+ *  R : A Computer Language for Statistical Data Analysis
+ *  Copyright (C) 1999-2007 The R Core Team.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation; either version 2.1 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this program; if not, a copy is available at
+ *  http://www.r-project.org/Licenses/
+ */
+
+/* Included by R.h: API */
+
+#ifndef R_RS_H
+#define R_RS_H
+
+#ifndef NO_C_HEADERS
+# include <string.h>		/* for memcpy */
+#endif
+
+#include "Rconfig.h"		/* for F77_APPEND_UNDERSCORE */
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+/* S Like Error Handling */
+
+#include "Error.h"	/* for error and warning */
+
+#ifndef STRICT_R_HEADERS
+
+#define R_PROBLEM_BUFSIZE	4096
+/* Parentheses added for FC4 with gcc4 and -D_FORTIFY_SOURCE=2 */
+#define PROBLEM			{char R_problem_buf[R_PROBLEM_BUFSIZE];(sprintf)(R_problem_buf,
+#define MESSAGE                 {char R_problem_buf[R_PROBLEM_BUFSIZE];(sprintf)(R_problem_buf,
+#define ERROR			),error(R_problem_buf);}
+#define RECOVER(x)		),error(R_problem_buf);}
+#define WARNING(x)		),warning(R_problem_buf);}
+#define LOCAL_EVALUATOR		/**/
+#define NULL_ENTRY		/**/
+#define WARN			WARNING(NULL)
+
+#endif
+
+/* S Like Memory Management */
+
+extern void *R_chk_calloc(size_t, size_t);
+extern void *R_chk_realloc(void *, size_t);
+extern void R_chk_free(void *);
+
+#ifndef STRICT_R_HEADERS
+/* S-PLUS 3.x but not 5.x NULLs the pointer in the following */
+#define Calloc(n, t)   (t *) R_chk_calloc( (size_t) (n), sizeof(t) )
+#define Realloc(p,n,t) (t *) R_chk_realloc( (void *)(p), (size_t)((n) * sizeof(t)) )
+#define Free(p)        (R_chk_free( (void *)(p) ), (p) = NULL)
+#endif
+#define R_Calloc(n, t)   (t *) R_chk_calloc( (size_t) (n), sizeof(t) )
+#define R_Realloc(p,n,t) (t *) R_chk_realloc( (void *)(p), (size_t)((n) * sizeof(t)) )
+#define R_Free(p)      (R_chk_free( (void *)(p) ), (p) = NULL)
+
+#define Memcpy(p,q,n)  memcpy( p, q, (size_t)( (n) * sizeof(*p) ) )
+
+#define CallocCharBuf(n) (char *) R_chk_calloc((size_t) ((n)+1), sizeof(char))
+
+/* S Like Fortran Interface */
+/* These may not be adequate everywhere. Convex had _ prepending common
+   blocks, and some compilers may need to specify Fortran linkage */
+
+#ifdef HAVE_F77_UNDERSCORE
+# define F77_CALL(x)	x ## _
+#else
+# define F77_CALL(x)	x
+#endif
+#define F77_NAME(x)    F77_CALL(x)
+#define F77_SUB(x)     F77_CALL(x)
+#define F77_COM(x)     F77_CALL(x)
+#define F77_COMDECL(x) F77_CALL(x)
+
+#ifndef NO_CALL_R
+void	call_R(char*, long, void**, char**, long*, char**, long, char**);
+#endif
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif /* R_RS_H */
diff --git a/sourcecodes/localscore/RStartup.h b/sourcecodes/localscore/RStartup.h
new file mode 100644
index 00000000..5b89e7fe
--- /dev/null
+++ b/sourcecodes/localscore/RStartup.h
@@ -0,0 +1,107 @@
+/*
+ *  R : A Computer Language for Statistical Data Analysis
+ *  Copyright (C) 1999-2010  The R Core Team
+ *
+ *  This program 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.
+ *
+ *  This program 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 this program; if not, a copy is available at
+ *  http://www.r-project.org/Licenses/
+ */
+
+/*
+  C functions to be called from alternative front-ends.
+
+  Part of the API for such front-ends but not for packages.
+*/
+
+#ifndef R_EXT_RSTARTUP_H_
+#define R_EXT_RSTARTUP_H_
+
+#include <R_ext/Boolean.h>	/* TRUE/FALSE */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef Win32
+typedef int (*blah1) (const char *, char *, int, int);
+typedef void (*blah2) (const char *, int);
+typedef void (*blah3) (void);
+typedef void (*blah4) (const char *);
+/* Return value here is expected to be 1 for Yes, -1 for No and 0 for Cancel:
+   symbolic constants in graphapp.h */
+typedef int (*blah5) (const char *);
+typedef void (*blah6) (int);
+typedef void (*blah7) (const char *, int, int);
+typedef enum {RGui, RTerm, LinkDLL} UImode;
+#endif
+
+/* Startup Actions */
+typedef enum {
+    SA_NORESTORE,/* = 0 */
+    SA_RESTORE,
+    SA_DEFAULT,/* was === SA_RESTORE */
+    SA_NOSAVE,
+    SA_SAVE,
+    SA_SAVEASK,
+    SA_SUICIDE
+} SA_TYPE;
+
+typedef struct
+{
+    Rboolean R_Quiet;
+    Rboolean R_Slave;
+    Rboolean R_Interactive;
+    Rboolean R_Verbose;
+    Rboolean LoadSiteFile;
+    Rboolean LoadInitFile;
+    Rboolean DebugInitFile;
+    SA_TYPE RestoreAction;
+    SA_TYPE SaveAction;
+    size_t vsize;
+    size_t nsize;
+    size_t max_vsize;
+    size_t max_nsize;
+    size_t ppsize;
+    int NoRenviron;
+
+#ifdef Win32
+    char *rhome;               /* R_HOME */
+    char *home;                /* HOME  */
+    blah1 ReadConsole;
+    blah2 WriteConsole;
+    blah3 CallBack;
+    blah4 ShowMessage;
+    blah5 YesNoCancel;
+    blah6 Busy;
+    UImode CharacterMode;
+    blah7 WriteConsoleEx; /* used only if WriteConsole is NULL */
+#endif
+} structRstart;
+
+typedef structRstart *Rstart;
+
+void R_DefParams(Rstart);
+void R_SetParams(Rstart);
+void R_SetWin32(Rstart);
+void R_SizeFromEnv(Rstart);
+void R_common_command_line(int *, char **, Rstart);
+
+void R_set_command_line_arguments(int argc, char **argv);
+
+void setup_Rmainloop(void); // also in Rembedded.h
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/sourcecodes/localscore/Random.h b/sourcecodes/localscore/Random.h
new file mode 100644
index 00000000..1615778d
--- /dev/null
+++ b/sourcecodes/localscore/Random.h
@@ -0,0 +1,75 @@
+/*
+ *  R : A Computer Language for Statistical Data Analysis
+ *  Copyright (C) 1998-2011    The R Core Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation; either version 2.1 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this program; if not, a copy is available at
+ *  http://www.r-project.org/Licenses/
+ */
+
+/* Included by R.h: API */
+
+#ifndef R_RANDOM_H
+#define R_RANDOM_H
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+#include "Boolean.h"
+
+typedef enum {
+    WICHMANN_HILL,
+    MARSAGLIA_MULTICARRY,
+    SUPER_DUPER,
+    MERSENNE_TWISTER,
+    KNUTH_TAOCP,
+    USER_UNIF,
+    KNUTH_TAOCP2,
+    LECUYER_CMRG
+} RNGtype;
+
+/* Different kinds of "N(0,1)" generators :*/
+typedef enum {
+    BUGGY_KINDERMAN_RAMAGE,
+    AHRENS_DIETER,
+    BOX_MULLER,
+    USER_NORM,
+    INVERSION,
+    KINDERMAN_RAMAGE
+} N01type;
+
+
+void GetRNGstate(void);
+void PutRNGstate(void);
+
+double unif_rand(void);
+/* These are also defined in Rmath.h */
+double norm_rand(void);
+double exp_rand(void);
+
+typedef unsigned int Int32;
+double * user_unif_rand(void);
+void user_unif_init(Int32);
+int * user_unif_nseed(void);
+int * user_unif_seedloc(void);
+
+double * user_norm_rand(void);
+
+void FixupProb(double *, int, int, Rboolean);
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif /* R_RANDOM_H */
diff --git a/sourcecodes/localscore/Rconfig.h b/sourcecodes/localscore/Rconfig.h
new file mode 100644
index 00000000..2541c8a9
--- /dev/null
+++ b/sourcecodes/localscore/Rconfig.h
@@ -0,0 +1,20 @@
+/* Rconfig.h.  Generated automatically */
+#ifndef R_RCONFIG_H
+#define R_RCONFIG_H
+
+#ifndef R_CONFIG_H
+
+#define HAVE_F77_UNDERSCORE 1
+#define IEEE_754 1
+/* #undef WORDS_BIGENDIAN */
+#define R_INLINE inline
+#define HAVE_VISIBILITY_ATTRIBUTE 1
+#define SUPPORT_UTF8 1
+#define SUPPORT_MBCS 1
+#define ENABLE_NLS 1
+/* #undef HAVE_AQUA */
+#define SUPPORT_OPENMP 1
+
+#endif /* not R_CONFIG_H */
+
+#endif /* not R_RCONFIG_H */
diff --git a/sourcecodes/localscore/Rdynload.h b/sourcecodes/localscore/Rdynload.h
new file mode 100644
index 00000000..982b571a
--- /dev/null
+++ b/sourcecodes/localscore/Rdynload.h
@@ -0,0 +1,129 @@
+/*
+ *  R : A Computer Language for Statistical Data Analysis
+ *  Copyright (C) 2001-12  The R Core Team.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation; either version 2.1 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this program; if not, a copy is available at
+ *  http://www.r-project.org/Licenses/
+ */
+
+/*
+  C functions used to register compiled code in packages.
+
+  Those needed for that purpose are part of the API.
+ */
+
+#ifndef  R_EXT_DYNLOAD_H_
+#define  R_EXT_DYNLOAD_H_
+
+#include <R_ext/Boolean.h>
+
+/* called with a variable argument set */
+typedef void * (*DL_FUNC)();
+
+typedef unsigned int R_NativePrimitiveArgType;
+
+#define SINGLESXP 302 /* Don't have a single type for this. */
+
+/* In the future, we will want to allow people register their own types
+   and then refer to these in other contexts. Something like the Gtk type 
+   system may be appropriate.
+*/
+typedef unsigned int R_NativeObjectArgType;
+
+
+/* In the near future, we may support registering 
+   information about the arguments of native routines 
+   and whether they are used to return information.
+   The hope is that we can minimize copying objects even 
+   further. Not currently in use.
+*/
+typedef enum {R_ARG_IN, R_ARG_OUT, R_ARG_IN_OUT, R_IRRELEVANT} R_NativeArgStyle;
+
+
+
+/* 
+ These are very similar to those in  unix/dynload.c
+ but we maintain them separately to give us more freedom to do
+ some computations on the internal versions that are derived from
+ these definitions.
+*/
+typedef struct {
+    const char *name;
+    DL_FUNC     fun;
+    int         numArgs;
+  
+    R_NativePrimitiveArgType *types;
+    R_NativeArgStyle         *styles; 
+    
+} R_CMethodDef;
+
+typedef R_CMethodDef R_FortranMethodDef;
+
+
+
+typedef struct {
+    const char *name;
+    DL_FUNC     fun;
+    int         numArgs;
+/* In the future, we will put types in here for the different arguments.
+   We need a richer type system to do this effectively so that one
+   can specify types for new classes.
+*/
+} R_CallMethodDef;
+typedef R_CallMethodDef R_ExternalMethodDef;
+
+
+typedef struct _DllInfo DllInfo;
+
+/* 
+  Currently ignore the graphics routines, accessible via .External.graphics()
+  and .Call.graphics().
+ */
+#ifdef __cplusplus 
+extern "C" {
+#endif
+int R_registerRoutines(DllInfo *info, const R_CMethodDef * const croutines,
+		       const R_CallMethodDef * const callRoutines, 
+		       const R_FortranMethodDef * const fortranRoutines,
+                       const R_ExternalMethodDef * const externalRoutines);
+
+Rboolean R_useDynamicSymbols(DllInfo *info, Rboolean value);
+
+DllInfo *R_getDllInfo(const char *name);
+
+/* to be used by applications embedding R to register their symbols
+   that are not related to any dynamic module */
+DllInfo *R_getEmbeddingDllInfo(void);
+
+typedef struct Rf_RegisteredNativeSymbol R_RegisteredNativeSymbol;
+typedef enum {R_ANY_SYM=0, R_C_SYM, R_CALL_SYM, R_FORTRAN_SYM, R_EXTERNAL_SYM} NativeSymbolType;
+
+
+DL_FUNC R_FindSymbol(char const *, char const *, 
+                       R_RegisteredNativeSymbol *symbol);
+
+
+/* Experimental interface for exporting and importing functions from
+   one package for use from C code in a package.  The registration
+   part probably ought to be integrated with the other registrations.
+   The naming of these routines may be less than ideal. */
+
+void R_RegisterCCallable(const char *package, const char *name, DL_FUNC fptr);
+DL_FUNC R_GetCCallable(const char *package, const char *name);
+
+#ifdef __cplusplus 
+}
+#endif
+
+#endif /* R_EXT_DYNLOAD_H_ */
diff --git a/sourcecodes/localscore/Riconv.h b/sourcecodes/localscore/Riconv.h
new file mode 100644
index 00000000..13864ee6
--- /dev/null
+++ b/sourcecodes/localscore/Riconv.h
@@ -0,0 +1,46 @@
+/*
+ *  R : A Computer Language for Statistical Data Analysis
+ *  Copyright (C) 2005     the R Core Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation; either version 2.1 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this program; if not, a copy is available at
+ *  http://www.r-project.org/Licenses/
+ */
+
+/*
+  Interface to R's platform-independent implementation of iconv.
+
+  Part of the API.
+*/
+
+#ifndef R_ICONV_H
+#define R_ICONV_H
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+/* from sysutils.c */
+#undef Riconv_open
+#undef Riconv
+#undef Riconv_close
+void * Riconv_open (const char* tocode, const char* fromcode);
+size_t Riconv (void * cd, const char **inbuf, size_t *inbytesleft,
+	       char  **outbuf, size_t *outbytesleft);
+int Riconv_close (void * cd);
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif /* R_ICONV_H */
diff --git a/sourcecodes/localscore/Rmath.h b/sourcecodes/localscore/Rmath.h
new file mode 100644
index 00000000..1acd1dbb
--- /dev/null
+++ b/sourcecodes/localscore/Rmath.h
@@ -0,0 +1,657 @@
+/* -*- C -*-
+ *  Mathlib : A C Library of Special Functions
+ *  Copyright (C) 1998-2011  The R Core Team
+ *  Copyright (C) 2004       The R Foundation
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation; either version 2.1 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this program; if not, a copy is available at
+ *  http://www.r-project.org/Licenses/
+ *
+
+ * Rmath.h  should contain ALL headers from R's C code in `src/nmath'
+   -------  such that ``the Math library'' can be used by simply
+
+   ``#include <Rmath.h> ''
+
+   and nothing else.
+
+   It is part of the API and supports 'standalone Rmath'.
+
+*/
+#ifndef RMATH_H
+#define RMATH_H
+
+/* Note that on some systems we need to include math.h before the
+   defines below, to avoid redefining ftrunc */
+#ifndef NO_C_HEADERS
+# include <math.h>
+#endif
+
+/*-- Mathlib as part of R --  define this for standalone : */
+/* #undef MATHLIB_STANDALONE */
+
+#define R_VERSION_STRING "2.15.2"
+
+#ifndef HAVE_EXPM1
+# define HAVE_EXPM1 1
+#endif
+
+#ifndef HAVE_HYPOT
+# define HAVE_HYPOT 1
+#endif
+
+#ifndef HAVE_LOG1P
+# define HAVE_LOG1P 1
+#endif
+
+#ifndef HAVE_WORKING_LOG1P
+# define HAVE_WORKING_LOG1P 1
+#endif
+
+#if defined(HAVE_LOG1P) && !defined(HAVE_WORKING_LOG1P)
+/* remap to avoid problems with getting the right entry point */
+double  Rlog1p(double);
+#define log1p Rlog1p
+#endif
+
+
+	/* Undo SGI Madness */
+
+#ifdef ftrunc
+# undef ftrunc
+#endif
+#ifdef qexp
+# undef qexp
+#endif
+#ifdef qgamma
+# undef qgamma
+#endif
+
+
+/* ----- The following constants and entry points are part of the R API ---- */
+
+/* 30 Decimal-place constants */
+/* Computed with bc -l (scale=32; proper round) */
+
+/* SVID & X/Open Constants */
+/* Names from Solaris math.h */
+
+#ifndef M_E
+#define M_E		2.718281828459045235360287471353	/* e */
+#endif
+
+#ifndef M_LOG2E
+#define M_LOG2E		1.442695040888963407359924681002	/* log2(e) */
+#endif
+
+#ifndef M_LOG10E
+#define M_LOG10E	0.434294481903251827651128918917	/* log10(e) */
+#endif
+
+#ifndef M_LN2
+#define M_LN2		0.693147180559945309417232121458	/* ln(2) */
+#endif
+
+#ifndef M_LN10
+#define M_LN10		2.302585092994045684017991454684	/* ln(10) */
+#endif
+
+#ifndef M_PI
+#define M_PI		3.141592653589793238462643383280	/* pi */
+#endif
+
+#ifndef M_2PI
+#define M_2PI		6.283185307179586476925286766559	/* 2*pi */
+#endif
+
+#ifndef M_PI_2
+#define M_PI_2		1.570796326794896619231321691640	/* pi/2 */
+#endif
+
+#ifndef M_PI_4
+#define M_PI_4		0.785398163397448309615660845820	/* pi/4 */
+#endif
+
+#ifndef M_1_PI
+#define M_1_PI		0.318309886183790671537767526745	/* 1/pi */
+#endif
+
+#ifndef M_2_PI
+#define M_2_PI		0.636619772367581343075535053490	/* 2/pi */
+#endif
+
+#ifndef M_2_SQRTPI
+#define M_2_SQRTPI	1.128379167095512573896158903122	/* 2/sqrt(pi) */
+#endif
+
+#ifndef M_SQRT2
+#define M_SQRT2		1.414213562373095048801688724210	/* sqrt(2) */
+#endif
+
+#ifndef M_SQRT1_2
+#define M_SQRT1_2	0.707106781186547524400844362105	/* 1/sqrt(2) */
+#endif
+
+/* R-Specific Constants */
+
+#ifndef M_SQRT_3
+#define M_SQRT_3	1.732050807568877293527446341506	/* sqrt(3) */
+#endif
+
+#ifndef M_SQRT_32
+#define M_SQRT_32	5.656854249492380195206754896838	/* sqrt(32) */
+#endif
+
+#ifndef M_LOG10_2
+#define M_LOG10_2	0.301029995663981195213738894724	/* log10(2) */
+#endif
+
+#ifndef M_SQRT_PI
+#define M_SQRT_PI	1.772453850905516027298167483341	/* sqrt(pi) */
+#endif
+
+#ifndef M_1_SQRT_2PI
+#define M_1_SQRT_2PI	0.398942280401432677939946059934	/* 1/sqrt(2pi) */
+#endif
+
+#ifndef M_SQRT_2dPI
+#define M_SQRT_2dPI	0.797884560802865355879892119869	/* sqrt(2/pi) */
+#endif
+
+
+#ifndef M_LN_SQRT_PI
+#define M_LN_SQRT_PI	0.572364942924700087071713675677	/* log(sqrt(pi))
+								   == log(pi)/2 */
+#endif
+
+#ifndef M_LN_SQRT_2PI
+#define M_LN_SQRT_2PI	0.918938533204672741780329736406	/* log(sqrt(2*pi))
+								 == log(2*pi)/2 */
+#endif
+
+#ifndef M_LN_SQRT_PId2
+#define M_LN_SQRT_PId2	0.225791352644727432363097614947	/* log(sqrt(pi/2)) */
+#endif
+
+
+#ifdef MATHLIB_STANDALONE
+# ifndef R_EXT_BOOLEAN_H_
+/* "copy-paste" R_ext/Boolean.h if not already included: */
+ #define R_EXT_BOOLEAN_H_
+ #undef FALSE
+ #undef TRUE
+ typedef enum { FALSE = 0, TRUE } Rboolean;
+# endif
+#else
+# include "Boolean.h"
+#endif
+
+
+#ifndef MATHLIB_STANDALONE
+#define bessel_i	Rf_bessel_i
+#define bessel_j	Rf_bessel_j
+#define bessel_k	Rf_bessel_k
+#define bessel_y	Rf_bessel_y
+#define bessel_i_ex	Rf_bessel_i_ex
+#define bessel_j_ex	Rf_bessel_j_ex
+#define bessel_k_ex	Rf_bessel_k_ex
+#define bessel_y_ex	Rf_bessel_y_ex
+#define beta		Rf_beta
+#define choose		Rf_choose
+#define dbeta		Rf_dbeta
+#define dbinom		Rf_dbinom
+#define dcauchy		Rf_dcauchy
+#define dchisq		Rf_dchisq
+#define dexp		Rf_dexp
+#define df		Rf_df
+#define dgamma		Rf_dgamma
+#define dgeom		Rf_dgeom
+#define dhyper		Rf_dhyper
+#define digamma		Rf_digamma
+#define dlnorm		Rf_dlnorm
+#define dlogis		Rf_dlogis
+#define dnbeta		Rf_dnbeta
+#define dnbinom		Rf_dnbinom
+#define dnchisq		Rf_dnchisq
+#define dnf		Rf_dnf
+#define dnorm4		Rf_dnorm4
+#define dnt		Rf_dnt
+#define dpois		Rf_dpois
+#define dpsifn		Rf_dpsifn
+#define dsignrank	Rf_dsignrank
+#define dt		Rf_dt
+#define dtukey		Rf_dtukey
+#define dunif		Rf_dunif
+#define dweibull	Rf_dweibull
+#define dwilcox		Rf_dwilcox
+#define fmax2		Rf_fmax2
+#define fmin2		Rf_fmin2
+#define fprec		Rf_fprec
+#define fround		Rf_fround
+#define ftrunc		Rf_ftrunc
+#define fsign		Rf_fsign
+#define gammafn		Rf_gammafn
+#define imax2		Rf_imax2
+#define imin2		Rf_imin2
+#define lbeta		Rf_lbeta
+#define lchoose		Rf_lchoose
+#define lgammafn	Rf_lgammafn
+#define lgammafn_sign	Rf_lgammafn_sign
+#define lgamma1p	Rf_lgamma1p
+#define log1pmx		Rf_log1pmx
+#define logspace_add	Rf_logspace_add
+#define logspace_sub	Rf_logspace_sub
+#define pbeta		Rf_pbeta
+#define pbeta_raw	Rf_pbeta_raw
+#define pbinom		Rf_pbinom
+#define pcauchy		Rf_pcauchy
+#define pchisq		Rf_pchisq
+#define pentagamma	Rf_pentagamma
+#define pexp		Rf_pexp
+#define pf		Rf_pf
+#define pgamma		Rf_pgamma
+#define pgeom		Rf_pgeom
+#define phyper		Rf_phyper
+#define plnorm		Rf_plnorm
+#define plogis		Rf_plogis
+#define pnbeta		Rf_pnbeta
+#define pnbinom		Rf_pnbinom
+#define pnchisq		Rf_pnchisq
+#define pnf		Rf_pnf
+#define pnorm5		Rf_pnorm5
+#define pnorm_both	Rf_pnorm_both
+#define pnt		Rf_pnt
+#define ppois		Rf_ppois
+#define psignrank	Rf_psignrank
+#define psigamma	Rf_psigamma
+#define pt		Rf_pt
+#define ptukey		Rf_ptukey
+#define punif		Rf_punif
+#define pythag		Rf_pythag
+#define pweibull	Rf_pweibull
+#define pwilcox		Rf_pwilcox
+#define qbeta		Rf_qbeta
+#define qbinom		Rf_qbinom
+#define qcauchy		Rf_qcauchy
+#define qchisq		Rf_qchisq
+#define qchisq_appr	Rf_qchisq_appr
+#define qexp		Rf_qexp
+#define qf		Rf_qf
+#define qgamma		Rf_qgamma
+#define qgeom		Rf_qgeom
+#define qhyper		Rf_qhyper
+#define qlnorm		Rf_qlnorm
+#define qlogis		Rf_qlogis
+#define qnbeta		Rf_qnbeta
+#define qnbinom		Rf_qnbinom
+#define qnchisq		Rf_qnchisq
+#define qnf		Rf_qnf
+#define qnorm5		Rf_qnorm5
+#define qnt		Rf_qnt
+#define qpois		Rf_qpois
+#define qsignrank	Rf_qsignrank
+#define qt		Rf_qt
+#define qtukey		Rf_qtukey
+#define qunif		Rf_qunif
+#define qweibull	Rf_qweibull
+#define qwilcox		Rf_qwilcox
+#define rbeta		Rf_rbeta
+#define rbinom		Rf_rbinom
+#define rcauchy		Rf_rcauchy
+#define rchisq		Rf_rchisq
+#define rexp		Rf_rexp
+#define rf		Rf_rf
+#define rgamma		Rf_rgamma
+#define rgeom		Rf_rgeom
+#define rhyper		Rf_rhyper
+#define rlnorm		Rf_rlnorm
+#define rlogis		Rf_rlogis
+#define rnbeta		Rf_rnbeta
+#define rnbinom		Rf_rnbinom
+#define rnchisq		Rf_rnchisq
+#define rnf		Rf_rnf
+#define rnorm		Rf_rnorm
+#define rnt		Rf_rnt
+#define rpois		Rf_rpois
+#define rsignrank	Rf_rsignrank
+#define rt		Rf_rt
+#define rtukey		Rf_rtukey
+#define runif		Rf_runif
+#define rweibull	Rf_rweibull
+#define rwilcox		Rf_rwilcox
+#define sign		Rf_sign
+#define tetragamma	Rf_tetragamma
+#define trigamma	Rf_trigamma
+#endif
+
+#define	rround	fround
+#define	prec	fprec
+#undef trunc
+#define	trunc	ftrunc
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+	/* R's versions with !R_FINITE checks */
+
+double R_pow(double x, double y);
+double R_pow_di(double, int);
+
+	/* Random Number Generators */
+
+double	norm_rand(void);
+double	unif_rand(void);
+double	exp_rand(void);
+#ifdef MATHLIB_STANDALONE
+void	set_seed(unsigned int, unsigned int);
+void	get_seed(unsigned int *, unsigned int *);
+#endif
+
+	/* Normal Distribution */
+
+#define pnorm pnorm5
+#define qnorm qnorm5
+#define dnorm dnorm4
+
+double	dnorm(double, double, double, int);
+double	pnorm(double, double, double, int, int);
+double	qnorm(double, double, double, int, int);
+double	rnorm(double, double);
+void	pnorm_both(double, double *, double *, int, int);/* both tails */
+
+	/* Uniform Distribution */
+
+double	dunif(double, double, double, int);
+double	punif(double, double, double, int, int);
+double	qunif(double, double, double, int, int);
+double	runif(double, double);
+
+	/* Gamma Distribution */
+
+double	dgamma(double, double, double, int);
+double	pgamma(double, double, double, int, int);
+double	qgamma(double, double, double, int, int);
+double	rgamma(double, double);
+
+double  log1pmx(double);
+double  log1pexp(double); // <-- ../nmath/plogis.c
+double  lgamma1p(double);
+double  logspace_add(double, double);
+double  logspace_sub(double, double);
+
+	/* Beta Distribution */
+
+double	dbeta(double, double, double, int);
+double	pbeta(double, double, double, int, int);
+double	qbeta(double, double, double, int, int);
+double	rbeta(double, double);
+
+	/* Lognormal Distribution */
+
+double	dlnorm(double, double, double, int);
+double	plnorm(double, double, double, int, int);
+double	qlnorm(double, double, double, int, int);
+double	rlnorm(double, double);
+
+	/* Chi-squared Distribution */
+
+double	dchisq(double, double, int);
+double	pchisq(double, double, int, int);
+double	qchisq(double, double, int, int);
+double	rchisq(double);
+
+	/* Non-central Chi-squared Distribution */
+
+double	dnchisq(double, double, double, int);
+double	pnchisq(double, double, double, int, int);
+double	qnchisq(double, double, double, int, int);
+double	rnchisq(double, double);
+
+	/* F Distibution */
+
+double	df(double, double, double, int);
+double	pf(double, double, double, int, int);
+double	qf(double, double, double, int, int);
+double	rf(double, double);
+
+	/* Student t Distibution */
+
+double	dt(double, double, int);
+double	pt(double, double, int, int);
+double	qt(double, double, int, int);
+double	rt(double);
+
+	/* Binomial Distribution */
+
+double	dbinom(double, double, double, int);
+double	pbinom(double, double, double, int, int);
+double	qbinom(double, double, double, int, int);
+double	rbinom(double, double);
+
+	/* Multnomial Distribution */
+
+void	rmultinom(int, double*, int, int*);
+
+	/* Cauchy Distribution */
+
+double	dcauchy(double, double, double, int);
+double	pcauchy(double, double, double, int, int);
+double	qcauchy(double, double, double, int, int);
+double	rcauchy(double, double);
+
+	/* Exponential Distribution */
+
+double	dexp(double, double, int);
+double	pexp(double, double, int, int);
+double	qexp(double, double, int, int);
+double	rexp(double);
+
+	/* Geometric Distribution */
+
+double	dgeom(double, double, int);
+double	pgeom(double, double, int, int);
+double	qgeom(double, double, int, int);
+double	rgeom(double);
+
+	/* Hypergeometric Distibution */
+
+double	dhyper(double, double, double, double, int);
+double	phyper(double, double, double, double, int, int);
+double	qhyper(double, double, double, double, int, int);
+double	rhyper(double, double, double);
+
+	/* Negative Binomial Distribution */
+
+double	dnbinom(double, double, double, int);
+double	pnbinom(double, double, double, int, int);
+double	qnbinom(double, double, double, int, int);
+double	rnbinom(double, double);
+
+double	dnbinom_mu(double, double, double, int);
+double	pnbinom_mu(double, double, double, int, int);
+double	qnbinom_mu(double, double, double, int, int);
+double	rnbinom_mu(double, double);
+
+	/* Poisson Distribution */
+
+double	dpois(double, double, int);
+double	ppois(double, double, int, int);
+double	qpois(double, double, int, int);
+double	rpois(double);
+
+	/* Weibull Distribution */
+
+double	dweibull(double, double, double, int);
+double	pweibull(double, double, double, int, int);
+double	qweibull(double, double, double, int, int);
+double	rweibull(double, double);
+
+	/* Logistic Distribution */
+
+double	dlogis(double, double, double, int);
+double	plogis(double, double, double, int, int);
+double	qlogis(double, double, double, int, int);
+double	rlogis(double, double);
+
+	/* Non-central Beta Distribution */
+
+double	dnbeta(double, double, double, double, int);
+double	pnbeta(double, double, double, double, int, int);
+double	qnbeta(double, double, double, double, int, int);
+double	rnbeta(double, double, double);
+
+	/* Non-central F Distribution */
+
+double  dnf(double, double, double, double, int);
+double	pnf(double, double, double, double, int, int);
+double	qnf(double, double, double, double, int, int);
+
+	/* Non-central Student t Distribution */
+
+double	dnt(double, double, double, int);
+double	pnt(double, double, double, int, int);
+double	qnt(double, double, double, int, int);
+
+	/* Studentized Range Distribution */
+
+double	ptukey(double, double, double, double, int, int);
+double	qtukey(double, double, double, double, int, int);
+
+	/* Wilcoxon Rank Sum Distribution */
+
+double dwilcox(double, double, double, int);
+double pwilcox(double, double, double, int, int);
+double qwilcox(double, double, double, int, int);
+double rwilcox(double, double);
+
+	/* Wilcoxon Signed Rank Distribution */
+
+double dsignrank(double, double, int);
+double psignrank(double, double, int, int);
+double qsignrank(double, double, int, int);
+double rsignrank(double);
+
+	/* Gamma and Related Functions */
+double	gammafn(double);
+double	lgammafn(double);
+double	lgammafn_sign(double, int*);
+void    dpsifn(double, int, int, int, double*, int*, int*);
+double	psigamma(double, double);
+double	digamma(double);
+double	trigamma(double);
+double	tetragamma(double);
+double	pentagamma(double);
+
+double	beta(double, double);
+double	lbeta(double, double);
+
+double	choose(double, double);
+double	lchoose(double, double);
+
+	/* Bessel Functions */
+
+double	bessel_i(double, double, double);
+double	bessel_j(double, double);
+double	bessel_k(double, double, double);
+double	bessel_y(double, double);
+double	bessel_i_ex(double, double, double, double *);
+double	bessel_j_ex(double, double, double *);
+double	bessel_k_ex(double, double, double, double *);
+double	bessel_y_ex(double, double, double *);
+
+
+	/* General Support Functions */
+
+#ifndef HAVE_HYPOT
+double 	hypot(double, double);
+#endif
+double 	pythag(double, double);
+#ifndef HAVE_EXPM1
+double  expm1(double); /* = exp(x)-1 {care for small x} */
+#endif
+#ifndef HAVE_LOG1P
+double  log1p(double); /* = log(1+x) {care for small x} */
+#endif
+int	imax2(int, int);
+int	imin2(int, int);
+double	fmax2(double, double);
+double	fmin2(double, double);
+double	sign(double);
+double	fprec(double, double);
+double	fround(double, double);
+double	fsign(double, double);
+double	ftrunc(double);
+
+double  log1pmx(double); /* Accurate log(1+x) - x, {care for small x} */
+double  lgamma1p(double);/* accurate log(gamma(x+1)), small x (0 < x < 0.5) */
+
+/* Compute the log of a sum or difference from logs of terms, i.e.,
+ *
+ *     log (exp (logx) + exp (logy))
+ * or  log (exp (logx) - exp (logy))
+ *
+ * without causing overflows or throwing away too much accuracy:
+ */
+double  logspace_add(double logx, double logy);
+double  logspace_sub(double logx, double logy);
+
+
+
+
+/* ----------------- Private part of the header file ------------------- */
+
+	/* old-R Compatibility */
+
+#ifdef OLD_RMATH_COMPAT
+# define snorm	norm_rand
+# define sunif	unif_rand
+# define sexp	exp_rand
+#endif
+
+#if defined(MATHLIB_STANDALONE) && !defined(MATHLIB_PRIVATE_H)
+/* second is defined by nmath.h */
+
+/* If isnan is a macro, as C99 specifies, the C++
+   math header will undefine it. This happens on OS X */
+# ifdef __cplusplus
+  int R_isnancpp(double); /* in mlutils.c */
+#  define ISNAN(x)     R_isnancpp(x)
+# else
+#  define ISNAN(x)     (isnan(x)!=0)
+# endif
+
+# define R_FINITE(x)    R_finite(x)
+int R_finite(double);
+
+# ifdef WIN32  /* not Win32 as no config information */
+#  ifdef RMATH_DLL
+#   define R_EXTERN extern __declspec(dllimport)
+#  else
+#   define R_EXTERN extern
+#  endif
+R_EXTERN double NA_REAL;
+R_EXTERN double R_PosInf;
+R_EXTERN double R_NegInf;
+R_EXTERN int N01_kind;
+#  undef R_EXTERN
+#else
+extern int N01_kind;
+# endif
+
+#endif /* MATHLIB_STANDALONE */
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif /* RMATH_H */
diff --git a/sourcecodes/localscore/Utils.h b/sourcecodes/localscore/Utils.h
new file mode 100644
index 00000000..61efaaaa
--- /dev/null
+++ b/sourcecodes/localscore/Utils.h
@@ -0,0 +1,115 @@
+/*
+ *  R : A Computer Language for Statistical Data Analysis
+ *  Copyright (C) 1998-2005    The R Core Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation; either version 2.1 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this program; if not, a copy is available at
+ *  http://www.r-project.org/Licenses/
+ *
+ *
+ * Generally useful  UTILITIES  *NOT* relying on R internals (from Defn.h)
+ */
+
+/* Included by R.h: API */
+
+#ifndef R_EXT_UTILS_H_
+#define R_EXT_UTILS_H_
+
+#include "Boolean.h"
+#include "Complex.h"
+
+#define revsort       Rf_revsort
+#define iPsort        Rf_iPsort
+#define rPsort        Rf_rPsort
+#define cPsort        Rf_cPsort
+#define IndexWidth    Rf_IndexWidth
+#define setIVector    Rf_setIVector
+#define setRVector    Rf_setRVector
+#define StringFalse   Rf_StringFalse
+#define StringTrue    Rf_StringTrue
+#define isBlankString Rf_isBlankString
+#define hsv2rgb       Rf_hsv2rgb
+#define rgb2hsv       Rf_rgb2hsv
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+/* ../../main/sort.c : */
+void	R_isort(int*, int);
+void	R_rsort(double*, int);
+void	R_csort(Rcomplex*, int);
+void    rsort_with_index(double *, int *, int);
+void	revsort(double*, int*, int);/* reverse; sort i[] alongside */
+void	iPsort(int*,    int, int);
+void	rPsort(double*, int, int);
+void	cPsort(Rcomplex*, int, int);
+
+/* ../../main/qsort.c : */
+void R_qsort    (double *v,         int i, int j);
+void R_qsort_I  (double *v, int *I, int i, int j);
+void R_qsort_int  (int *iv,         int i, int j);
+void R_qsort_int_I(int *iv, int *I, int i, int j);
+#ifdef R_RS_H
+void F77_NAME(qsort4)(double *v, int *indx, int *ii, int *jj);
+void F77_NAME(qsort3)(double *v,            int *ii, int *jj);
+#endif
+
+/* ../../main/printutils.c : */
+int	IndexWidth(int);
+/* ../../main/util.c  and others : */
+const char *R_ExpandFileName(const char *);
+void	setIVector(int*, int, int);
+void	setRVector(double*, int, double);
+Rboolean StringFalse(const char *);
+Rboolean StringTrue(const char *);
+Rboolean isBlankString(const char *);
+
+/* These two are guaranteed to use '.' as the decimal point,
+   and to accept "NA".
+ */
+double R_atof(const char *str);
+double R_strtod(const char *c, char **end);
+
+char *R_tmpnam(const char *prefix, const char *tempdir);
+char *R_tmpnam2(const char *prefix, const char *tempdir, const char *fileext);
+
+void	hsv2rgb(double h, double s, double v,
+		double *r, double *g, double *b);
+void	rgb2hsv(double r, double g, double b,
+		double *h, double *s, double *v);
+
+void R_CheckUserInterrupt(void);
+void R_CheckStack(void);
+    
+
+/* ../../appl/interv.c: also in Applic.h */
+int findInterval(double *xt, int n, double x,
+		 Rboolean rightmost_closed,  Rboolean all_inside, int ilo,
+		 int *mflag);
+#ifdef R_RS_H
+int F77_SUB(interv)(double *xt, int *n, double *x,
+		    Rboolean *rightmost_closed, Rboolean *all_inside,
+		    int *ilo, int *mflag);
+#endif
+void find_interv_vec(double *xt, int *n,	double *x,   int *nx,
+		     int *rightmost_closed, int *all_inside, int *indx);
+
+/* ../../appl/maxcol.c: also in Applic.h */
+void R_max_col(double *matrix, int *nr, int *nc, int *maxes, int *ties_meth);
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif /* R_EXT_UTILS_H_ */
diff --git a/sourcecodes/localscore/Visibility.h b/sourcecodes/localscore/Visibility.h
new file mode 100644
index 00000000..aa35e342
--- /dev/null
+++ b/sourcecodes/localscore/Visibility.h
@@ -0,0 +1,39 @@
+/*
+ *  R : A Computer Language for Statistical Data Analysis
+ *  Copyright (C) 2008    the R Core Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation; either version 2.1 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this program; if not, a copy is available at
+ *  http://www.r-project.org/Licenses/
+ */
+
+/*
+  Definitions controlling visibility on some platforms.
+
+  Part of the API.
+*/
+
+#ifndef R_EXT_VISIBILITY_H_
+#define R_EXT_VISIBILITY_H_
+
+#include <Rconfig.h>
+
+#ifdef HAVE_VISIBILITY_ATTRIBUTE
+# define attribute_visible __attribute__ ((visibility ("default")))
+# define attribute_hidden __attribute__ ((visibility ("hidden")))
+#else
+# define attribute_visible
+# define attribute_hidden
+#endif
+
+#endif /* R_EXT_VISIBILITY_H_ */
diff --git a/sourcecodes/localscore/eventloop.h b/sourcecodes/localscore/eventloop.h
new file mode 100644
index 00000000..842cf9bb
--- /dev/null
+++ b/sourcecodes/localscore/eventloop.h
@@ -0,0 +1,97 @@
+/*
+ *  R : A Computer Language for Statistical Data Analysis
+ *  Copyright (C) 2000-2007 The R Core Team.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation; either version 2.1 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this program; if not, a copy is available at
+ *  http://www.r-project.org/Licenses/
+ */
+
+/* 
+   For use by alternative front-ends and packages which need to share
+   the R event loop (on all platforms).
+
+   Not part of the API and subject to change without notice.
+ */
+
+#ifndef R_EXT_EVENTLOOP_H
+#define R_EXT_EVENTLOOP_H
+
+#ifndef NO_C_HEADERS
+#ifdef HAVE_SYS_SELECT_H
+# include <sys/select.h>	/* for fd_set according to recent POSIX */
+#endif
+/* NOTE: Needed at least on FreeBSD so that fd_set is defined. */
+# include <sys/types.h>
+#endif
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+#define XActivity 1
+#define StdinActivity 2
+
+typedef void (*InputHandlerProc)(void *userData); 
+
+typedef struct _InputHandler {
+
+  int activity;
+  int fileDescriptor;
+  InputHandlerProc handler;
+
+  struct _InputHandler *next;
+
+    /* Whether we should be listening to this file descriptor or not. */
+  int active;
+
+    /* Data that can be passed to the routine as its only argument.
+       This might be a user-level function or closure when we implement
+       a callback to R mechanism. 
+     */
+  void *userData;
+
+} InputHandler;
+
+
+extern InputHandler *initStdinHandler(void);
+extern void consoleInputHandler(unsigned char *buf, int len);
+
+extern InputHandler *addInputHandler(InputHandler *handlers, int fd, InputHandlerProc handler, int activity);
+extern InputHandler *getInputHandler(InputHandler *handlers, int fd);
+extern int           removeInputHandler(InputHandler **handlers, InputHandler *it);
+extern InputHandler *getSelectedHandler(InputHandler *handlers, fd_set *mask);
+extern fd_set *R_checkActivity(int usec, int ignore_stdin);
+extern fd_set *R_checkActivityEx(int usec, int ignore_stdin, void (*intr)(void));
+extern void R_runHandlers(InputHandler *handlers, fd_set *mask);
+
+extern int R_SelectEx(int  n,  fd_set  *readfds,  fd_set  *writefds,
+		      fd_set *exceptfds, struct timeval *timeout,
+		      void (*intr)(void));
+
+#ifdef __SYSTEM__
+#ifndef __cplusplus   /* Would get duplicate conflicting symbols*/
+InputHandler *R_InputHandlers;
+#endif
+#else
+extern InputHandler *R_InputHandlers;
+#endif
+
+extern void (* R_PolledEvents)(void);
+extern int R_wait_usec;
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif /* R_EXT_EVENTLOOP_H */
diff --git a/sourcecodes/localscore/index.html b/sourcecodes/localscore/index.html
new file mode 100644
index 00000000..429668c7
--- /dev/null
+++ b/sourcecodes/localscore/index.html
@@ -0,0 +1,6 @@
+<html>
+<head>
+<title>Bayesian Network Web Server</title>
+<meta HTTP-EQUIV="REFRESH" content="0; url=http://compbio.uthsc.edu/BNW/sourcecodes/home.php">
+</head>
+</html>
diff --git a/sourcecodes/localscore/libRmath.so b/sourcecodes/localscore/libRmath.so
new file mode 100644
index 00000000..8c56eb4f
--- /dev/null
+++ b/sourcecodes/localscore/libRmath.so
Binary files differdiff --git a/sourcecodes/localscore/libextern.h b/sourcecodes/localscore/libextern.h
new file mode 100644
index 00000000..3f61fb1e
--- /dev/null
+++ b/sourcecodes/localscore/libextern.h
@@ -0,0 +1,48 @@
+/*
+ *  R : A Computer Language for Statistical Data Analysis
+ *  Copyright (C) 2001, 2004  The R Core Team.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation; either version 2.1 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this program; if not, a copy is available at
+ *  http://www.r-project.org/Licenses/
+ */
+
+/* Included by R.h: API on Windows */
+
+/* don't disallow including this one more than once */
+
+/* This is intended to be called from other header files, so not callable
+   from C++ */
+
+#undef LibExtern
+#undef LibImport
+#undef LibExport
+
+/* Don't try to include CYGWIN here: decorating some symbols breaks
+   the auto-export that it relies on, even if R_DLL_BUILD were set. */
+#ifdef WIN32 /* WIN32 as does not depend on config.h */
+#define LibImport __declspec(dllimport)
+#define LibExport __declspec(dllexport)
+#else
+#define LibImport
+#define LibExport
+#endif
+
+#ifdef __MAIN__
+#define LibExtern LibExport
+#define extern
+#elif defined(R_DLL_BUILD)
+#define LibExtern extern
+#else
+#define LibExtern extern LibImport
+#endif
diff --git a/sourcecodes/localscore/matrix.h b/sourcecodes/localscore/matrix.h
new file mode 100644
index 00000000..b37772b4
--- /dev/null
+++ b/sourcecodes/localscore/matrix.h
@@ -0,0 +1,42 @@
+/*                               -*- Mode: C -*- 
+ * matrix.h --- 
+ * Author          : Claus Dethlefsen
+ * Created On      : Thu Mar 14 06:47:52 2002
+ * Last Modified By: Claus Dethlefsen
+ * Last Modified On: Tue May 07 09:39:46 2002
+ * Update Count    : 22
+ * Status          : Unknown, Use with caution!
+ */
+
+/*
+  ##
+##    Copyright (C) 2002  Susanne Gammelgaard Bøttcher, Claus Dethlefsen
+##
+##    This program 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.
+##
+##    This program 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 this program; if not, write to the Free Software
+##    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+######################################################################
+*/
+
+extern double **   dmatrix( int, int, int, int );
+extern int *       ivector( int, int );
+extern void        free_ivector( int    *, int, int );
+
+extern int         invers(double **a, int n, double **b, int m);
+extern void        printmat( double **, int, int);
+extern void        asmatrix( double *, double **, int, int);
+extern double**    matcopy(double **, int, int);
+extern double**    matmult(double **,double **, int, int, int);
+extern double**    matsum(double **a, double **b, int nr, int nc);
+extern double**    matminus(double **a, double **b, int nr, int nc);
+extern double**    transp (double **a, int n, int m); 
diff --git a/sourcecodes/localscore/modified_matrix.c b/sourcecodes/localscore/modified_matrix.c
new file mode 100644
index 00000000..8737b51b
--- /dev/null
+++ b/sourcecodes/localscore/modified_matrix.c
@@ -0,0 +1,252 @@
+/*                               -*- Mode: C -*- 
+ * matrix.c --- Simple matrix functions for use with postc.c
+ * Author          : Claus Dethlefsen
+ * Created On      : Thu Mar 14 06:48:02 2002
+ * Last Modified By: Claus Dethlefsen
+ * Last Modified On: Wed Jun 04 11:56:23 2003
+ * Update Count    : 36
+ * Status          : Ready
+ */
+
+/*
+  ##
+##    Copyright (C) 2002  Susanne Gammelgaard Bøttcher, Claus Dethlefsen
+##
+##    This program 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.
+##
+##    This program 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 this program; if not, write to the Free Software
+##    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+######################################################################
+*/
+
+
+#include "matrix.h"
+#include "R.h"
+#include "Rmath.h"
+
+
+int *ivector(int nl, int nh)
+{
+   int *v;
+
+   v=(int *) calloc((unsigned) (nh-nl+1)*sizeof(int),sizeof(int));
+   if ( v == NULL ){
+      //error("memory allocation failure in ivector()"); return(NULL);
+   }
+   return v-nl;
+}
+
+void free_ivector(int *v, int nl, int nh) { free((char*) (v+nl)); }
+
+double **dmatrix(int nrl, int nrh, int ncl, int nch)
+{
+   int i;
+   double **m;
+
+   m=(double **) calloc((unsigned) (nrh-nrl+1)*sizeof(double*),sizeof(double*));
+  
+   m -= nrl;
+
+   for(i=nrl;i<=nrh;i++) {
+	   m[i]=(double *) calloc((unsigned) (nch-ncl+1)*sizeof(double),sizeof(double));
+      
+      m[i] -= ncl;
+   }
+   return m;
+}
+
+void free_dmatrix(double **m, int nrl, int nrh, int ncl, int nch)
+{
+	int i;
+
+	for(i=nrh;i>=nrl;i--) free((char*) (m[i]+ncl));
+	free((char*) (m+nrl));
+}
+
+void printmat(double **mat, int nr, int nc) {
+	int i,j;
+
+}
+
+void asmatrix(double *vek, double **mat, int nr, int nc) {
+	int i,j;
+	for (i=1; i<=nr; i++) {
+		for (j=1; j<=nc; j++) {
+			mat[i][j] = vek[j-1+(i-1)*nc];
+		}
+	}
+
+}
+
+double** matcopy(double **mat, int nr, int nc) {
+	/* copy mat[i][j] into nat[i][j] */
+	int i,j;
+	double **nat;
+	nat = dmatrix(1,nr,1,nc);
+/*	Rprintf("(nr=%d,nc=%d)\n",nr,nc);
+	Rprintf("(mat=%d)\n",mat);
+	Rprintf("(mat[1][1]=%f)\n",mat[1][1]);
+*/
+
+	for (i=1; i<=nr; i++) {
+		for (j=1; j<=nc; j++) {
+			 nat[i][j] = mat[i][j];
+		}
+	}
+	return(nat);
+}
+
+double** matmult(double **a, double **b, int nra, int nca, int ncb) {
+	double **c;
+	int i,j,k;
+	c = dmatrix(1,nra,1,ncb);
+	for (i=1; i<=nra; i++)
+		for (j=1; j<=ncb; j++)
+			c[i][j] = 0.0;
+
+	for (i=1; i<=nra; i++) 
+		for (k=1; k<=ncb; k++)
+			for (j=1; j<=nca; j++)
+				c[i][k] += a[i][j]*b[j][k];
+	return(c);
+}
+
+
+double** modified_matmult(double **a, double **b, int nra, int nca, int ncb) {
+	double **c;
+	int i,j,k;
+	c = dmatrix(1,nra,1,ncb);
+	for (i=1; i<=nra; i++)
+		for (j=1; j<=ncb; j++)
+			c[i][j] = 0.0;
+
+	for (i=1; i<=nra; i++) 
+		for (k=1; k<=ncb; k++)
+			for (j=1; j<=nca; j++)
+				c[i][k] += a[i][j]*b[j][k];
+
+	for (i=1; i<=nra; i++)
+		{
+                 for (j=1; j<=ncb; j++)
+			printf("%lf\t",c[i][j]);
+                 printf("\n");
+              } 
+
+
+	return(c);
+}
+
+
+double** matsum(double **a, double **b, int nr, int nc) {
+	double **c;
+	int i,j;
+	c = dmatrix(1,nr,1,nc);
+
+	for (i=1; i<=nr; i++)
+		for (j=1; j<=nc; j++)
+			c[i][j] = a[i][j] + b[i][j];
+	return(c);
+}
+
+double** matminus(double **a, double **b, int nr, int nc) {
+	double **c;
+	int i,j;
+	c = dmatrix(1,nr,1,nc);
+
+	for (i=1; i<=nr; i++)
+		for (j=1; j<=nc; j++)
+			c[i][j] = a[i][j] - b[i][j];
+	return(c);
+}
+
+double** transp (double **a, int n, int m) {
+	double **b;
+	int i,j;
+	b = dmatrix(1,m,1,n);
+	for (i=1; i<=n; i++)
+		for (j=1; j<=m; j++)
+			b[j][i] = a[i][j];
+	return(b);
+}
+
+int invers(double **a, int n, double **b, int m)
+{
+   int *indxc,*indxr,*ipiv;
+   int i,icol=1,irow=1,j,k,l,ll;
+   double big,dum,pivinv;
+
+//   if( (indxc = ivector(1,n)) == NULL){ return(-1); }
+ //  if( (indxr = ivector(1,n)) == NULL){ return(-1); }
+ //  if( (ipiv  = ivector(1,n)) == NULL){ return(-1); }
+  if( (indxc=(int *)calloc((unsigned)(n+1)*sizeof(int),sizeof(int))) == NULL){ return(-1); }
+  if( (indxr=(int *)calloc((unsigned)(n+1)*sizeof(int),sizeof(int))) == NULL){ return(-1); }
+  if( (ipiv=(int *)calloc((unsigned)(n+1)*sizeof(int),sizeof(int))) == NULL){ return(-1); }
+
+  
+   for (j=1;j<=n;j++) ipiv[j]=0;
+   for (i=1;i<=n;i++) {
+      big=0.0;
+      for (j=1;j<=n;j++)
+         if (ipiv[j] != 1)
+            for (k=1;k<=n;k++) {
+               if (ipiv[k] == 0) {
+                  if (fabs(a[j][k]) >= big) {
+                     big=fabs(a[j][k]);
+                     irow=j;
+                     icol=k;
+                  }
+               } else if (ipiv[k] > 1){
+                 
+                  return(-1);
+               }
+            }
+      ++(ipiv[icol]);
+      if (irow != icol) {
+         for (l=1;l<=n;l++){
+            double temp=a[irow][l]; a[irow][l]=a[icol][l]; a[icol][l]=temp;
+         }
+         for (l=1;l<=m;l++){
+            double temp=b[irow][l]; b[irow][l]=b[icol][l]; b[icol][l]=temp;
+         }
+      }
+      indxr[i]=irow;
+      indxc[i]=icol;
+      if (a[icol][icol] == 0.0){
+         //error("Invers: Singular Matrix-2");
+         return(-1);
+      }
+      pivinv=1.0/a[icol][icol];
+      a[icol][icol]=1.0;
+      for (l=1;l<=n;l++) a[icol][l] *= pivinv;
+      for (l=1;l<=m;l++) b[icol][l] *= pivinv;
+      for (ll=1;ll<=n;ll++)
+         if (ll != icol) {
+            dum=a[ll][icol];
+            a[ll][icol]=0.0;
+            for (l=1;l<=n;l++) a[ll][l] -= a[icol][l]*dum;
+            for (l=1;l<=m;l++) b[ll][l] -= b[icol][l]*dum;
+         }
+   }
+   for (l=n;l>=1;l--) {
+      if (indxr[l] != indxc[l]){
+         for (k=1;k<=n;k++){
+            double temp     = a[k][indxr[l]];
+            a[k][indxr[l]] = a[k][indxc[l]];
+            a[k][indxc[l]] = temp;
+         }
+      }
+   }
+   free(indxc); free(indxr); free(ipiv);
+   return(0);
+}
+
+
diff --git a/sourcecodes/localscore/modified_postc.c b/sourcecodes/localscore/modified_postc.c
new file mode 100644
index 00000000..f223fdb8
--- /dev/null
+++ b/sourcecodes/localscore/modified_postc.c
@@ -0,0 +1,171 @@
+/*                               -*- Mode: C -*- 
+ * postc.c --- Posterior for continuous node with continuous parents
+ * Author          : Claus Dethlefsen
+ * Created On      : Tue Mar 12 06:44:35 2002
+ * Last Modified By: Claus Dethlefsen
+ * Last Modified On: Wed Jun 04 11:56:51 2003
+ * Update Count    : 227
+ * Status          : Unknown, Use with caution!
+ */
+
+/*
+  ##
+##    Copyright (C) 2002  Susanne Gammelgaard Bøttcher, Claus Dethlefsen
+##
+##    This program 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.
+##
+##    This program 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 this program; if not, write to the Free Software
+##    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+######################################################################
+*/
+
+#include "R.h"
+#include "Rmath.h"
+#include "matrix.h"
+#include "modified_matrix.c"
+
+void postc(double *mu, double *tau, double *rho, double *phi, double
+	    *loglik, double *y, double *z, int *n, int *d)
+{
+	int i,j,ii,jj;
+	double logscale,logk,mscore;
+	double **mtau, **mmu, **tauinv=0;
+	double **zero, **zi, **ziy;
+       double **oldtau, **oldmu;
+       //temp pointers
+       double **tm1,**tm2,**tm3,**tm4,**mm1,**sm1,**sm2,**tt1,**tt2;  
+
+	/* allocate space for matrices */
+	mtau   = dmatrix(1,*d,1,*d);
+     	oldtau   = dmatrix(1,*d,1,*d);
+
+	zi     = dmatrix(1,*d,1,1);
+	ziy    = dmatrix(1,*d,1,1);
+	mmu    = dmatrix(1,*d,1,1);
+	oldmu    = dmatrix(1,*d,1,1);
+	zero   = dmatrix(1,*d,1,1);
+     	tauinv   = dmatrix(1,*d,1,*d);
+
+     
+
+	/* copy arguments into the matrices */
+	asmatrix(mu,mmu,*d,1);
+	asmatrix(tau,mtau,*d,*d);
+	
+	/* show input */
+
+	for(i = 1; i <= *n; i++) {
+			for (ii=1; ii<=*d; ii++) {
+					for (jj=1; jj<=*d; jj++) {
+						 tauinv[ii][jj] = mtau[ii][jj];
+					}
+			}
+
+		invers(tauinv, *d, zero, 1);
+
+		for (j=1; j<=*d; j++) {
+			zi[j][1] = z[j-1+(i-1)*(*d)];
+		}
+              //define once		
+              tt1=transp(zi,*d,1);
+  
+              tm1=matmult(tauinv,zi,*d,*d,1);
+              tm2=matmult(tt1,tm1,1,*d,1);
+
+		logscale = log(*phi) + log1p(tm2[1][1]);
+                 		
+             free_dmatrix(tm1,1,*d,1,*d);
+	      free_dmatrix(tm2,1,1,1,*d);
+
+
+		logk = lgammafn( 0.5*(1.0+*rho) ) - lgammafn(*rho*0.5);
+		logk -= 0.5*(logscale + log(M_PI));
+		
+              tm1=matmult(tt1,mmu,1,*d,1);
+                           
+
+		mscore =  logk - 0.5*(*rho+1)*log1p((y[i-1] - tm1[1][1])*(y[i-1] - tm1[1][1])/exp(logscale));
+		*loglik += mscore;
+          
+             free_dmatrix(tm1,1,1,1,1);
+
+		for (ii=1; ii<=*d; ii++) {
+				for (jj=1; jj<=*d; jj++) {
+					 oldtau[ii][jj] = mtau[ii][jj];
+				}
+		}
+
+
+		for (jj=1; jj<=*d; jj++) {
+			 oldmu[jj][1] = mmu[jj][1];
+		}
+           
+              tm1=matmult(zi,tt1,*d,1,*d);
+              sm1=matsum(mtau,tm1,*d,*d);               
+              free_dmatrix(mtau,1,*d,1,*d);
+		mtau = sm1;
+              free_dmatrix(tm1,1,*d,1,*d);
+
+		for (ii=1; ii<=*d; ii++) {
+					for (jj=1; jj<=*d; jj++) {
+						 tauinv[ii][jj] = mtau[ii][jj];
+					}
+		}
+
+
+		invers(tauinv, *d, zero, 1);
+
+		for (j=1;j<=*d;j++)
+			ziy[j][1] = zi[j][1]*y[i-1];
+
+              
+              tm1=matmult(oldtau,mmu,*d,*d,1);
+              sm2=matsum(tm1,ziy,*d,1);
+              free_dmatrix(mmu,1,*d,1,1);
+              mmu=matmult(tauinv,sm2,*d,*d,1);
+              free_dmatrix(tm1,1,*d,1,*d);
+              free_dmatrix(sm2,1,*d,1,1);
+
+
+		(*rho)++;
+
+               tm1=matmult(tt1,mmu,1,*d,1);
+               mm1=matminus(oldmu,mmu,*d,1);             
+               tt2=transp(mm1,*d,1);
+               tm3=matmult(oldtau,oldmu,*d,*d,1);
+               tm4=matmult(tt2,tm3,1,*d,1);
+
+		 (*phi) += (y[i-1]-tm1[1][1])*y[i-1] + tm4[1][1];
+
+                  
+              free_dmatrix(tm1,1,1,1,*d);
+              free_dmatrix(mm1,1,*d,1,1);
+		free_dmatrix(tt2,1,1,1,*d);
+              free_dmatrix(tm3,1,*d,1,*d);
+              free_dmatrix(tm4,1,1,1,*d);
+
+              free_dmatrix(tt1,1,1,1,*d);
+
+
+	} 
+
+       free_dmatrix(mtau,1,*d,1,*d);
+	free_dmatrix(zi,1,*d,1,1);
+	free_dmatrix(ziy,1,*d,1,1);
+	free_dmatrix(mmu,1,*d,1,1);
+	free_dmatrix(zero,1,*d,1,1);
+	free_dmatrix(tauinv,1,*d,1,*d);
+	free_dmatrix(oldtau,1,*d,1,*d);
+	free_dmatrix(oldmu,1,*d,1,1);
+    
+} 
+
diff --git a/sourcecodes/localscore/network_score.c b/sourcecodes/localscore/network_score.c
new file mode 100644
index 00000000..c50a520e
--- /dev/null
+++ b/sourcecodes/localscore/network_score.c
@@ -0,0 +1,1441 @@
+#include<stdio.h>
+#include <stdlib.h>
+#include<string.h>
+#define MATHLIB_STANDALONE 1
+#include "matrix.h"
+#include "postc0.c"
+#include "modified_postc.c" // only line that has been changed in this code
+//#define OUT_DIR "./Result/"  //WHERE BENE READ DATA FOR STRUCTURE LEARNING //change it to #define OUT_DIR "/var/www/html/compbio/BNW/bene-0.9-4/example/resdir/" for server. Also change   from sprintf(line+9,"%d",i);  to sprintf(line+52,"%d",i);
+
+struct white{
+int n;
+int *list;
+};
+
+struct ban{
+int n;
+int *list;
+};
+
+struct ndata{
+int idx,type,score_i;
+char **ddata;
+char **label;              //for descrete node
+int lindex;
+double *prob,*cdata,*post_alpha;	
+double score_zeroparent;
+double *score;
+struct white wlist;
+struct ban blist;
+};
+
+
+struct nd{
+int num,nd,*discrete,nc,*continuous,row;
+double score;
+struct ndata *node;
+};
+
+void get_next_seq(int *,int *,int);
+void  learn_node(struct nd *);
+double learn_parent(struct nd  *,int,int);
+
+double run_strtof (const char * input)  //Convert string to double
+{
+    double output;
+    char * end;
+    output = strtod (input, & end);
+    if (end == input) {
+     return 0.0;    
+    }
+    else {
+        return output;
+    }
+}
+
+ 
+char* itoa(int val, int base){  //convert number to string
+	
+	static char buf[32] = {0};
+	
+	int i = 30;
+	
+	for(; val && i ; --i, val /= base)
+	
+		buf[i] = "0123456789abcdef"[val % base];
+	
+	return &buf[i+1];
+	
+}
+
+double standarizedata(double val,double mean,double std)
+{
+  return (val-mean)/std;
+
+}
+
+double mean(double *a,int l)
+{
+int i;
+double m;
+m=0;
+for(i=0;i<l;i++)
+{
+	m+=a[i];
+}
+m=m/l;
+return m;
+}
+
+
+double stdev(double *a,int l,double m)
+{
+int i;
+double sqsum=0.0;
+
+for(i=0;i<l;i++)
+{
+   sqsum+=(a[i]-m)*(a[i]-m);
+ 
+}
+
+return sqrt(sqsum/(l-1));
+}
+
+
+main(int argc, char *argv[])
+{
+ FILE * pFile,*banf,*whitef;
+ int i,s_i,j,k,l,m,id,ic,c,row,imatch,flag,bit,bit_count,ccount,maxccount;
+ int n = 0,ban_flag,white_flag,white_flag_all;
+ char line[2500],nf[250],nt[250],*file_name;
+ char **name;  //name of variables
+ double tc,tcm,score_val;
+ struct nd network;
+ int MAX_PARENT;
+ FILE **inputFiles;
+ 
+
+ double min_score; 
+ 
+
+ if(argc<=5)
+ {
+   printf("Use 5 arguments: 1. input data file name. 2. ban list file name. 3. white list file name. 4. integer value of the maximum number of parents are allowed and 5. output file directory\n");
+   return; 
+ } 
+
+ 
+ 
+ pFile=fopen (argv[1],"r");
+
+  
+ if (pFile==NULL) perror ("Error opening file");
+ else
+ {//reading data from input file
+    
+
+    	row=0;
+    	do{   row++;
+    	} while (fgets (line,2500,pFile)!=NULL);  
+  
+    	row-=3;  
+    	network.row=row;
+    	fclose(pFile);
+   	pFile=fopen (argv[1],"r");
+       ccount=0;  
+       maxccount=0;
+   	do {
+      		c = fgetc (pFile);
+      		if (c == '\t') 
+              {     
+                   n++;
+                   if(maxccount<ccount)
+                      maxccount=ccount;
+                   ccount=0;
+              }
+              else
+                  ccount++;
+               
+
+    	} while (c != '\n');
+    
+
+    	network.num=n+1;
+    	network.discrete=(int *)malloc(sizeof(int)*network.num);
+    	network.continuous=(int *)malloc(sizeof(int)*network.num); 
+    	network.node=(struct ndata *)malloc(sizeof(struct ndata)*network.num);
+
+       MAX_PARENT=atoi(argv[4]);  //maximum number of parents for each node
+       if(MAX_PARENT==0)  //no restriction on parents
+           MAX_PARENT=network.num+1;
+
+       name=(char **)malloc(sizeof(char *)*network.num);
+
+    	for(i=0;i<network.num;i++)
+           name[i]=(char *)malloc(sizeof(char)*(maxccount+1));
+
+
+    
+ 	id=0;
+       ic=0; 
+    	for(i=0;i<=n;i++)
+     	{
+	  	fscanf(pFile,"%d",&c);
+	  	network.node[i].idx=i;
+	  	network.node[i].type=c;
+	  	if(c==1)
+	  	{
+	    		network.continuous[ic]=i;
+	    		ic++;	
+	    		network.node[i].prob=(double *)malloc(sizeof(double)*2); //probability array of size 2 for continuous node
+	    		network.node[i].prob[0]=0.0;  //initialization
+	    		network.node[i].prob[1]=0.0; 
+	    	       network.node[i].cdata=(double *)malloc(sizeof(double)*row); //data matrix for continuous node
+	  	}
+	  	else
+	  	{
+	  		network.discrete[id]=i; 
+              	network.node[i].post_alpha=(double *)calloc(network.node[i].type,sizeof(double));  //prepare total count of each discrete data lebel initialize with zero by calloc which is used in learnnode
+			id++;
+	    		network.node[i].prob=(double *)malloc(sizeof(double)*c); //probability array of size equals to number of levels for discrete node 
+	    		network.node[i].ddata=(char **)malloc(sizeof(char *)*row); //data matrix for continuous node
+	    		network.node[i].label=(char **)malloc(sizeof(char *)*c);  //label array
+	    		for(j=0;j<c;j++)
+			   network.node[i].prob[j]=1.0/c;
+	  	}
+    	 }
+	 network.nd=id;  network.nc=ic; 
+        j=0;
+   	 
+        do{  //calculate average and prob for each node
+     	 	for(i=0;i<=n;i++) //n is nimber of column in the data matrix
+     		{
+     			if(network.node[i].type==1)   //if continuous
+     			{
+     	         		fscanf(pFile,"%s",line);
+     	         		tc=run_strtof(line);
+		  		//network.node[i].prob[1]+=tc;   //summation for average
+		  		network.node[i].cdata[j]=tc;  // data values in data column vector
+     			}
+     			else   //discrete
+     	 	       {
+				fscanf(pFile,"%s",line);
+				network.node[i].ddata[j]=(char *)malloc(sizeof(char)*strlen(line));
+				if(j==0)    //first iteration of do while
+				{ 
+	    	         		network.node[i].lindex=0;
+		   	  		network.node[i].label[0]=(char *)malloc(sizeof(char)*strlen(line));
+		   	  		strcpy(network.node[i].label[0],line);  //new label assigned to label list
+		   	  		network.node[i].post_alpha[0]=1;
+		   	
+				}
+				else  //store different label for discrete node also count number of ocarance of each label for calculation of post alpha score
+				{
+		   	 		imatch=0;
+		   	 		for(k=0;k<=network.node[i].lindex;k++)
+		   	 		{
+		   	   	 		if(strcmp(network.node[i].label[k],line)==0)
+		   	   	 		{
+		   	   	    			imatch=1; 
+							network.node[i].post_alpha[k]+=1;	
+		   	   	    			break; 	
+		   	   	 		}
+		   	   		}
+		   	 		if(imatch==0)
+		   	 		{
+		   	       		network.node[i].lindex++;
+		   	       		k=network.node[i].lindex;
+		   	       		network.node[i].label[k]=(char *)malloc(sizeof(char)*strlen(line));
+		   	       		strcpy(network.node[i].label[k],line);  //new label assigned to label list
+						network.node[i].post_alpha[k]+=1;
+		   	 		}
+				}
+				strcpy(network.node[i].ddata[j],line);
+     	 		}
+     	
+     		}
+      		j++;  
+    	} while (fgets (line,250,pFile)!=NULL);  //end of do while to read the input file  
+     
+       //////////////normalize continuous data/////////////
+       for(i=0;i<=n;i++)
+   	{
+     		if(network.node[i].type==1)  
+     		{    	  		
+
+                     tcm=mean(network.node[i].cdata,row);
+                     tc=stdev(network.node[i].cdata,row,tcm);
+          	  	for(j=0;j<row;j++)
+		  	{
+			    network.node[i].cdata[j]=standarizedata(network.node[i].cdata[j],tcm,tc); //dataval.data mean, standard deviation
+			}
+     		}
+	 } 
+     
+       //////////////////adjust average and prob for normalized data
+     	for(i=0;i<=n;i++)
+   	{
+     		if(network.node[i].type==1)  //claculate average and prob for continuous nodes
+     		{
+     	  		network.node[i].prob[1]=mean(network.node[i].cdata,row);
+	
+          	  	for(j=0;j<row;j++)
+		  	{
+			    network.node[i].prob[0]+=(network.node[i].cdata[j]-network.node[i].prob[1])*(network.node[i].cdata[j]-network.node[i].prob[1]);
+			}
+       	  	network.node[i].prob[0]*=1.0/(double)(row-1);	
+		  	network.node[i].prob[0]*=(double)(row-1.0)/(double)row;                    
+
+     		}
+	 } 
+
+  fclose (pFile);
+  }//end of else part for open input file
+
+  pFile=fopen (argv[1],"r");
+
+  for(i=0;i<network.num;i++)
+      fscanf(pFile,"%s",name[i]);
+
+  fclose(pFile);
+
+  learn_node(&network);    //call function to learn network and get local score whell 0 parent for all nodes
+
+
+
+  //printf("%.2lf\n",learn_parent(&network,6,176));
+  // printf("%.2lf\n",learn_parent(&network,6,47));
+  // printf("%.2lf\n",learn_parent(&network,6,18));
+  //printf("%.2lf\n",learn_parent(&network,7,80));
+  ////////printing trylist to a file////////////////////////////////
+
+  //fprintf(outfile,"Number of nodes\n%d\n",network.num);
+  //fprintf(outfile,"Possible sets of parents per node\n");
+  j=(int)pow(2.0,network.nd-1);  //possible number of parents for discrete node
+  k=(int)pow(2.0,network.num-1); //possible number of parents for continuous nodes
+
+
+  for(i=0;i<network.num;i++)
+  {
+     network.node[i].score=(double *)malloc(sizeof(double)*(k+1));
+     network.node[i].score_i=0;
+
+ 
+     network.node[i].wlist.n=0;
+     network.node[i].blist.n=0;
+     network.node[i].blist.list=(int *)malloc(sizeof(int)*network.num);
+     network.node[i].wlist.list=(int *)malloc(sizeof(int)*network.num);
+    // if(network.node[i].type>1)  //discrete
+      //     fprintf(outfile,"%d\t",j);
+     //else   //continuous
+       //    fprintf(outfile,"%d\t",k);
+  }
+
+  banf=fopen (argv[2],"r");  //ban list file name
+  whitef=fopen (argv[3],"r");  //white list file name
+
+  //read banlist
+//  fgets (line,2500,banf); //header
+
+
+strcpy(nf,"");
+strcpy(nt,"");
+
+while (fgets (line,2500,banf)!=NULL){  
+  
+   fscanf(banf,"%s",nf);  //node from
+   fscanf(banf,"%s",nt);  //node to
+   
+   for(i=0;i<network.num;i++)
+   {
+       if(strcmp(name[i],nt)==0)
+       {
+              j=network.node[i].blist.n;
+              for(l=0;l<network.num;l++)
+   		{
+                    if(strcmp(name[l],nf)==0)
+                    {
+                        ban_flag=0;
+                        for(k=0;k<network.node[i].blist.n;k++)
+                             {    
+                                 if(network.node[i].blist.list[k]==l)
+                                  {           		   
+                       		         ban_flag=1;
+                          		         break;
+                                  }
+                             }
+                        if(ban_flag==0) 
+                        {
+                             network.node[i].blist.list[j]=l;
+                             j++;
+                             network.node[i].blist.n=j;
+                        }
+                        
+                    } 
+              }
+       }   
+  }
+
+}   
+
+
+
+//read whitelist
+//fgets (line,2500,whitef); //header
+
+strcpy(nf,"");
+strcpy(nt,"");
+
+while (fgets (line,2500,whitef)!=NULL){  
+
+fscanf(whitef,"%s",nf);  //node from
+fscanf(whitef,"%s",nt);  //node to
+
+for(i=0;i<network.num;i++)
+  {
+       if(strcmp(name[i],nt)==0)
+       {
+              j=network.node[i].wlist.n;
+              for(l=0;l<network.num;l++)
+   		{
+                    if(strcmp(name[l],nf)==0)
+                    {
+                        white_flag=0;
+                        for(k=0;k<network.node[i].wlist.n;k++)
+                             {    
+                                 if(network.node[i].wlist.list[k]==l)
+                                  {           		   
+                       		         white_flag=1;
+                          		         break;
+                                  }
+                             }
+                             if(white_flag==0) 
+                             {
+
+                                 network.node[i].wlist.list[j]=l;
+                                 j++;
+                                 network.node[i].wlist.n=j;
+                             }
+ 
+                    } 
+              }
+       }   
+  }
+
+}   
+
+  //fprintf(outfile,"\nChild	Parents	Score\n");
+
+  m=(int)pow(2.0,network.num)-1; //number of combinations of parents
+  min_score=1.0;
+  for(i=0;i<network.num;i++)
+  {
+ 
+    if(network.node[i].wlist.n==0)
+    {
+            network.node[i].score[0]=network.node[i].score_zeroparent;
+            if(min_score>network.node[i].score_zeroparent)
+                min_score=network.node[i].score_zeroparent;
+
+            //fprintf(outfile,"%d\t0\t%lf\n",i+1,network.node[i].score_zeroparent);  //printing score for zero parent 
+    }
+    else
+    {
+          network.node[i].score[0]=1.0;
+          //fprintf(outfile,"%d\t0\t0.0\n",i+1);
+          
+     }
+    network.node[i].score_i=1;
+
+
+     for(j=0;j<m;j++)
+     {   
+
+         ban_flag=0;
+         
+         bit= (j+1 >> i) & 1;
+
+         if(bit!=1)  //check if the child itself is present in parent list
+         { 
+
+          		bit_count=0;
+               	//fprintf(outfile,"%d\t",i+1);
+      			for(l=0;l<network.num;l++)
+                     {
+                       		bit= (j+1 >> l) & 1;
+                           		if(bit==1)
+                           		{
+                                         	//fprintf(outfile,"%d",l+1);
+                   				bit_count++;
+ 	            				
+                                   }  
+
+                     }
+
+
+    	             	if(network.node[i].type>1)  //if discrete node checck if any continuous node is included in the parent list
+              	{     
+                  		flag=0;
+                            ban_flag=0;
+                  		for(l=0;l<network.num;l++)
+                  		{
+                        		bit= (j+1 >> l) & 1;
+                        
+	  	          		if(bit==1 && network.node[l].type==1) //check if continuous is parent of discrete
+ 	   	           		{   
+                             		 flag=1;
+                             		 break;
+                         		}
+	  	          		if(bit==1)
+                                   { 
+                                           for(k=0;k<network.node[i].blist.n;k++)
+                                           {    
+                                               if(network.node[i].blist.list[k]==l)
+                                                {           		   
+                             		         ban_flag=1;
+                             		         break;
+                                                }
+                                           }
+
+
+                                           if(ban_flag==1)
+                                              break;
+                         		}
+
+
+
+                   		}
+                   		if(flag==0)  //if no continuous parent for discrete node then learn the network with the list of parents  
+                   		{
+
+					if(bit_count>MAX_PARENT)
+                                   {
+                                              //fprintf(outfile,"\t0.0\n");   
+
+                                              s_i=network.node[i].score_i;
+                                              network.node[i].score[s_i]=1.0;
+                                              network.node[i].score_i=s_i+1;
+
+
+
+                                   }
+                                   else if(ban_flag==1)
+                                    {        
+                                              //fprintf(outfile,"\t0.0\n");   
+                                              s_i=network.node[i].score_i;
+                                              network.node[i].score[s_i]=1.0;
+                                              network.node[i].score_i=s_i+1;
+                                    }
+                                   else  // calculate score if white list check get satisfied
+                         		{
+                                          if(network.node[i].wlist.n==0)
+                                           {  
+                                              score_val=learn_parent(&network,i,j);
+
+            					    if(min_score>score_val)
+					                min_score=score_val;
+
+
+
+                                              //fprintf(outfile,"\t%lf\n",score_val);   
+                                              s_i=network.node[i].score_i;
+                                              network.node[i].score[s_i]=score_val;
+                                              network.node[i].score_i=s_i+1;
+                                           }                                                 
+                                          else if(bit_count<network.node[i].wlist.n)  //white list is greater than list of parents
+                                          {
+						    //fprintf(outfile,"\tfor white\t0.0\n"); 
+                                              s_i=network.node[i].score_i;
+                                              network.node[i].score[s_i]=1.0;
+                                              network.node[i].score_i=s_i+1;
+                                          }
+                                          else
+                                          {
+                                                white_flag=0;  
+                                                white_flag_all=0;  
+
+     			                          for(l=0;l<network.num;l++)
+                        		            {
+                            	          	  bit= (j+1 >> l) & 1;
+
+                            		         if(bit==1)
+                                		         {
+                                                        for(k=0;k<network.node[i].wlist.n;k++)
+                                                        {     
+                                                               if(network.node[i].wlist.list[k]==l)
+                                                               {           		   
+                             		                        white_flag++;
+                                                                  //changed from white_flag=1;  
+                             		                        break;
+                                                               }
+                                                        }
+                                                        if(white_flag>=network.node[i].wlist.n)
+                                                        {    //!=1
+                                                              white_flag_all=1;
+                                                              break; 
+
+                                          	        }  
+                        
+                                    	           }
+                                                }
+                                                if(white_flag_all==1)
+                                       	      {
+                                                      score_val=learn_parent(&network,i,j);
+	             					     if(min_score>score_val)
+					                        min_score=score_val;
+
+                                                      //fprintf(outfile,"\t%lf\n",score_val);   
+                                                      s_i=network.node[i].score_i;
+                                                      network.node[i].score[s_i]=score_val;
+                                                      network.node[i].score_i=s_i+1;
+                                                }
+                                                else
+                                                { 
+                                                     //fprintf(outfile,"\t0.0\n");  
+	                                              s_i=network.node[i].score_i;
+	                                              network.node[i].score[s_i]=1.0;
+	                                              network.node[i].score_i=s_i+1;
+							}
+
+                                           } 
+                                   }
+
+                   		}
+                            else  //fill up data when continuous is parent of discrete
+                            {
+					//fprintf(outfile,"\t0.0\n"); 
+                                   s_i=network.node[i].score_i;
+                                   network.node[i].score[s_i]=1.0;
+                                   network.node[i].score_i=s_i+1;
+
+                             }  
+               	}
+               	else  //if continuous node then learn the network with the parent set
+               	{
+
+                            ban_flag=0;
+
+       
+                   		for(l=0;l<network.num;l++)
+                   		{
+                       		bit= (j+1 >> l) & 1;
+                       		if(bit==1)
+                            	{
+
+                                           for(k=0;k<network.node[i].blist.n;k++)
+                                           {    
+                                               if(network.node[i].blist.list[k]==l)
+                                                {           		   
+                             		         ban_flag=1;
+                             		         break;
+                                                }
+                                           }
+                                           if(ban_flag==1)
+                                              break;
+                         		}
+
+
+                   		}
+				if(bit_count>MAX_PARENT)
+                            {
+                                   //fprintf(outfile,"\t0.0\n"); 
+                                   s_i=network.node[i].score_i;
+                                   network.node[i].score[s_i]=1.0;
+                                   network.node[i].score_i=s_i+1;
+                            } 
+                            else if(ban_flag==1)
+                            {
+					//fprintf(outfile,"\t0.0\n"); 
+                                   s_i=network.node[i].score_i;
+                                   network.node[i].score[s_i]=1.0;
+                                   network.node[i].score_i=s_i+1;
+				}				
+                            else
+                            {
+                                          if(network.node[i].wlist.n==0)
+                                      	 {
+                                                      score_val=learn_parent(&network,i,j);
+       	      					     if(min_score>score_val)
+						                min_score=score_val;
+
+                                                      //fprintf(outfile,"\t%lf\n",score_val);   
+                                                      s_i=network.node[i].score_i;
+                                                      network.node[i].score[s_i]=score_val;
+                                                      network.node[i].score_i=s_i+1;
+                                            }
+                                          else if(bit_count<network.node[i].wlist.n)  //white list is greater than list of parents
+                                          {
+                                                     //fprintf(outfile,"\t0.0\n"); 
+                                                     s_i=network.node[i].score_i;
+                                                     network.node[i].score[s_i]=1.0;
+                                                     network.node[i].score_i=s_i+1;
+                                           } 
+                                          else
+                                          {
+                                                white_flag=0;  
+                                                white_flag_all=0;  
+
+     			                          for(l=0;l<network.num;l++)
+                        		            {
+                            	          	  bit= (j+1 >> l) & 1;
+
+                            		         if(bit==1)
+                                		         {
+                                                        for(k=0;k<network.node[i].wlist.n;k++)
+                                                        {     
+                                                               if(network.node[i].wlist.list[k]==l)
+                                                               {           		   
+                             		                        white_flag++;
+                             		                        break;
+                                                               }
+                                                        }
+                                                        if(white_flag>=network.node[i].wlist.n)
+                                                        {    //!=1
+                                                              white_flag_all=1;
+                                                              break; 
+
+                                          	        }  
+                        
+                                    	           }
+                                                }
+                                                if(white_flag_all==1)
+                                      	      {
+                                                      score_val=learn_parent(&network,i,j);
+            					            if(min_score>score_val)
+					                       min_score=score_val;
+
+                                                      //fprintf(outfile,"\t%lf\n",score_val);   
+                                                      s_i=network.node[i].score_i;
+                                                      network.node[i].score[s_i]=score_val;
+                                                      network.node[i].score_i=s_i+1;
+                                                }
+                                                else
+                                                {
+       						    // fprintf(outfile,"\t0.0\n");  
+                                              	     s_i=network.node[i].score_i;
+	                                               network.node[i].score[s_i]=1.0;
+	                                               network.node[i].score_i=s_i+1;
+							}
+
+                                           } 
+                              }
+
+
+                	}
+
+
+           }  
+       }
+  }  
+
+
+//print scores to separate files
+
+min_score*=10;
+inputFiles= (FILE **) malloc(network.num * sizeof(FILE*));
+
+printf("%s\n",argv[5]);
+
+for(i=0;i<network.num;i++)
+{
+  strcpy(line,argv[5]);
+  sprintf(line+10,"/%d",i);  //sprintf(line+52,"%d",i);
+
+ // strcat(line,".txt");
+
+  inputFiles[i] = fopen(line, "wb");
+
+  //print content  
+  for(j=0;j<network.node[i].score_i;j++)
+  {      
+          if(network.node[i].score[j]<1.0)
+            fwrite(&network.node[i].score[j],sizeof(double),1,inputFiles[i]); 
+// fprintf(inputFiles[i],"%lf\n",network.node[i].score[j]);
+          else 
+            fwrite(&min_score,sizeof(double),1,inputFiles[i]); 
+//fprintf(inputFiles[i],"%lf\n",min_score);
+  }  
+
+  fclose(inputFiles[i]);
+}
+
+
+
+
+
+
+fclose(banf);
+fclose(whitef);
+
+
+// printf("Time elapsed: %f\n", ((double)clock() - start) / CLOCKS_PER_SEC);
+
+}
+
+
+/* learn the network for zero parent */
+
+void  learn_node(struct nd  *net)
+{
+  int i,j,k,nk,l,m,i1,j1;
+  long num,temp;
+  double n,N,s2;
+  struct nd network=*net; //create a local copy
+  double *alpha,nu,rho,mu,phi,tau;
+  double post_nu,post_rho,post_mu,post_phi,post_tau;
+  double loglik,post_loglik;
+ 
+  num=network.num;
+
+  nk=1;
+  
+  for(i=0;i<num;i++)
+  {
+     if(network.node[i].type>1)
+        nk*=network.node[i].type;
+  }
+  
+  	   
+
+
+  for(i=0;i<num;i++)
+  {	   
+     if(network.node[i].type>1)
+     {
+	      	
+	  alpha=(double *)malloc(sizeof(double)*network.node[i].type);
+	  k=1;
+			  
+	   for(j=0;j<num;j++)
+          {
+          	  if(i!=j && network.node[j].type>1)
+                 k*=network.node[j].type;
+		          	
+          }
+          N=0.0; n=0.0;
+	   for(j=0;j<network.node[i].type;j++)
+          {
+              alpha[j]=2.0*k;
+              network.node[i].post_alpha[j]+=alpha[j];
+          ////////update loglik from udisclik
+              n+=alpha[j]; 
+              N+=network.node[i].post_alpha[j];
+          }
+     
+	  
+         loglik=0.0;
+         post_loglik=0.0;
+  
+     	  for(j=0;j<network.node[i].type;j++)
+             post_loglik+=lgammafn(network.node[i].post_alpha[j])-lgammafn(alpha[j]);
+
+          post_loglik+=lgammafn(n);
+          post_loglik-=lgammafn(N);
+ 
+     
+	}
+	else
+	{
+	    	nu=nk*2.0;
+	    	tau=nu;
+	    	rho=nk*2.0;	
+		mu=network.node[i].prob[1];
+		phi=network.node[i].prob[0]*nk;
+		loglik=0.0;
+              post_mu=mu;
+              post_tau=tau;
+              post_rho=rho;
+              post_phi=phi;
+	       post_loglik=loglik; 
+
+              postc0(&post_mu,&post_tau,&post_rho,&post_phi,&post_loglik,network.node[i].cdata,&network.row);
+
+     		    	
+	}
+      network.node[i].score_zeroparent=post_loglik; // store the zero parent score 
+		  
+   }
+    	
+   if(nk!=1)
+     free(alpha);
+
+   *net=network;  //coppied back to original	
+}
+
+
+/*
+learn node for a list of parents
+*/
+
+double learn_parent(struct nd  *net,int child,int p)
+{
+  int i,j,jj,k,nk,l,m,i1,j1,k1,k2,cn_send;
+  long num,temp;
+  double n,N,s2;
+  struct nd network=*net; //create a local copy
+  int cn,ds,bit,*discrete,*continuous;
+  double alpha,*postalpha,alpha_parent,*postalpha_parent,nu,rho,mu,phi,tau;
+  double post_nu,post_rho,*post_mu,post_phi,post_tau;
+  double loglik,post_loglik=0,post_loglik_parent=0;
+  double *mu_mat,**tau_mat,tau11,tau12,tau22,div,phiinv;
+  char **label; 
+  int *a,*l_list,flag,y_count,z_count;
+  double *y,mu_p,phi_p,*tau_send,*z_send,loglik_sum;
+
+
+
+  num=network.num;
+
+  continuous=(int *)malloc(sizeof(int)*network.nc);
+  discrete=(int *)malloc(sizeof(int)*network.nd); 
+
+  nk=1;
+  for(i=0;i<num;i++)
+  {
+	if(network.node[i].type>1)
+	    nk*=network.node[i].type;
+  }
+	   
+//list of discrete snd continuous parents
+  cn=0;
+  ds=0;
+  alpha_parent=0;
+  alpha=2;
+ 
+  k1=network.node[child].type;
+  k2=1;
+ 
+ //printf("%d\n",child);
+  for(j=0;j<network.num;j++)   //list the continuous parents and discrete parents
+	 {
+	  	bit= (p+1 >> j) & 1;
+              
+              
+	  	if(bit==1 && j!=child)
+	  	{   
+                 
+	  	   if(network.node[j].type>1)
+	  	    {
+			   discrete[ds]=j;
+                        //printf("discrete parent=%d\n",j);
+                        k1*=network.node[j].type;
+                        k2*=network.node[j].type;
+     			   ds++;
+	  	    }
+	   	    else
+	  	    {
+			   continuous[cn]=j; 
+                        //printf("continuous parent=%d\n",j);
+			   cn++;
+	  	    }	
+	  	}
+              else if(j!=child)
+              {
+                 alpha*=network.node[j].type;
+              }  
+	 }
+    
+       if(network.nd<=2)
+          alpha=2; 
+
+       i=child;   //i is the node with changes in its parrent nodes 
+         
+       if(network.node[i].type>1 && cn==0)  // no continuous node  //prepare alpha and post alpha and then calculate local score
+	{   
+         
+	   k=k1;
+      	   postalpha=(double *)calloc(network.node[i].type,sizeof(double));
+  
+          label=(char **)malloc(sizeof(char *)*(ds+1)); //label array
+  	   a=(int *)calloc((ds+1),sizeof(int));
+          l_list=(int *)malloc(sizeof(int)*(ds+1));
+
+          for(j=0;j<=ds;j++)
+              label[j]=(char *)malloc(sizeof(char)*100);
+       	   
+          for(j=0;j<ds;j++)
+          {
+               l=discrete[j];
+               l_list[j]=network.node[l].type; 
+              
+          }
+          l_list[ds]=network.node[i].type;
+                   
+          for(j=0;j<k;j++)                
+          {
+ 	     
+	             get_next_seq(a,l_list,ds+1);   // prepare a new combination of labels for parent
+       	      for(i1=0;i1<ds;i1++)
+             		{
+                 		j1=a[i1];
+                 		l=discrete[i1];
+                 		strcpy(label[i1],network.node[l].label[j1]); 
+                     }  
+                     
+             		j1=a[i1];
+                     strcpy(label[i1],network.node[child].label[j1]); 
+                     for(i1=0;i1<network.node[i].type;i1++)
+               		postalpha[i1]=0;
+             		for(i1=0;i1<network.row;i1++)  // search through parents data and count how many number of matches for current label list. prepare post alpha from count+alpha
+             		{
+                     	flag=0;
+                     	for(m=0;m<ds;m++)
+                     	{
+                        		j1=a[m];
+                       		 l=discrete[m];
+                        		if(strcmp(label[m],network.node[l].ddata[i1])!=0)
+                        		{
+                          			flag=1;
+                        		}      
+                     	}  
+                    		j1=a[m];
+                    		if(strcmp(label[m],network.node[child].ddata[i1])!=0)
+                        	{
+                          		flag=1;
+                        	}     
+                   		if(flag==0)
+                   		{
+                        		j1=a[ds];
+                        		postalpha[j1]+=1;
+
+                   		}
+             		}
+             		for(m=0;m<network.node[i].type;m++)
+                     {   
+                             if(postalpha[m]!=0)
+                             {
+  	                        	postalpha[m]+=alpha;
+                                   post_loglik+=lgammafn(postalpha[m])-lgammafn(alpha);
+                             }
+                     } 
+          }
+
+	
+          k=k2;   // repeat the last step of preparing alpha and post alpha for only parent set. this time exclude the child node label from computation. prepare alpha_parent and post_alphaparent
+	   l=discrete[ds-1];       
+	   postalpha_parent=(double *)calloc(network.node[l].type,sizeof(double));
+
+	   for(j=0;j<ds;j++)
+	   {
+	  	    l=discrete[j];
+	      	    l_list[j]=network.node[l].type;
+	           a[j]=0; 
+
+	    }
+           for(j=0;j<k1/k2;j++)
+                 alpha_parent+=alpha; 
+	    for(j=0;j<k;j++)
+	    {
+		    	get_next_seq(a,l_list,ds);
+
+	      		for(i1=0;i1<ds;i1++)
+			{
+		  		j1=a[i1];
+		  		l=discrete[i1];
+		  		strcpy(label[i1],network.node[l].label[j1]);
+                            
+			}
+
+	      		l=discrete[ds-1]; 
+	      		for(i1=0;i1<network.node[l].type;i1++)
+				postalpha_parent[i1]=0;
+             
+			for(i1=0;i1<network.row;i1++)
+			{
+		  		flag=0;
+		  		for(m=0;m<ds;m++)
+		    		{
+		      			j1=a[m];
+		      			l=discrete[m];
+		      			if(strcmp(label[m],network.node[l].ddata[i1])!=0)
+                        		{
+                          			flag=1;
+                        		}
+		    		}
+                    
+		  		if(flag==0)
+		    		{
+		      			j1=a[ds-1];
+		       		postalpha_parent[j1]+=1;
+
+		    		}
+			}
+	      		l=discrete[ds-1];
+	      		for(m=0;m<network.node[l].type;m++)
+			{ 
+                             if(postalpha_parent[m]!=0)
+                              {  
+                                    postalpha_parent[m]+=alpha_parent;
+       	                      post_loglik_parent+=lgammafn(postalpha_parent[m])-lgammafn(alpha_parent);
+                              }
+			}
+	    }
+
+      
+         loglik=post_loglik-post_loglik_parent;
+	  free(postalpha);
+         free(postalpha_parent);
+         for(j=0;j<=ds;j++)
+             free(label[j]);
+	  free(label);
+ 	  free(a);
+ 	  free(l_list);
+
+	}
+       else if(network.node[i].type==1 && ds==0)  // no discrete node  //prepare continuous parameter set
+	{
+           z_count=0;
+           tau_mat=(double **)malloc(sizeof(double *)*(cn+1));
+
+           z_send=(double *)malloc(sizeof(double)*(cn+1)*network.row);
+           tau_send=(double *)malloc(sizeof(double)*(cn+1)*(cn+1));
+  
+	    mu_mat=(double *)malloc(sizeof(double)*(cn+1));
+           nu=nk*2.0;  rho=nk*2.0+cn; 
+           mu_mat[0]=network.node[i].prob[1];
+           for(j=0;j<cn;j++)
+           {
+              mu_mat[j+1]=0;
+              tau_mat[j]=(double *)malloc(sizeof(double)*(cn+1));
+ 
+           } 
+         
+           tau_mat[j]=(double *)malloc(sizeof(double)*(cn+1));
+
+           for(j=0;j<network.row;j++)
+           {
+               z_send[z_count]=1;
+               z_count++;
+               for(j1=0;j1<cn;j1++)
+               {
+                  l=continuous[j1];
+                  z_send[z_count]=network.node[l].cdata[j];   
+                  z_count++;                                            
+               }
+                  
+           }
+           
+             phi=network.node[i].prob[0]*nk;	
+               
+             //preparing tau
+      
+             //**tau_mat
+               for(j=0;j<=cn;j++)
+                     for(m=0;m<=cn;m++)
+                     {
+                      tau_mat[j][m]=1.0;
+                     }
+              
+              for(j=0;j<cn;j++)
+              {
+                 l=continuous[j];
+                 mu_p=network.node[l].prob[1];
+                 phi_p=network.node[l].prob[0]*nk;
+                 phiinv=1/phi_p; 
+                 tau11 = 1/nu + mu_p*phiinv*mu_p;
+                 tau22 = phiinv;
+                 tau12 = -mu_p*phiinv;
+                 div=tau11*tau22-tau12*tau12;
+                 if(j==0) 
+                    tau_mat[0][0]=tau22/div;
+                 tau_mat[0][j+1]=-tau12/div;
+                 tau_mat[j+1][0]=tau_mat[0][j+1];
+                 tau_mat[j+1][j+1]=tau11/div;
+              }
+
+               for(j=0;j<=cn;j++)
+                     for(m=0;m<=cn;m++)
+                     {
+                       if(tau_mat[j][m]==1.0)
+                          { 
+                                tau_mat[j][m]=tau_mat[0][j]*(tau_mat[0][m]/tau_mat[0][0]);
+                               
+                          }
+                       j1=j*(cn+1)+m;
+                       tau_send[j1]=tau_mat[j][m];
+                      
+                     }
+                      
+              loglik=0.0;
+              
+              cn_send=cn+1; 
+              
+              postc(mu_mat,tau_send,&rho,&phi,&loglik,network.node[i].cdata,z_send,&network.row,&cn_send);
+             
+ 	
+ 		free(z_send);
+ 		free(tau_send);
+              for(j=0;j<=cn;j++)
+                 free(tau_mat[j]);
+  		free(tau_mat);
+ 		free(mu_mat);
+ 		    	
+	}
+       else  //hybrid cases
+       {
+              if(cn==0)   //if parents are all discrete and child is continuous
+              { 
+   
+                     ///////////////////prepare y array and run c code////////////////////////////////
+              	loglik_sum=0;
+              	k=k2;
+      	       	y=(double *)calloc(network.row,sizeof(double));
+              	label=(char **)malloc(sizeof(char *)*(ds));  //label array
+  	       	a=(int *)calloc((ds+1),sizeof(int));
+              	l_list=(int *)malloc(sizeof(int)*(ds));
+
+          		for(j=0;j<ds;j++)
+              		label[j]=(char *)malloc(sizeof(char)*100);
+       	   
+          		for(j=0;j<ds;j++)
+          		{
+              		l=discrete[j];
+               		l_list[j]=network.node[l].type; 
+              
+          		}
+
+                   
+          		for(j=0;j<k;j++)                
+              	{
+
+                     	nu=(nk*2.0)/k2;
+	    			tau=nu;
+	    			rho=nu;	
+				mu=network.node[i].prob[1];
+				phi=network.node[i].prob[0]*nu/2;
+				loglik=0.0;
+
+ 	               	get_next_seq(a,l_list,ds);   // prepare a new combination of labels for parent
+       	      		for(i1=0;i1<ds;i1++)
+             			{
+                 			j1=a[i1];
+                 			l=discrete[i1];
+                 			strcpy(label[i1],network.node[l].label[j1]); 
+                     	}  
+             	       	y_count=0; 	
+             			for(i1=0;i1<network.row;i1++)  // search through parents data and count how many number of matches for current label list. prepare post alpha from count+alpha
+             			{
+                     		flag=0;
+                     		for(m=0;m<ds;m++)
+                     		{
+                        		
+                       			l=discrete[m];
+                        			if(strcmp(label[m],network.node[l].ddata[i1])!=0)
+                        			{
+                          				flag=1;
+                        			}      
+                     		}  
+                    		     
+                   			if(flag==0)
+                   			{
+                        			y[y_count]=network.node[i].cdata[i1];
+                        			y_count++;
+             
+                   			}
+             			}
+          
+             			postc0(&mu,&tau,&rho,&phi,&loglik,y,&y_count);
+                     	loglik_sum+=loglik;
+          
+
+              	}
+
+              	loglik=loglik_sum;
+                      
+                     free(y);
+                     for(j=0;j<ds;j++)
+                         free(label[j]);
+			free(label);
+			free(a);
+			free(l_list);
+          
+ 
+              }//end of continuous node discrete parent check
+              else //all the other hybrid cases when parents are both continuous and discrete 
+              {
+                     
+                   
+          	      tau_mat=(double **)malloc(sizeof(double *)*(cn+1));
+		      z_send=(double *)malloc(sizeof(double)*(cn+1)*network.row);
+         	      tau_send=(double *)malloc(sizeof(double)*(cn+1)*(cn+1));
+	    	      mu_mat=(double *)malloc(sizeof(double)*(cn+1));
+           	      
+           	       for(j=0;j<cn;j++)
+           		{
+              	   tau_mat[j]=(double *)malloc(sizeof(double)*(cn+1));
+ 	              } 
+         
+      		       
+           		tau_mat[j]=(double *)malloc(sizeof(double)*(cn+1));          
+
+                     ///////////////////prepare parameters  and run c code////////////////////////////////
+              	loglik_sum=0.0;
+              	k=k2;
+      	       	y=(double *)calloc(network.row,sizeof(double));
+              	label=(char **)malloc(sizeof(char *)*(ds));  //label array
+  	       	a=(int *)calloc((ds+1),sizeof(int));
+              	l_list=(int *)malloc(sizeof(int)*(ds));
+
+          		for(j=0;j<ds;j++)
+              		label[j]=(char *)malloc(sizeof(char)*100);
+       	   
+          		for(j=0;j<ds;j++)
+          		{
+              		l=discrete[j];
+               		l_list[j]=network.node[l].type; 
+              
+          		}
+
+                   
+          		for(jj=0;jj<k;jj++)                
+              	{
+
+                     	nu=(nk*2.0)/k2;
+	      			rho=nu+cn;	
+				mu_mat[0]=network.node[i].prob[1];
+
+                            for(j1=0;j1<cn;j1++)
+           		            mu_mat[j1+1]=0;
+
+				phi=network.node[i].prob[0]*nu/2;
+	                    //preparing tau
+                   		//**tau_mat
+             			for(j=0;j<=cn;j++)
+                               for(m=0;m<=cn;m++)
+                               {
+                   			   tau_mat[j][m]=1.0;
+                     	    }
+             
+              		for(j=0;j<cn;j++)
+              		{
+                 			l=continuous[j];
+                 			mu_p=network.node[l].prob[1];
+                 			phi_p=network.node[l].prob[0]*(nk/k2);
+                
+                 			phiinv=1/phi_p; 
+                 			tau11 = 1/nu + mu_p*phiinv*mu_p;
+                 			tau22 = phiinv;
+                 			tau12 = -mu_p*phiinv;
+                 			div=tau11*tau22-tau12*tau12;
+                 			if(j==0) 
+                  			    tau_mat[0][0]=tau22/div;
+                 
+			              tau_mat[0][j+1]=-tau12/div;
+                 			tau_mat[j+1][0]=tau_mat[0][j+1];
+                 			tau_mat[j+1][j+1]=tau11/div;
+       
+                
+              		}
+               		for(j=0;j<=cn;j++)
+                    			 for(m=0;m<=cn;m++)
+                    			 {
+			                       if(tau_mat[j][m]==1.0)
+                       		         { 
+			                            tau_mat[j][m]=tau_mat[0][j]*(tau_mat[0][m]/tau_mat[0][0]);
+                              		  }
+
+                       			j1=j*(cn+1)+m;
+                       			tau_send[j1]=tau_mat[j][m];
+                                           
+                     		   //printf("%.2lf\t",tau_mat[j][m]);
+                                    }
+                                    //printf("\n");
+              	       loglik=0.0;
+              
+  	      
+             		       cn_send=cn+1; 
+
+ 	               	
+                            get_next_seq(a,l_list,ds);   // prepare a new combination of labels for parent
+       	      		for(i1=0;i1<ds;i1++)
+             			{
+                 			j1=a[i1];
+                 			l=discrete[i1];
+                 			strcpy(label[i1],network.node[l].label[j1]); 
+                     	}  
+             	       	y_count=0;
+                            z_count=0; 	
+             			for(i1=0;i1<network.row;i1++)  // search through parents data and count how many number of matches for current label list. prepare post alpha from count+alpha
+             			{
+                     		flag=0;
+                     		for(m=0;m<ds;m++)
+                     		{
+                        		
+                       			l=discrete[m];
+                        			if(strcmp(label[m],network.node[l].ddata[i1])!=0)
+                        			{
+                          				flag=1;
+                        			}      
+                     		}  
+                    		     
+                   			if(flag==0)
+                   			{
+                        			y[y_count]=network.node[i].cdata[i1];
+
+                                          //prepare z send matrix
+                                          z_send[z_count]=1;
+                                          z_count++;
+                                          for(j1=0;j1<cn;j1++)
+                                          {
+                 			          l=continuous[j1];
+                 			          z_send[z_count]=network.node[l].cdata[i1];   
+                                             z_count++;                                            
+                                          }
+                        			y_count++;
+                   			}
+             			}
+          
+                            postc(mu_mat,tau_send,&rho,&phi,&loglik,y,z_send,&y_count,&cn_send);
+ 
+                     	loglik_sum+=loglik;
+          
+
+              	}
+
+              	loglik=loglik_sum;
+                        
+                     free(y);
+ 			//free(z);
+ 			free(z_send);
+ 			free(tau_send);
+                     for(j=0;j<=cn;j++)
+                        free(tau_mat[j]);
+          	       free(tau_mat);
+ 			free(mu_mat);
+                     for(j=0;j<ds;j++)
+                         free(label[j]);  
+ 			free(label);
+ 			free(a);
+ 			free(l_list);       
+
+              }//end of else part for hybrid when parents are mixed       
+
+       }//end of else part for hybrid
+       
+ free(continuous);
+ free(discrete); 
+ return loglik;
+
+	
+}
+
+void get_next_seq(int *a,int *l,int size)
+{
+  int j,idx;
+  idx=size-1;
+  a[idx]+=1;
+  if(a[idx]==l[idx])
+  {
+      a[idx]=0;
+      for(j=idx-1;j>=0;j--){
+        a[j]+=1;
+        if(a[j]==l[j])
+           a[j]=0;
+        else
+            break;
+      }
+  }
+}
+
+
diff --git a/sourcecodes/localscore/network_score_old.c b/sourcecodes/localscore/network_score_old.c
new file mode 100644
index 00000000..b1ca59a9
--- /dev/null
+++ b/sourcecodes/localscore/network_score_old.c
@@ -0,0 +1,1438 @@
+#include<stdio.h>
+#include <stdlib.h>
+#include<string.h>
+#define MATHLIB_STANDALONE 1
+#include "matrix.h"
+#include "postc0.c"
+#include "modified_postc.c" // only line that has been changed in this code
+//#define OUT_DIR "./Result/"  //WHERE BENE READ DATA FOR STRUCTURE LEARNING //change it to #define OUT_DIR "/var/www/html/compbio/BNW/bene-0.9-4/example/resdir/" for server. Also change   from sprintf(line+9,"%d",i);  to sprintf(line+52,"%d",i);
+
+struct white{
+int n;
+int *list;
+};
+
+struct ban{
+int n;
+int *list;
+};
+
+struct ndata{
+int idx,type,score_i;
+char **ddata;
+char **label;              //for descrete node
+int lindex;
+double *prob,*cdata,*post_alpha;	
+double score_zeroparent;
+double *score;
+struct white wlist;
+struct ban blist;
+};
+
+
+struct nd{
+int num,nd,*discrete,nc,*continuous,row;
+double score;
+struct ndata *node;
+};
+
+void get_next_seq(int *,int *,int);
+void  learn_node(struct nd *);
+double learn_parent(struct nd  *,int,int);
+
+double run_strtof (const char * input)  //Convert string to double
+{
+    double output;
+    char * end;
+    output = strtod (input, & end);
+    if (end == input) {
+     return 0.0;    
+    }
+    else {
+        return output;
+    }
+}
+
+ 
+char* itoa(int val, int base){  //convert number to string
+	
+	static char buf[32] = {0};
+	
+	int i = 30;
+	
+	for(; val && i ; --i, val /= base)
+	
+		buf[i] = "0123456789abcdef"[val % base];
+	
+	return &buf[i+1];
+	
+}
+
+double standarizedata(double val,double mean,double std)
+{
+  return (val-mean)/std;
+
+}
+
+double mean(double *a,int l)
+{
+int i;
+double m;
+m=0;
+for(i=0;i<l;i++)
+{
+	m+=a[i];
+}
+m=m/l;
+return m;
+}
+
+
+double stdev(double *a,int l,double m)
+{
+int i;
+double sqsum=0.0;
+
+for(i=0;i<l;i++)
+{
+   sqsum+=(a[i]-m)*(a[i]-m);
+ 
+}
+
+return sqrt(sqsum/(l-1));
+}
+
+
+main(int argc, char *argv[])
+{
+ FILE * pFile,*banf,*whitef;
+ int i,s_i,j,k,l,m,id,ic,c,row,imatch,flag,bit,bit_count,ccount,maxccount;
+ int n = 0,ban_flag,white_flag,white_flag_all;
+ char line[2500],nf[250],nt[250],*file_name;
+ char **name;  //name of variables
+ double tc,tcm,score_val;
+ struct nd network;
+ int MAX_PARENT;
+ FILE **inputFiles;
+ 
+
+ double min_score; 
+ 
+
+ if(argc<=5)
+ {
+   printf("Use 5 arguments: 1. input data file name. 2. ban list file name. 3. white list file name. 4. integer value of the maximum number of parents are allowed and 5. output file directory\n");
+   return; 
+ } 
+
+ 
+ 
+ pFile=fopen (argv[1],"r");
+
+  
+ if (pFile==NULL) perror ("Error opening file");
+ else
+ {//reading data from input file
+    
+
+    	row=0;
+    	do{   row++;
+    	} while (fgets (line,2500,pFile)!=NULL);  
+  
+    	row-=3;  
+    	network.row=row;
+    	fclose(pFile);
+   	pFile=fopen (argv[1],"r");
+       ccount=0;  
+       maxccount=0;
+   	do {
+      		c = fgetc (pFile);
+      		if (c == '\t') 
+              {     
+                   n++;
+                   if(maxccount<ccount)
+                      maxccount=ccount;
+                   ccount=0;
+              }
+              else
+                  ccount++;
+               
+
+    	} while (c != '\n');
+    
+
+    	network.num=n+1;
+    	network.discrete=(int *)malloc(sizeof(int)*network.num);
+    	network.continuous=(int *)malloc(sizeof(int)*network.num); 
+    	network.node=(struct ndata *)malloc(sizeof(struct ndata)*network.num);
+
+       MAX_PARENT=atoi(argv[4]);  //maximum number of parents for each node
+       if(MAX_PARENT==0)  //no restriction on parents
+           MAX_PARENT=network.num+1;
+
+       name=(char **)malloc(sizeof(char *)*network.num);
+
+    	for(i=0;i<network.num;i++)
+           name[i]=(char *)malloc(sizeof(char)*(maxccount+1));
+
+
+    
+ 	id=0;
+       ic=0; 
+    	for(i=0;i<=n;i++)
+     	{
+	  	fscanf(pFile,"%d",&c);
+	  	network.node[i].idx=i;
+	  	network.node[i].type=c;
+	  	if(c==1)
+	  	{
+	    		network.continuous[ic]=i;
+	    		ic++;	
+	    		network.node[i].prob=(double *)malloc(sizeof(double)*2); //probability array of size 2 for continuous node
+	    		network.node[i].prob[0]=0.0;  //initialization
+	    		network.node[i].prob[1]=0.0; 
+	    	       network.node[i].cdata=(double *)malloc(sizeof(double)*row); //data matrix for continuous node
+	  	}
+	  	else
+	  	{
+	  		network.discrete[id]=i; 
+              	network.node[i].post_alpha=(double *)calloc(network.node[i].type,sizeof(double));  //prepare total count of each discrete data lebel initialize with zero by calloc which is used in learnnode
+			id++;
+	    		network.node[i].prob=(double *)malloc(sizeof(double)*c); //probability array of size equals to number of levels for discrete node 
+	    		network.node[i].ddata=(char **)malloc(sizeof(char *)*row); //data matrix for continuous node
+	    		network.node[i].label=(char **)malloc(sizeof(char *)*c);  //label array
+	    		for(j=0;j<c;j++)
+			   network.node[i].prob[j]=1.0/c;
+	  	}
+    	 }
+	 network.nd=id;  network.nc=ic; 
+        j=0;
+   	 
+        do{  //calculate average and prob for each node
+     	 	for(i=0;i<=n;i++) //n is nimber of column in the data matrix
+     		{
+     			if(network.node[i].type==1)   //if continuous
+     			{
+     	         		fscanf(pFile,"%s",line);
+     	         		tc=run_strtof(line);
+		  		//network.node[i].prob[1]+=tc;   //summation for average
+		  		network.node[i].cdata[j]=tc;  // data values in data column vector
+     			}
+     			else   //discrete
+     	 	       {
+				fscanf(pFile,"%s",line);
+				network.node[i].ddata[j]=(char *)malloc(sizeof(char)*strlen(line));
+				if(j==0)    //first iteration of do while
+				{ 
+	    	         		network.node[i].lindex=0;
+		   	  		network.node[i].label[0]=(char *)malloc(sizeof(char)*strlen(line));
+		   	  		strcpy(network.node[i].label[0],line);  //new label assigned to label list
+		   	  		network.node[i].post_alpha[0]=1;
+		   	
+				}
+				else  //store different label for discrete node also count number of ocarance of each label for calculation of post alpha score
+				{
+		   	 		imatch=0;
+		   	 		for(k=0;k<=network.node[i].lindex;k++)
+		   	 		{
+		   	   	 		if(strcmp(network.node[i].label[k],line)==0)
+		   	   	 		{
+		   	   	    			imatch=1; 
+							network.node[i].post_alpha[k]+=1;	
+		   	   	    			break; 	
+		   	   	 		}
+		   	   		}
+		   	 		if(imatch==0)
+		   	 		{
+		   	       		network.node[i].lindex++;
+		   	       		k=network.node[i].lindex;
+		   	       		network.node[i].label[k]=(char *)malloc(sizeof(char)*strlen(line));
+		   	       		strcpy(network.node[i].label[k],line);  //new label assigned to label list
+						network.node[i].post_alpha[k]+=1;
+		   	 		}
+				}
+				strcpy(network.node[i].ddata[j],line);
+     	 		}
+     	
+     		}
+      		j++;  
+    	} while (fgets (line,250,pFile)!=NULL);  //end of do while to read the input file  
+     
+       //////////////normalize continuous data/////////////
+       for(i=0;i<=n;i++)
+   	{
+     		if(network.node[i].type==1)  
+     		{    	  		
+
+                     tcm=mean(network.node[i].cdata,row);
+                     tc=stdev(network.node[i].cdata,row,tcm);
+          	  	for(j=0;j<row;j++)
+		  	{
+			    network.node[i].cdata[j]=standarizedata(network.node[i].cdata[j],tcm,tc); //dataval.data mean, standard deviation
+			}
+     		}
+	 } 
+     
+       //////////////////adjust average and prob for normalized data
+     	for(i=0;i<=n;i++)
+   	{
+     		if(network.node[i].type==1)  //claculate average and prob for continuous nodes
+     		{
+     	  		network.node[i].prob[1]=mean(network.node[i].cdata,row);
+	
+          	  	for(j=0;j<row;j++)
+		  	{
+			    network.node[i].prob[0]+=(network.node[i].cdata[j]-network.node[i].prob[1])*(network.node[i].cdata[j]-network.node[i].prob[1]);
+			}
+       	  	network.node[i].prob[0]*=1.0/(double)(row-1);	
+		  	network.node[i].prob[0]*=(double)(row-1.0)/(double)row;                    
+
+     		}
+	 } 
+
+  fclose (pFile);
+  }//end of else part for open input file
+
+  pFile=fopen (argv[1],"r");
+
+  for(i=0;i<network.num;i++)
+      fscanf(pFile,"%s",name[i]);
+
+  fclose(pFile);
+
+  learn_node(&network);    //call function to learn network and get local score whell 0 parent for all nodes
+
+
+
+  //printf("%.2lf\n",learn_parent(&network,6,176));
+  // printf("%.2lf\n",learn_parent(&network,6,47));
+  // printf("%.2lf\n",learn_parent(&network,6,18));
+  //printf("%.2lf\n",learn_parent(&network,7,80));
+  ////////printing trylist to a file////////////////////////////////
+
+  //fprintf(outfile,"Number of nodes\n%d\n",network.num);
+  //fprintf(outfile,"Possible sets of parents per node\n");
+  j=(int)pow(2.0,network.nd-1);  //possible number of parents for discrete node
+  k=(int)pow(2.0,network.num-1); //possible number of parents for continuous nodes
+
+
+  for(i=0;i<network.num;i++)
+  {
+     network.node[i].score=(double *)malloc(sizeof(double)*(k+1));
+     network.node[i].score_i=0;
+
+ 
+     network.node[i].wlist.n=0;
+     network.node[i].blist.n=0;
+     network.node[i].blist.list=(int *)malloc(sizeof(int)*network.num);
+     network.node[i].wlist.list=(int *)malloc(sizeof(int)*network.num);
+    // if(network.node[i].type>1)  //discrete
+      //     fprintf(outfile,"%d\t",j);
+     //else   //continuous
+       //    fprintf(outfile,"%d\t",k);
+  }
+
+  banf=fopen (argv[2],"r");  //ban list file name
+  whitef=fopen (argv[3],"r");  //white list file name
+
+  //read banlist
+//  fgets (line,2500,banf); //header
+
+
+strcpy(nf,"");
+strcpy(nt,"");
+
+while (fgets (line,2500,banf)!=NULL){  
+  
+   fscanf(banf,"%s",nf);  //node from
+   fscanf(banf,"%s",nt);  //node to
+   
+   for(i=0;i<network.num;i++)
+   {
+       if(strcmp(name[i],nt)==0)
+       {
+              j=network.node[i].blist.n;
+              for(l=0;l<network.num;l++)
+   		{
+                    if(strcmp(name[l],nf)==0)
+                    {
+                        ban_flag=0;
+                        for(k=0;k<network.node[i].blist.n;k++)
+                             {    
+                                 if(network.node[i].blist.list[k]==l)
+                                  {           		   
+                       		         ban_flag=1;
+                          		         break;
+                                  }
+                             }
+                        if(ban_flag==0) 
+                        {
+                             network.node[i].blist.list[j]=l;
+                             j++;
+                             network.node[i].blist.n=j;
+                        }
+                        
+                    } 
+              }
+       }   
+  }
+
+}   
+
+
+
+//read whitelist
+//fgets (line,2500,whitef); //header
+
+strcpy(nf,"");
+strcpy(nt,"");
+
+while (fgets (line,2500,whitef)!=NULL){  
+
+fscanf(whitef,"%s",nf);  //node from
+fscanf(whitef,"%s",nt);  //node to
+
+for(i=0;i<network.num;i++)
+  {
+       if(strcmp(name[i],nt)==0)
+       {
+              j=network.node[i].wlist.n;
+              for(l=0;l<network.num;l++)
+   		{
+                    if(strcmp(name[l],nf)==0)
+                    {
+                        white_flag=0;
+                        for(k=0;k<network.node[i].wlist.n;k++)
+                             {    
+                                 if(network.node[i].wlist.list[k]==l)
+                                  {           		   
+                       		         white_flag=1;
+                          		         break;
+                                  }
+                             }
+                             if(white_flag==0) 
+                             {
+
+                                 network.node[i].wlist.list[j]=l;
+                                 j++;
+                                 network.node[i].wlist.n=j;
+                             }
+ 
+                    } 
+              }
+       }   
+  }
+
+}   
+
+  //fprintf(outfile,"\nChild	Parents	Score\n");
+
+  m=(int)pow(2.0,network.num)-1; //number of combinations of parents
+  min_score=1.0;
+  for(i=0;i<network.num;i++)
+  {
+ 
+    if(network.node[i].wlist.n==0)
+    {
+            network.node[i].score[0]=network.node[i].score_zeroparent;
+            if(min_score>network.node[i].score_zeroparent)
+                min_score=network.node[i].score_zeroparent;
+
+            //fprintf(outfile,"%d\t0\t%lf\n",i+1,network.node[i].score_zeroparent);  //printing score for zero parent 
+    }
+    else
+    {
+          network.node[i].score[0]=1.0;
+          //fprintf(outfile,"%d\t0\t0.0\n",i+1);
+          
+     }
+    network.node[i].score_i=1;
+
+
+     for(j=0;j<m;j++)
+     {   
+
+         ban_flag=0;
+         
+         bit= (j+1 >> i) & 1;
+
+         if(bit!=1)  //check if the child itself is present in parent list
+         { 
+
+          		bit_count=0;
+               	//fprintf(outfile,"%d\t",i+1);
+      			for(l=0;l<network.num;l++)
+                     {
+                       		bit= (j+1 >> l) & 1;
+                           		if(bit==1)
+                           		{
+                                         	//fprintf(outfile,"%d",l+1);
+                   				bit_count++;
+ 	            				
+                                   }  
+
+                     }
+
+
+    	             	if(network.node[i].type>1)  //if discrete node checck if any continuous node is included in the parent list
+              	{     
+                  		flag=0;
+                            ban_flag=0;
+                  		for(l=0;l<network.num;l++)
+                  		{
+                        		bit= (j+1 >> l) & 1;
+                        
+	  	          		if(bit==1 && network.node[l].type==1) //check if continuous is parent of discrete
+ 	   	           		{   
+                             		 flag=1;
+                             		 break;
+                         		}
+	  	          		if(bit==1)
+                                   { 
+                                           for(k=0;k<network.node[i].blist.n;k++)
+                                           {    
+                                               if(network.node[i].blist.list[k]==l)
+                                                {           		   
+                             		         ban_flag=1;
+                             		         break;
+                                                }
+                                           }
+
+
+                                           if(ban_flag==1)
+                                              break;
+                         		}
+
+
+
+                   		}
+                   		if(flag==0)  //if no continuous parent for discrete node then learn the network with the list of parents  
+                   		{
+
+					if(bit_count>MAX_PARENT)
+                                   {
+                                              //fprintf(outfile,"\t0.0\n");   
+
+                                              s_i=network.node[i].score_i;
+                                              network.node[i].score[s_i]=1.0;
+                                              network.node[i].score_i=s_i+1;
+
+
+
+                                   }
+                                   else if(ban_flag==1)
+                                    {        
+                                              //fprintf(outfile,"\t0.0\n");   
+                                              s_i=network.node[i].score_i;
+                                              network.node[i].score[s_i]=1.0;
+                                              network.node[i].score_i=s_i+1;
+                                    }
+                                   else  // calculate score if white list check get satisfied
+                         		{
+                                          if(network.node[i].wlist.n==0)
+                                           {  
+                                              score_val=learn_parent(&network,i,j);
+
+            					    if(min_score>score_val)
+					                min_score=score_val;
+
+
+
+                                              //fprintf(outfile,"\t%lf\n",score_val);   
+                                              s_i=network.node[i].score_i;
+                                              network.node[i].score[s_i]=score_val;
+                                              network.node[i].score_i=s_i+1;
+                                           }                                                 
+                                          else if(bit_count<network.node[i].wlist.n)  //white list is greater than list of parents
+                                          {
+						    //fprintf(outfile,"\tfor white\t0.0\n"); 
+                                              s_i=network.node[i].score_i;
+                                              network.node[i].score[s_i]=1.0;
+                                              network.node[i].score_i=s_i+1;
+                                          }
+                                          else
+                                          {
+                                                white_flag=0;  
+                                                white_flag_all=0;  
+
+     			                          for(l=0;l<network.num;l++)
+                        		            {
+                            	          	  bit= (j+1 >> l) & 1;
+
+                            		         if(bit==1)
+                                		         {
+                                                        for(k=0;k<network.node[i].wlist.n;k++)
+                                                        {     
+                                                               if(network.node[i].wlist.list[k]==l)
+                                                               {           		   
+                             		                        white_flag=1;
+                             		                        break;
+                                                               }
+                                                        }
+                                                        if(white_flag!=1)
+                                                        {    
+                                                              white_flag_all=1;
+                                                              break; 
+
+                                          	        }  
+                        
+                                    	           }
+                                                }
+                                                if(white_flag_all==0)
+                                       	      {
+                                                      score_val=learn_parent(&network,i,j);
+	             					     if(min_score>score_val)
+					                        min_score=score_val;
+
+                                                      //fprintf(outfile,"\t%lf\n",score_val);   
+                                                      s_i=network.node[i].score_i;
+                                                      network.node[i].score[s_i]=score_val;
+                                                      network.node[i].score_i=s_i+1;
+                                                }
+                                                else
+                                                { 
+                                                     //fprintf(outfile,"\t0.0\n");  
+	                                              s_i=network.node[i].score_i;
+	                                              network.node[i].score[s_i]=1.0;
+	                                              network.node[i].score_i=s_i+1;
+							}
+
+                                           } 
+                                   }
+
+                   		}
+                            else  //fill up data when continuous is parent of discrete
+                            {
+					//fprintf(outfile,"\t0.0\n"); 
+                                   s_i=network.node[i].score_i;
+                                   network.node[i].score[s_i]=1.0;
+                                   network.node[i].score_i=s_i+1;
+
+                             }  
+               	}
+               	else  //if continuous node then learn the network with the parent set
+               	{
+
+                            ban_flag=0;
+
+       
+                   		for(l=0;l<network.num;l++)
+                   		{
+                       		bit= (j+1 >> l) & 1;
+                       		if(bit==1)
+                            	{
+
+                                           for(k=0;k<network.node[i].blist.n;k++)
+                                           {    
+                                               if(network.node[i].blist.list[k]==l)
+                                                {           		   
+                             		         ban_flag=1;
+                             		         break;
+                                                }
+                                           }
+                                           if(ban_flag==1)
+                                              break;
+                         		}
+
+
+                   		}
+				if(bit_count>MAX_PARENT)
+                            {
+                                   //fprintf(outfile,"\t0.0\n"); 
+                                   s_i=network.node[i].score_i;
+                                   network.node[i].score[s_i]=1.0;
+                                   network.node[i].score_i=s_i+1;
+                            } 
+                            else if(ban_flag==1)
+                            {
+					//fprintf(outfile,"\t0.0\n"); 
+                                   s_i=network.node[i].score_i;
+                                   network.node[i].score[s_i]=1.0;
+                                   network.node[i].score_i=s_i+1;
+				}				
+                            else
+                            {
+                                          if(network.node[i].wlist.n==0)
+                                      	 {
+                                                      score_val=learn_parent(&network,i,j);
+       	      					     if(min_score>score_val)
+						                min_score=score_val;
+
+                                                      //fprintf(outfile,"\t%lf\n",score_val);   
+                                                      s_i=network.node[i].score_i;
+                                                      network.node[i].score[s_i]=score_val;
+                                                      network.node[i].score_i=s_i+1;
+                                            }
+                                          else if(bit_count<network.node[i].wlist.n)  //white list is greater than list of parents
+                                          {
+                                                     //fprintf(outfile,"\t0.0\n"); 
+                                                     s_i=network.node[i].score_i;
+                                                     network.node[i].score[s_i]=1.0;
+                                                     network.node[i].score_i=s_i+1;
+                                           } 
+                                          else
+                                          {
+                                                white_flag=0;  
+                                                white_flag_all=0;  
+
+     			                          for(l=0;l<network.num;l++)
+                        		            {
+                            	          	  bit= (j+1 >> l) & 1;
+
+                            		         if(bit==1)
+                                		         {
+                                                        for(k=0;k<network.node[i].wlist.n;k++)
+                                                        {     
+                                                               if(network.node[i].wlist.list[k]==l)
+                                                               {           		   
+                             		                        white_flag=1;
+                             		                        break;
+                                                               }
+                                                        }
+                                                        if(white_flag!=1)
+                                                        {    
+                                                              white_flag_all=1;
+                                                              break; 
+
+                                          	        }  
+                        
+                                    	           }
+                                                }
+                                                if(white_flag_all==0)
+                                      	      {
+                                                      score_val=learn_parent(&network,i,j);
+            					            if(min_score>score_val)
+					                       min_score=score_val;
+
+                                                      //fprintf(outfile,"\t%lf\n",score_val);   
+                                                      s_i=network.node[i].score_i;
+                                                      network.node[i].score[s_i]=score_val;
+                                                      network.node[i].score_i=s_i+1;
+                                                }
+                                                else
+                                                {
+       						    // fprintf(outfile,"\t0.0\n");  
+                                              	     s_i=network.node[i].score_i;
+	                                               network.node[i].score[s_i]=1.0;
+	                                               network.node[i].score_i=s_i+1;
+							}
+
+                                           } 
+                              }
+
+
+                	}
+
+
+           }  
+       }
+  }  
+
+
+//print scores to separate files
+
+min_score*=10;
+inputFiles= (FILE **) malloc(network.num * sizeof(FILE*));
+
+printf("%s\n",argv[5]);
+
+for(i=0;i<network.num;i++)
+{
+  strcpy(line,argv[5]);
+  sprintf(line+10,"/%d",i);  //sprintf(line+52,"%d",i);
+
+ // strcat(line,".txt");
+
+  inputFiles[i] = fopen(line, "wb");
+
+  //print content  
+  for(j=0;j<network.node[i].score_i;j++)
+  {      
+          if(network.node[i].score[j]<1.0)
+            fwrite(&network.node[i].score[j],sizeof(double),1,inputFiles[i]); // fprintf(inputFiles[i],"%lf\n",network.node[i].score[j]);
+          else 
+            fwrite(&min_score,sizeof(double),1,inputFiles[i]); //fprintf(inputFiles[i],"%lf\n",min_score);
+  }  
+
+  fclose(inputFiles[i]);
+}
+
+
+
+
+
+
+fclose(banf);
+fclose(whitef);
+
+
+// printf("Time elapsed: %f\n", ((double)clock() - start) / CLOCKS_PER_SEC);
+
+}
+
+
+/* learn the network for zero parent */
+
+void  learn_node(struct nd  *net)
+{
+  int i,j,k,nk,l,m,i1,j1;
+  long num,temp;
+  double n,N,s2;
+  struct nd network=*net; //create a local copy
+  double *alpha,nu,rho,mu,phi,tau;
+  double post_nu,post_rho,post_mu,post_phi,post_tau;
+  double loglik,post_loglik;
+ 
+  num=network.num;
+
+  nk=1;
+  
+  for(i=0;i<num;i++)
+  {
+     if(network.node[i].type>1)
+        nk*=network.node[i].type;
+  }
+  
+  	   
+
+
+  for(i=0;i<num;i++)
+  {	   
+     if(network.node[i].type>1)
+     {
+	      	
+	  alpha=(double *)malloc(sizeof(double)*network.node[i].type);
+	  k=1;
+			  
+	   for(j=0;j<num;j++)
+          {
+          	  if(i!=j && network.node[j].type>1)
+                 k*=network.node[j].type;
+		          	
+          }
+          N=0.0; n=0.0;
+	   for(j=0;j<network.node[i].type;j++)
+          {
+              alpha[j]=2.0*k;
+              network.node[i].post_alpha[j]+=alpha[j];
+          ////////update loglik from udisclik
+              n+=alpha[j]; 
+              N+=network.node[i].post_alpha[j];
+          }
+     
+	  
+         loglik=0.0;
+         post_loglik=0.0;
+  
+     	  for(j=0;j<network.node[i].type;j++)
+             post_loglik+=lgammafn(network.node[i].post_alpha[j])-lgammafn(alpha[j]);
+
+          post_loglik+=lgammafn(n);
+          post_loglik-=lgammafn(N);
+ 
+     
+	}
+	else
+	{
+	    	nu=nk*2.0;
+	    	tau=nu;
+	    	rho=nk*2.0;	
+		mu=network.node[i].prob[1];
+		phi=network.node[i].prob[0]*nk;
+		loglik=0.0;
+              post_mu=mu;
+              post_tau=tau;
+              post_rho=rho;
+              post_phi=phi;
+	       post_loglik=loglik; 
+
+              postc0(&post_mu,&post_tau,&post_rho,&post_phi,&post_loglik,network.node[i].cdata,&network.row);
+
+     		    	
+	}
+      network.node[i].score_zeroparent=post_loglik; // store the zero parent score 
+		  
+   }
+    	
+   if(nk!=1)
+     free(alpha);
+
+   *net=network;  //coppied back to original	
+}
+
+
+/*
+learn node for a list of parents
+*/
+
+double learn_parent(struct nd  *net,int child,int p)
+{
+  int i,j,jj,k,nk,l,m,i1,j1,k1,k2,cn_send;
+  long num,temp;
+  double n,N,s2;
+  struct nd network=*net; //create a local copy
+  int cn,ds,bit,*discrete,*continuous;
+  double alpha,*postalpha,alpha_parent,*postalpha_parent,nu,rho,mu,phi,tau;
+  double post_nu,post_rho,*post_mu,post_phi,post_tau;
+  double loglik,post_loglik=0,post_loglik_parent=0;
+  double *mu_mat,**tau_mat,tau11,tau12,tau22,div,phiinv;
+  char **label; 
+  int *a,*l_list,flag,y_count,z_count;
+  double *y,mu_p,phi_p,*tau_send,*z_send,loglik_sum;
+
+
+
+  num=network.num;
+
+  continuous=(int *)malloc(sizeof(int)*network.nc);
+  discrete=(int *)malloc(sizeof(int)*network.nd); 
+
+  nk=1;
+  for(i=0;i<num;i++)
+  {
+	if(network.node[i].type>1)
+	    nk*=network.node[i].type;
+  }
+	   
+//list of discrete snd continuous parents
+  cn=0;
+  ds=0;
+  alpha_parent=0;
+  alpha=2;
+ 
+  k1=network.node[child].type;
+  k2=1;
+ 
+ //printf("%d\n",child);
+  for(j=0;j<network.num;j++)   //list the continuous parents and discrete parents
+	 {
+	  	bit= (p+1 >> j) & 1;
+              
+              
+	  	if(bit==1 && j!=child)
+	  	{   
+                 
+	  	   if(network.node[j].type>1)
+	  	    {
+			   discrete[ds]=j;
+                        //printf("discrete parent=%d\n",j);
+                        k1*=network.node[j].type;
+                        k2*=network.node[j].type;
+     			   ds++;
+	  	    }
+	   	    else
+	  	    {
+			   continuous[cn]=j; 
+                        //printf("continuous parent=%d\n",j);
+			   cn++;
+	  	    }	
+	  	}
+              else if(j!=child)
+              {
+                 alpha*=network.node[j].type;
+              }  
+	 }
+    
+       if(network.nd<=2)
+          alpha=2; 
+
+       i=child;   //i is the node with changes in its parrent nodes 
+         
+       if(network.node[i].type>1 && cn==0)  // no continuous node  //prepare alpha and post alpha and then calculate local score
+	{   
+         
+	   k=k1;
+      	   postalpha=(double *)calloc(network.node[i].type,sizeof(double));
+  
+          label=(char **)malloc(sizeof(char *)*(ds+1)); //label array
+  	   a=(int *)calloc((ds+1),sizeof(int));
+          l_list=(int *)malloc(sizeof(int)*(ds+1));
+
+          for(j=0;j<=ds;j++)
+              label[j]=(char *)malloc(sizeof(char)*100);
+       	   
+          for(j=0;j<ds;j++)
+          {
+               l=discrete[j];
+               l_list[j]=network.node[l].type; 
+              
+          }
+          l_list[ds]=network.node[i].type;
+                   
+          for(j=0;j<k;j++)                
+          {
+ 	     
+	             get_next_seq(a,l_list,ds+1);   // prepare a new combination of labels for parent
+       	      for(i1=0;i1<ds;i1++)
+             		{
+                 		j1=a[i1];
+                 		l=discrete[i1];
+                 		strcpy(label[i1],network.node[l].label[j1]); 
+                     }  
+                     
+             		j1=a[i1];
+                     strcpy(label[i1],network.node[child].label[j1]); 
+                     for(i1=0;i1<network.node[i].type;i1++)
+               		postalpha[i1]=0;
+             		for(i1=0;i1<network.row;i1++)  // search through parents data and count how many number of matches for current label list. prepare post alpha from count+alpha
+             		{
+                     	flag=0;
+                     	for(m=0;m<ds;m++)
+                     	{
+                        		j1=a[m];
+                       		 l=discrete[m];
+                        		if(strcmp(label[m],network.node[l].ddata[i1])!=0)
+                        		{
+                          			flag=1;
+                        		}      
+                     	}  
+                    		j1=a[m];
+                    		if(strcmp(label[m],network.node[child].ddata[i1])!=0)
+                        	{
+                          		flag=1;
+                        	}     
+                   		if(flag==0)
+                   		{
+                        		j1=a[ds];
+                        		postalpha[j1]+=1;
+
+                   		}
+             		}
+             		for(m=0;m<network.node[i].type;m++)
+                     {   
+                             if(postalpha[m]!=0)
+                             {
+  	                        	postalpha[m]+=alpha;
+                                   post_loglik+=lgammafn(postalpha[m])-lgammafn(alpha);
+                             }
+                     } 
+          }
+
+	
+          k=k2;   // repeat the last step of preparing alpha and post alpha for only parent set. this time exclude the child node label from computation. prepare alpha_parent and post_alphaparent
+	   l=discrete[ds-1];       
+	   postalpha_parent=(double *)calloc(network.node[l].type,sizeof(double));
+
+	   for(j=0;j<ds;j++)
+	   {
+	  	    l=discrete[j];
+	      	    l_list[j]=network.node[l].type;
+	           a[j]=0; 
+
+	    }
+           for(j=0;j<k1/k2;j++)
+                 alpha_parent+=alpha; 
+	    for(j=0;j<k;j++)
+	    {
+		    	get_next_seq(a,l_list,ds);
+
+	      		for(i1=0;i1<ds;i1++)
+			{
+		  		j1=a[i1];
+		  		l=discrete[i1];
+		  		strcpy(label[i1],network.node[l].label[j1]);
+                            
+			}
+
+	      		l=discrete[ds-1]; 
+	      		for(i1=0;i1<network.node[l].type;i1++)
+				postalpha_parent[i1]=0;
+             
+			for(i1=0;i1<network.row;i1++)
+			{
+		  		flag=0;
+		  		for(m=0;m<ds;m++)
+		    		{
+		      			j1=a[m];
+		      			l=discrete[m];
+		      			if(strcmp(label[m],network.node[l].ddata[i1])!=0)
+                        		{
+                          			flag=1;
+                        		}
+		    		}
+                    
+		  		if(flag==0)
+		    		{
+		      			j1=a[ds-1];
+		       		postalpha_parent[j1]+=1;
+
+		    		}
+			}
+	      		l=discrete[ds-1];
+	      		for(m=0;m<network.node[l].type;m++)
+			{ 
+                             if(postalpha_parent[m]!=0)
+                              {  
+                                    postalpha_parent[m]+=alpha_parent;
+       	                      post_loglik_parent+=lgammafn(postalpha_parent[m])-lgammafn(alpha_parent);
+                              }
+			}
+	    }
+
+      
+         loglik=post_loglik-post_loglik_parent;
+	  free(postalpha);
+         free(postalpha_parent);
+         for(j=0;j<=ds;j++)
+             free(label[j]);
+	  free(label);
+ 	  free(a);
+ 	  free(l_list);
+
+	}
+       else if(network.node[i].type==1 && ds==0)  // no discrete node  //prepare continuous parameter set
+	{
+           z_count=0;
+           tau_mat=(double **)malloc(sizeof(double *)*(cn+1));
+
+           z_send=(double *)malloc(sizeof(double)*(cn+1)*network.row);
+           tau_send=(double *)malloc(sizeof(double)*(cn+1)*(cn+1));
+  
+	    mu_mat=(double *)malloc(sizeof(double)*(cn+1));
+           nu=nk*2.0;  rho=nk*2.0+cn; 
+           mu_mat[0]=network.node[i].prob[1];
+           for(j=0;j<cn;j++)
+           {
+              mu_mat[j+1]=0;
+              tau_mat[j]=(double *)malloc(sizeof(double)*(cn+1));
+ 
+           } 
+         
+           tau_mat[j]=(double *)malloc(sizeof(double)*(cn+1));
+
+           for(j=0;j<network.row;j++)
+           {
+               z_send[z_count]=1;
+               z_count++;
+               for(j1=0;j1<cn;j1++)
+               {
+                  l=continuous[j1];
+                  z_send[z_count]=network.node[l].cdata[j];   
+                  z_count++;                                            
+               }
+                  
+           }
+           
+             phi=network.node[i].prob[0]*nk;	
+               
+             //preparing tau
+      
+             //**tau_mat
+               for(j=0;j<=cn;j++)
+                     for(m=0;m<=cn;m++)
+                     {
+                      tau_mat[j][m]=1.0;
+                     }
+              
+              for(j=0;j<cn;j++)
+              {
+                 l=continuous[j];
+                 mu_p=network.node[l].prob[1];
+                 phi_p=network.node[l].prob[0]*nk;
+                 phiinv=1/phi_p; 
+                 tau11 = 1/nu + mu_p*phiinv*mu_p;
+                 tau22 = phiinv;
+                 tau12 = -mu_p*phiinv;
+                 div=tau11*tau22-tau12*tau12;
+                 if(j==0) 
+                    tau_mat[0][0]=tau22/div;
+                 tau_mat[0][j+1]=-tau12/div;
+                 tau_mat[j+1][0]=tau_mat[0][j+1];
+                 tau_mat[j+1][j+1]=tau11/div;
+              }
+
+               for(j=0;j<=cn;j++)
+                     for(m=0;m<=cn;m++)
+                     {
+                       if(tau_mat[j][m]==1.0)
+                          { 
+                                tau_mat[j][m]=tau_mat[0][j]*(tau_mat[0][m]/tau_mat[0][0]);
+                               
+                          }
+                       j1=j*(cn+1)+m;
+                       tau_send[j1]=tau_mat[j][m];
+                      
+                     }
+                      
+              loglik=0.0;
+              
+              cn_send=cn+1; 
+              
+              postc(mu_mat,tau_send,&rho,&phi,&loglik,network.node[i].cdata,z_send,&network.row,&cn_send);
+             
+ 	
+ 		free(z_send);
+ 		free(tau_send);
+              for(j=0;j<=cn;j++)
+                 free(tau_mat[j]);
+  		free(tau_mat);
+ 		free(mu_mat);
+ 		    	
+	}
+       else  //hybrid cases
+       {
+              if(cn==0)   //if parents are all discrete and child is continuous
+              { 
+   
+                     ///////////////////prepare y array and run c code////////////////////////////////
+              	loglik_sum=0;
+              	k=k2;
+      	       	y=(double *)calloc(network.row,sizeof(double));
+              	label=(char **)malloc(sizeof(char *)*(ds));  //label array
+  	       	a=(int *)calloc((ds+1),sizeof(int));
+              	l_list=(int *)malloc(sizeof(int)*(ds));
+
+          		for(j=0;j<ds;j++)
+              		label[j]=(char *)malloc(sizeof(char)*100);
+       	   
+          		for(j=0;j<ds;j++)
+          		{
+              		l=discrete[j];
+               		l_list[j]=network.node[l].type; 
+              
+          		}
+
+                   
+          		for(j=0;j<k;j++)                
+              	{
+
+                     	nu=(nk*2.0)/k2;
+	    			tau=nu;
+	    			rho=nu;	
+				mu=network.node[i].prob[1];
+				phi=network.node[i].prob[0]*nu/2;
+				loglik=0.0;
+
+ 	               	get_next_seq(a,l_list,ds);   // prepare a new combination of labels for parent
+       	      		for(i1=0;i1<ds;i1++)
+             			{
+                 			j1=a[i1];
+                 			l=discrete[i1];
+                 			strcpy(label[i1],network.node[l].label[j1]); 
+                     	}  
+             	       	y_count=0; 	
+             			for(i1=0;i1<network.row;i1++)  // search through parents data and count how many number of matches for current label list. prepare post alpha from count+alpha
+             			{
+                     		flag=0;
+                     		for(m=0;m<ds;m++)
+                     		{
+                        		
+                       			l=discrete[m];
+                        			if(strcmp(label[m],network.node[l].ddata[i1])!=0)
+                        			{
+                          				flag=1;
+                        			}      
+                     		}  
+                    		     
+                   			if(flag==0)
+                   			{
+                        			y[y_count]=network.node[i].cdata[i1];
+                        			y_count++;
+             
+                   			}
+             			}
+          
+             			postc0(&mu,&tau,&rho,&phi,&loglik,y,&y_count);
+                     	loglik_sum+=loglik;
+          
+
+              	}
+
+              	loglik=loglik_sum;
+                      
+                     free(y);
+                     for(j=0;j<ds;j++)
+                         free(label[j]);
+			free(label);
+			free(a);
+			free(l_list);
+          
+ 
+              }//end of continuous node discrete parent check
+              else //all the other hybrid cases when parents are both continuous and discrete 
+              {
+                     
+                   
+          	      tau_mat=(double **)malloc(sizeof(double *)*(cn+1));
+		      z_send=(double *)malloc(sizeof(double)*(cn+1)*network.row);
+         	      tau_send=(double *)malloc(sizeof(double)*(cn+1)*(cn+1));
+	    	      mu_mat=(double *)malloc(sizeof(double)*(cn+1));
+           	      
+           	       for(j=0;j<cn;j++)
+           		{
+              	   tau_mat[j]=(double *)malloc(sizeof(double)*(cn+1));
+ 	              } 
+         
+      		       
+           		tau_mat[j]=(double *)malloc(sizeof(double)*(cn+1));          
+
+                     ///////////////////prepare parameters  and run c code////////////////////////////////
+              	loglik_sum=0.0;
+              	k=k2;
+      	       	y=(double *)calloc(network.row,sizeof(double));
+              	label=(char **)malloc(sizeof(char *)*(ds));  //label array
+  	       	a=(int *)calloc((ds+1),sizeof(int));
+              	l_list=(int *)malloc(sizeof(int)*(ds));
+
+          		for(j=0;j<ds;j++)
+              		label[j]=(char *)malloc(sizeof(char)*100);
+       	   
+          		for(j=0;j<ds;j++)
+          		{
+              		l=discrete[j];
+               		l_list[j]=network.node[l].type; 
+              
+          		}
+
+                   
+          		for(jj=0;jj<k;jj++)                
+              	{
+
+                     	nu=(nk*2.0)/k2;
+	      			rho=nu+cn;	
+				mu_mat[0]=network.node[i].prob[1];
+
+                            for(j1=0;j1<cn;j1++)
+           		            mu_mat[j1+1]=0;
+
+				phi=network.node[i].prob[0]*nu/2;
+	                    //preparing tau
+                   		//**tau_mat
+             			for(j=0;j<=cn;j++)
+                               for(m=0;m<=cn;m++)
+                               {
+                   			   tau_mat[j][m]=1.0;
+                     	    }
+             
+              		for(j=0;j<cn;j++)
+              		{
+                 			l=continuous[j];
+                 			mu_p=network.node[l].prob[1];
+                 			phi_p=network.node[l].prob[0]*(nk/k2);
+                
+                 			phiinv=1/phi_p; 
+                 			tau11 = 1/nu + mu_p*phiinv*mu_p;
+                 			tau22 = phiinv;
+                 			tau12 = -mu_p*phiinv;
+                 			div=tau11*tau22-tau12*tau12;
+                 			if(j==0) 
+                  			    tau_mat[0][0]=tau22/div;
+                 
+			              tau_mat[0][j+1]=-tau12/div;
+                 			tau_mat[j+1][0]=tau_mat[0][j+1];
+                 			tau_mat[j+1][j+1]=tau11/div;
+       
+                
+              		}
+               		for(j=0;j<=cn;j++)
+                    			 for(m=0;m<=cn;m++)
+                    			 {
+			                       if(tau_mat[j][m]==1.0)
+                       		         { 
+			                            tau_mat[j][m]=tau_mat[0][j]*(tau_mat[0][m]/tau_mat[0][0]);
+                              		  }
+
+                       			j1=j*(cn+1)+m;
+                       			tau_send[j1]=tau_mat[j][m];
+                                           
+                     		   //printf("%.2lf\t",tau_mat[j][m]);
+                                    }
+                                    //printf("\n");
+              	       loglik=0.0;
+              
+  	      
+             		       cn_send=cn+1; 
+
+ 	               	
+                            get_next_seq(a,l_list,ds);   // prepare a new combination of labels for parent
+       	      		for(i1=0;i1<ds;i1++)
+             			{
+                 			j1=a[i1];
+                 			l=discrete[i1];
+                 			strcpy(label[i1],network.node[l].label[j1]); 
+                     	}  
+             	       	y_count=0;
+                            z_count=0; 	
+             			for(i1=0;i1<network.row;i1++)  // search through parents data and count how many number of matches for current label list. prepare post alpha from count+alpha
+             			{
+                     		flag=0;
+                     		for(m=0;m<ds;m++)
+                     		{
+                        		
+                       			l=discrete[m];
+                        			if(strcmp(label[m],network.node[l].ddata[i1])!=0)
+                        			{
+                          				flag=1;
+                        			}      
+                     		}  
+                    		     
+                   			if(flag==0)
+                   			{
+                        			y[y_count]=network.node[i].cdata[i1];
+
+                                          //prepare z send matrix
+                                          z_send[z_count]=1;
+                                          z_count++;
+                                          for(j1=0;j1<cn;j1++)
+                                          {
+                 			          l=continuous[j1];
+                 			          z_send[z_count]=network.node[l].cdata[i1];   
+                                             z_count++;                                            
+                                          }
+                        			y_count++;
+                   			}
+             			}
+          
+                            postc(mu_mat,tau_send,&rho,&phi,&loglik,y,z_send,&y_count,&cn_send);
+ 
+                     	loglik_sum+=loglik;
+          
+
+              	}
+
+              	loglik=loglik_sum;
+                        
+                     free(y);
+ 			//free(z);
+ 			free(z_send);
+ 			free(tau_send);
+                     for(j=0;j<=cn;j++)
+                        free(tau_mat[j]);
+          	       free(tau_mat);
+ 			free(mu_mat);
+                     for(j=0;j<ds;j++)
+                         free(label[j]);  
+ 			free(label);
+ 			free(a);
+ 			free(l_list);       
+
+              }//end of else part for hybrid when parents are mixed       
+
+       }//end of else part for hybrid
+       
+ free(continuous);
+ free(discrete); 
+ return loglik;
+
+	
+}
+
+void get_next_seq(int *a,int *l,int size)
+{
+  int j,idx;
+  idx=size-1;
+  a[idx]+=1;
+  if(a[idx]==l[idx])
+  {
+      a[idx]=0;
+      for(j=idx-1;j>=0;j--){
+        a[j]+=1;
+        if(a[j]==l[j])
+           a[j]=0;
+        else
+            break;
+      }
+  }
+}
+
+
diff --git a/sourcecodes/localscore/postc0.c b/sourcecodes/localscore/postc0.c
new file mode 100644
index 00000000..16e9ccec
--- /dev/null
+++ b/sourcecodes/localscore/postc0.c
@@ -0,0 +1,81 @@
+/*                               -*- Mode: C -*- 
+ * postc0.c --- Posterior for continuous node with 0 parents
+ * Author          : Claus Dethlefsen
+ * Created On      : Tue Mar 12 06:44:35 2002
+ * Last Modified By: Claus Dethlefsen
+ * Last Modified On: Wed Jun 04 11:57:10 2003
+ * Update Count    : 55
+ * Status          : Unknown, Use with caution!
+ */
+
+/*
+  ##
+##    Copyright (C) 2002  Susanne Gammelgaard Bøttcher, Claus Dethlefsen
+##
+##    This program 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.
+##
+##    This program 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 this program; if not, write to the Free Software
+##    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+######################################################################
+*/
+
+#include "R.h"
+#include "Rmath.h"
+
+
+void postc0(double *mu, double *tau, double *rho, double *phi, double
+	    *loglik, double *y, int *n)
+{
+	int i;
+	double logscale,logk,mscore;
+	double oldtau,oldmu;
+
+/*	Rprintf("her er mu=%f\n",*mu);
+	Rprintf("her er tau=%f\n",*tau);
+	Rprintf("her er rho=%f\n",*rho);
+	Rprintf("her er phi=%f\n",*phi);
+	Rprintf("her er loglik=%f\n",*loglik);
+*/
+
+	for(i = 0; i < *n; i++) {
+		
+		logscale = log(*phi)+log1p(1.0/(*tau));
+		logk = lgammafn( 0.5*(1.0+*rho) ) - lgammafn(*rho*0.5);
+		logk -= 0.5*(logscale + log(M_PI));
+		mscore = logk - 0.5*(*rho+1.0)*log1p( (y[i]-*mu)*(y[i]-*mu)/exp(logscale));
+		*loglik += mscore;
+
+		oldtau = *tau;
+		oldmu  = *mu;
+
+		(*tau)++;
+		(*rho)++;
+/*	Rprintf("her er oldmu=%f\n",oldmu);
+	Rprintf("her er oldtau=%f\n",oldtau);
+	Rprintf("her er mu=%f\n",*mu);
+	Rprintf("her er tau=%f\n",*tau);
+*/
+		*mu = (oldtau*(*mu)+y[i])/(*tau);
+		*phi+= (y[i]-(*mu))*y[i] + (oldmu-(*mu))*oldtau*oldmu;
+/*		Rprintf("logscale=%f\n",logscale);
+		Rprintf("logk=%f\n",logk);
+		Rprintf("mscore=%f\n",mscore);
+		Rprintf("loglik=%f\n",*loglik);
+		
+	Rprintf("her er mu=%f\n",*mu);
+	Rprintf("her er tau=%f\n",*tau);
+	Rprintf("her er rho=%f\n",*rho);
+	Rprintf("her er phi=%f\n",*phi);
+	Rprintf("her er loglik=%f\n",*loglik);
+*/
+	}
+}
diff --git a/sourcecodes/localscore/rlocale.h b/sourcecodes/localscore/rlocale.h
new file mode 100644
index 00000000..ac08f341
--- /dev/null
+++ b/sourcecodes/localscore/rlocale.h
@@ -0,0 +1,118 @@
+/*
+ *  R : A Computer Language for Statistical Data Analysis
+ *  Copyright (C) 2005-12   The R Core Team
+ *
+ *  This program 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.
+ *
+ *  This program 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 this program; if not, a copy is available at
+ *  http://www.r-project.org/Licenses/
+ */
+
+
+/*  This file was contributed by Ei-ji Nakama.
+ *  See also the comments in src/main/rlocale.c.
+
+ * For use in R only. 
+ */
+
+#ifndef R_LOCALE_H
+#define R_LOCALE_H
+
+#ifndef NO_C_HEADERS
+#include <wchar.h>
+#include <ctype.h>
+#include <wctype.h>
+#endif
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+extern const char *locale2charset(const char *);
+
+/*
+ * Windows CJK
+ * In Unicode, there is not a rule about character width. 
+ * A letter of breadth is used in a CJK (China, Japan, Korea,
+ * Taiwan, Hong Kong, and Singapore) area, and there are a
+ * letter and a standard (character width is not still prescribed)
+ * of a cord in a country.
+ * Letter width is a problem of a font, but it is a rule route
+ * besides a alphanumeric character that use a breadth letter.
+ * It is generally defined as a breadth letter for a font such
+ * as Japanese.
+ * - Win32
+
+ *  Attempted explanation by BDR
+ *  The display widths of characters are not prescribed in Unicode.
+ *  Double-width characters are used in the CJK area: their width can
+ *  be font-specific, with different fonts in use in different parts
+ *  of the CJK area.  The tables supplied in many OSes and by Marcus
+ *  Kuhn are not do not take the exact locale into account.  The
+ *  tables supplied in rlocale_data.h allow different widths for
+ *  different parts of the CJK area, and also where needed different
+ *  widths on Windows.  (The Windows differences are in zh_CN, and
+ *  apply to European characters.)
+ *
+ */
+extern int Ri18n_wcwidth(wchar_t);
+extern int Ri18n_wcswidth (const wchar_t *, size_t);
+
+/* Mac OSX CJK and WindowXP(Japanese)
+ * iswctypes of MacOSX calls isctypes. no i18n.
+ * For example, iswprint of Windows does not accept a macron of
+ * Japanese "a-ru" of R as a letter. 
+ * Therefore Japanese "Buraian.Ripuri-" of "Brian Ripley" is
+ * shown of hex-string.:-)
+ * We define alternatives to be used if
+ * defined(Win32) || defined(__APPLE_CC__) || defined(_AIX)
+ */
+extern wctype_t Ri18n_wctype(const char *);
+extern int      Ri18n_iswctype(wint_t, wctype_t);
+
+#ifndef IN_RLOCALE_C
+/* We want to avoid these redefinitions in rlocale.c itself */
+#undef iswupper
+#undef iswlower
+#undef iswalpha
+#undef iswdigit
+#undef iswxdigit
+#undef iswspace
+#undef iswprint
+#undef iswgraph
+#undef iswblank
+#undef iswcntrl
+#undef iswpunct
+#undef iswalnum
+#undef wctype
+#undef iswctype
+
+#define iswupper(__x)     Ri18n_iswctype(__x, Ri18n_wctype("upper"))
+#define iswlower(__x)     Ri18n_iswctype(__x, Ri18n_wctype("lower"))
+#define iswalpha(__x)     Ri18n_iswctype(__x, Ri18n_wctype("alpha"))
+#define iswdigit(__x)     Ri18n_iswctype(__x, Ri18n_wctype("digit"))
+#define iswxdigit(__x)    Ri18n_iswctype(__x, Ri18n_wctype("xdigit"))
+#define iswspace(__x)     Ri18n_iswctype(__x, Ri18n_wctype("space"))
+#define iswprint(__x)     Ri18n_iswctype(__x, Ri18n_wctype("print"))
+#define iswgraph(__x)     Ri18n_iswctype(__x, Ri18n_wctype("graph"))
+#define iswblank(__x)     Ri18n_iswctype(__x, Ri18n_wctype("blank"))
+#define iswcntrl(__x)     Ri18n_iswctype(__x, Ri18n_wctype("cntrl"))
+#define iswpunct(__x)     Ri18n_iswctype(__x, Ri18n_wctype("punct"))
+#define iswalnum(__x)     Ri18n_iswctype(__x, Ri18n_wctype("alnum"))
+#define wctype(__x)       Ri18n_wctype(__x)
+#define iswctype(__x,__y) Ri18n_iswctype(__x,__y)
+#endif
+
+#ifdef  __cplusplus
+}
+#endif
+#endif /* R_LOCALE_H */
diff --git a/sourcecodes/localscore/stats_package.h b/sourcecodes/localscore/stats_package.h
new file mode 100644
index 00000000..3717c482
--- /dev/null
+++ b/sourcecodes/localscore/stats_package.h
@@ -0,0 +1,71 @@
+/*
+ *  R : A Computer Language for Statistical Data Analysis
+ *  Copyright (C) 2007  The R Core Team.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation; either version 2.1 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this program; if not, a copy is available at
+ *  http://www.r-project.org/Licenses/
+ */
+
+#ifndef R_STATS_PACKAGE_H
+#define R_STATS_PACKAGE_H
+#include <Rconfig.h>
+
+#ifdef HAVE_VISIBILITY_ATTRIBUTE
+# define attribute_hidden __attribute__ ((visibility ("hidden")))
+#else
+# define attribute_hidden
+#endif
+
+enum AlgType {NREG = 1, OPT = 2};
+				/* 0-based indices into v */
+enum  VPos {F = 9, F0 = 12, FDIF = 10, G = 27, HC = 70};
+				/* 0-based indices into iv */
+enum IVPos {AI = 90, AM = 94, ALGSAV = 50, COVMAT = 25,
+	    COVPRT = 13, COVREQ = 14, DRADPR = 100,
+	    DTYPE = 15, IERR = 74, INITH = 24, INITS = 24,
+	    IPIVOT = 75, IVNEED =  2, LASTIV = 42, LASTV = 44,
+	    LMAT =  41, MXFCAL = 16, MXITER = 17, NEXTV  = 46,
+	    NFCALL =  5, NFCOV = 51, NFGCAL = 6, NGCOV = 52,
+	    NITER = 30, NVDFLT = 49, NVSAVE = 8, OUTLEV = 18,
+	    PARPRT = 19, PARSAV = 48, PERM = 57, PRUNIT = 20,
+	    QRTYP = 79, RDREQ = 56, RMAT = 77, SOLPRT = 21,
+	    STATPR = 22, TOOBIG = 1, VNEED = 3, VSAVE = 59,
+	    X0PRT = 23};
+
+void attribute_hidden
+S_Rf_divset(int alg, int iv[], int liv, int lv, double v[]);
+
+void attribute_hidden
+S_nlsb_iterate(double b[], double d[], double dr[], int iv[],
+	       int liv, int lv, int n, int nd, int p,
+	       double r[], double rd[], double v[], double x[]);
+
+void attribute_hidden
+S_nlminb_iterate(double b[], double d[], double fx, double g[],
+		 double h[], int iv[], int liv, int lv, int n,
+		 double v[], double x[]);
+
+static R_INLINE int S_v_length(int alg, int n)
+{
+    return (alg - 1) ? (105 + (n * (2 * n + 20))) :
+	(130 + (n * (n + 27))/2);
+}
+
+static R_INLINE int S_iv_length(int alg, int n)
+{
+    return (alg - 1) ? (82 + 4 * n) : (78 + 3 * n);
+}
+
+#endif /* R_STATS_PACKAGE_H */
+
diff --git a/sourcecodes/localscore/stats_stubs.h b/sourcecodes/localscore/stats_stubs.h
new file mode 100644
index 00000000..bc46821e
--- /dev/null
+++ b/sourcecodes/localscore/stats_stubs.h
@@ -0,0 +1,68 @@
+/*
+ *  R : A Computer Language for Statistical Data Analysis
+ *  Copyright (C) 2007  The R Core Team.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation; either version 2.1 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this program; if not, a copy is available at
+ *  http://www.r-project.org/Licenses/
+ */
+
+#include <Rconfig.h>
+#include <Rinternals.h>
+#include <R_ext/Rdynload.h>
+
+#ifdef HAVE_VISIBILITY_ATTRIBUTE
+# define attribute_hidden __attribute__ ((visibility ("hidden")))
+#else
+# define attribute_hidden
+#endif
+
+void attribute_hidden
+S_Rf_divset(int alg, int iv[], int liv, int lv, double v[])
+{
+    static void(*fun)(int,int[],int,int,double[]) = NULL;
+    if (fun == NULL)
+	fun = (void(*)(int,int[],int,int,double[]))
+	    R_GetCCallable("stats", "Rf_divset");
+    fun(alg, iv, liv, lv, v);
+}
+
+void attribute_hidden
+S_nlminb_iterate(double b[], double d[], double fx, double g[], double h[],
+		 int iv[], int liv, int lv, int n, double v[], double x[])
+{
+    static void(*fun)(double[],double[],double,double[],double[],
+		      int[],int,int,int,double[],double[]) = NULL;
+    if (fun == NULL)
+	fun = (void(*)(double[],double[],double,double[],double[],
+			  int[],int,int,int,double[],double[]))
+	    R_GetCCallable("stats", "nlminb_iterate");
+    fun(b, d, fx, g, h, iv, liv, lv, n, v, x);
+}
+
+void attribute_hidden
+S_nlsb_iterate(double b[], double d[], double dr[], int iv[], int liv,
+	       int lv, int n, int nd, int p, double r[], double rd[],
+	       double v[], double x[])
+{
+    static void(*fun)(double[],double[],double[],int[],int,int,
+		      int,int,int,double[],double[],double[],
+		      double[]) = NULL;
+    if (fun == NULL)
+	fun = (void(*)(double[],double[],double[],int[],int,
+		       int, int,int,int,double[],
+		       double[],double[],double[]))
+	    R_GetCCallable("stats", "nlsb_iterate");
+    fun(b, d, dr, iv, liv, lv, n, nd, p, r, rd, v, x);
+}
+
diff --git a/sourcecodes/mat_structure.php b/sourcecodes/mat_structure.php
new file mode 100644
index 00000000..dd1daccf
--- /dev/null
+++ b/sourcecodes/mat_structure.php
@@ -0,0 +1,78 @@
+<?php
+function structure_change($keyval)
+{
+$dir="./data/";
+$matfile=$dir.$keyval."varname.txt";
+$namelist=file_get_contents("$matfile");
+$matfilestruct=$dir.$keyval."structure_input.txt";
+$list=file_get_contents("$matfilestruct");
+$ft=$dir.$keyval."structure_input_new.txt";
+$fp = fopen("$ft","w");
+
+$str_arrname=array();
+$str_arrname=explode("\n",$namelist);
+$dataname=array();
+$dataname=explode("\t",$str_arrname[0]);
+
+$arrname=array();
+$arrname=explode("\n",$list); 
+
+
+$cell_val=array();
+
+$data_cell=array();
+
+$name=explode("\t",$arrname[0]);
+
+
+
+$i=0;
+foreach($name as $name_cell)
+{
+ $cell_val[$i]=1;
+ $name_cell=trim($name_cell);
+  foreach($dataname as $list_name)
+  { 
+       $list_name=trim($list_name);
+        if($name_cell==$list_name)
+        {   
+             //echo $name_cell; 
+             $cell_val[$i]=0;
+             
+        }
+   
+  }
+$i++;
+}
+
+
+$j=0;
+for($l=0;$l<=$i;$l++)
+{
+  $line=$arrname[$l];
+
+  if($j==0)
+  {
+    fwrite($fp,$line);
+    
+  }
+  else
+  {  
+   
+    $data_cell=explode("\t",$line);
+  
+    for($k=0;$k<$i;$k++)
+    {
+       $cell=$data_cell[$k]*$cell_val[$k];
+       fprintf($fp,"%s\t",$cell);
+    } 
+  }
+  fprintf($fp,"\n");
+ 
+  $j++;
+}
+
+//return $matfilestruct;
+}
+
+?>
\ No newline at end of file
diff --git a/sourcecodes/matrix.php b/sourcecodes/matrix.php
new file mode 100644
index 00000000..7d6eb87f
--- /dev/null
+++ b/sourcecodes/matrix.php
@@ -0,0 +1,187 @@
+<?php 
+$keyval=$_GET["My_key"];
+$dir="./data/";
+
+$matfile=$dir.$keyval."structure_input_temp.txt";
+$fpw=fopen($dir.$keyval."Model_Averaging_Scores.txt","w");
+$matrix1=file_get_contents("$matfile");              //file("$matfile");
+fwrite($fpw,$matrix1);
+fclose($fpw);
+$str_arrmat=array();
+$str_arrmat=explode("\n",$matrix1);
+$datamat=array();
+$data_cell=array(); 
+
+$dataname=array();
+$dataname=explode("\t",$str_arrmat[0]);
+$n=count($dataname);
+
+
+
+
+
+//echo $m_line;
+
+
+if($matrix1!="")
+{?>
+ <h2> Model Averaging Scores </h2>
+ <br><table width="90%" align="center" style="background-color:" bordercolor="" border=1 cellspacing="0" cellpadding="0">
+  
+<tr>
+<th>
+Name
+</th>
+<?php
+
+
+foreach($dataname as $cell1)
+{
+  $cell1=trim($cell1);
+    ?>
+<th> <?php print($cell1); ?> </th>
+<?php
+
+}
+?>
+</tr>
+<?php
+   
+   for($i=0;$i<$n;$i++)
+   {
+       $ii=$i+1;
+       $datamat=explode("\t",$str_arrmat[$ii]);
+        
+       ?>
+   <tr>
+   <th>
+      <?php print trim($dataname[$i]); ?>
+   </th>
+   <?php
+     $dpr=trim($dataname[$i]);
+    
+ 
+	foreach($datamat as $cell)
+	{
+         $cell=trim($cell);
+         if($cell!="")
+          {  
+          ?>
+          <td>
+            <?php  print $cell; ?>
+         </td>   
+     <?php
+         
+	     }
+        }
+      ?> 
+    <tr>
+   <?php
+       
+       }
+     ?>
+ </table>
+
+<a href=<?php $d="./data/".$keyval."Model_Averaging_Scores.txt"; print($d);?>>download</a>
+
+<?php 
+
+}
+
+/////////////////////////////////Second//////////////////////////////////////////////////////////
+
+
+$matfile=$dir.$keyval."structure_input.txt";
+//echo $matfile;
+
+$fpw=fopen($dir.$keyval."Structure_matrix.txt","w");
+
+$matrix1=file_get_contents("$matfile");              //file("$matfile");
+
+fwrite($fpw,$matrix1);
+fclose($fpw);
+
+
+
+
+$str_arrmat=array();
+$str_arrmat=explode("\n",$matrix1);
+$datamat=array();
+$data_cell=array(); 
+
+$dataname=array();
+$dataname=explode("\t",$str_arrmat[0]);
+$n=count($dataname);
+
+
+
+
+
+//echo $m_line;
+
+
+if($matrix1!="")
+{?>
+ <h2> Structure Matrix </h2>
+ <br><table width="90%" align="center" style="background-color:" bordercolor="" border=1 cellspacing="0" cellpadding="0">
+  
+<tr>
+<th>
+Name
+</th>
+<?php
+
+
+foreach($dataname as $cell1)
+{
+  $cell1=trim($cell1);
+    ?>
+<th> <?php print($cell1); ?> </th>
+<?php
+
+}
+?>
+</tr>
+<?php
+   
+   for($i=0;$i<$n;$i++)
+   {
+       $ii=$i+1;
+       $datamat=explode("\t",$str_arrmat[$ii]);
+        
+       ?>
+   <tr>
+   <th>
+      <?php print trim($dataname[$i]); ?>
+   </th>
+   <?php
+     $dpr=trim($dataname[$i]);
+    
+ 
+	foreach($datamat as $cell)
+	{
+         $cell=trim($cell);
+         if($cell!="")
+          {  
+          ?>
+          <td>
+            <?php  print $cell; ?>
+         </td>   
+     <?php
+         
+	     }
+        }
+      ?> 
+    <tr>
+   <?php
+       
+       }
+     ?>
+ </table>
+<?php 
+
+}
+?>
+
+<a href=<?php $d="./data/".$keyval."Structure_matrix.txt"; print($d);?>>download<br></a>
+<input type=button onClick="self.close();" value="Close this window">
\ No newline at end of file
diff --git a/sourcecodes/maxparent_table.txt b/sourcecodes/maxparent_table.txt
new file mode 100644
index 00000000..5c5f8cd8
--- /dev/null
+++ b/sourcecodes/maxparent_table.txt
@@ -0,0 +1,19 @@
+0	X																	
+0	0	X																
+0	0	0	X															
+0	0	0	0	X														
+0	0	0	0	0	X													
+0	0	0	0	0	1	X												
+0	0	0	0	0	1	1	X											
+0	0	0	1	1	1	1	1	X										
+0	0	1	2	2	2	3	3	3	X									
+0	0	1	3	4	6	6	8	10	14	X								
+0	0	2	4	9	13	17	18	18	18	19	X							
+0	1	3	7	15	26	37	42	44	46	46	46	X						
+0	1	4	11	29	54	83	108	115	120	120	120	124	X					
+0	1	5	20	49	101	171	229	272	294	301	301	302	302	X				
+0	2	7	27	82	182	328	487	611	693	730	733	737	740	740	X			
+0	2	10	40	126	310	615	989	1332	1590	1737	1784	1792	1796	1796	1798	X		
+0	2	11	57	191	514	1098	1905	2765	3519	3983	4224	4343	4385	4388	4408	4408	X	
+0	2	12	78	286	818	1876	3534	5545	7525	8959	9362	9639	9648	9648	9651	9653	9657	X
+0	2	14	106	415	1197	2780	5462	9854	13601	17026	19062	19185	19298	19298	19302	19306	19511	19716
diff --git a/sourcecodes/my_new_style.css b/sourcecodes/my_new_style.css
new file mode 100644
index 00000000..20db184f
--- /dev/null
+++ b/sourcecodes/my_new_style.css
@@ -0,0 +1,155 @@
+* {
+padding: 0;
+margin: 0;
+}
+html, body {
+height: 100%;
+}
+
+body {
+  margin:0px;
+  font-family: Georgia, "Times New Roman",
+        Times, serif;
+  color: #33339F;
+  background-color: white;
+  padding-bottom:0px; 
+
+}
+
+
+
+.td_title
+{
+        padding: 0;
+        margin: 0;
+        font-family:Arial;
+        font-size:24pt;
+        HRIZONTAL-ALIGN: center;
+        color:#FFFFFF;
+        font-weight:bold;
+        //FONT-STYLE: italic;
+        background-color: #33339F;
+        text-align:center
+
+}
+
+
+
+#outer {
+  padding: 0;
+  margin: 0;
+  position: absolute;
+  top: 9em;
+  left: 12em;
+  text-align:left;
+  background:white;
+  min-width:50%;
+  min-hieght:50%;
+  max-width:70%;
+
+}
+
+#outernew {
+  padding: 0;
+  margin: 0;
+  position: absolute;
+  top: 9em;
+  left: 12em;
+  text-align:left;
+  background:white;
+  min-width:50%;
+  min-hieght:50%;
+  max-width:60%;
+
+}
+
+#outernewnew {
+  padding: 0;
+  margin: 0;
+  position: absolute;
+  top: 12em;
+  left: 25em;
+  text-align:left;
+  background:white;
+  min-width:50%;
+  min-hieght:50%;
+  max-width:60%;
+
+}
+
+
+
+ul.navbar {
+  list-style-type: none;
+  padding: 0;
+  margin: 0;
+  /*position: relative;*/
+  float: top;
+  /*margin-top: 20px;*/
+  top: 9em;
+  left: 1em;
+  width: 9em }
+
+ul.navbar2 {
+  list-style-type: none;
+  padding: 0;
+  margin: 0;
+  /*position: absolute;*/
+  float:top;
+  top: 9em;
+  left: 1em;
+  width: 9em }
+
+ul.listbar {
+  list-style-type: none;
+  padding: 0;
+  margin: 0;
+  position: relative;
+  }
+
+
+
+h1 {
+  font-family: Helvetica, Geneva, Arial,
+        SunSans-Regular, sans-serif }
+ul.navbar li {
+/*  background: #D0A9F5; */
+  background: #33339F;
+  margin: 0.5em 0;
+  padding: 0.3em;
+  border-right: 1em solid black }
+ul.navbar a {
+  text-decoration: none 
+}
+ul.navbar a:link {
+ color: white; }
+ul.navbar a:visited {
+ color: white; }
+
+ul.navbar2 li {
+/*  background: #D0A9F5; */
+  background: black;
+  margin: 0.5em 0;
+  padding: 0.3em;
+  border-right: 1em solid #33339F;
+  color: white }
+ul.navbar2 a {
+  text-decoration: none 
+}
+ul.navbar2 a:link {
+ color: white; }
+ul.navbar2 a:visited {
+ color: white; }
+
+a:link {
+  color: black; }
+a:hover {
+	color: black;
+	}
+a:visited {
+  color: black; }
+address {
+  margin-top: 1em;
+  padding-top: 1em;
+  border-top: thin dotted }
+
diff --git a/sourcecodes/net_structure.php b/sourcecodes/net_structure.php
new file mode 100644
index 00000000..ba1b9de1
--- /dev/null
+++ b/sourcecodes/net_structure.php
@@ -0,0 +1,137 @@
+<?php
+include("header_new.inc");
+include("header_batchsearch.inc");
+////////////////continuous///////////////
+$searchID="";
+$UploadValue="NO";
+$TextFile=$HTTP_POST_FILES["MyFile"]["name"];
+
+if($_POST["My_key"]!="")
+  $keyval=$_POST["My_key"];
+
+if($_GET["My_key"]!="")
+  $keyval=$_GET["My_key"];
+
+
+
+$sid="structure_input";
+$dir="./data/$keyval";
+
+$TextinFileFinal=$dir.$sid.".txt";
+
+$TextinFile=$dir.$sid."_temp.txt";
+
+$TextinFilenamelist=$dir."name.txt";
+
+if(isset($HTTP_POST_VARS["searchkey"]))
+{
+   $searchID=$HTTP_POST_VARS["searchkey"];
+}
+
+if(isset($HTTP_POST_VARS["MyUpload"]))
+{
+   $UploadValue=$HTTP_POST_VARS["MyUpload"];
+   if ($UploadValue=="YES")
+   {
+        if($TextFile!="")
+        {
+            $sta=move_uploaded_file($HTTP_POST_FILES['MyFile']['tmp_name'],$TextinFile);
+            if(!$sta)
+            {
+                 echo "<script type='text/javascript'> window.alert ('Sorry, error uploading $TextFile.')</script>";
+                 flush();
+                 exit();
+            }
+            else
+            {
+                 $searchID=file_get_contents("$TextinFile");
+		 //fclose($fh);
+		  unlink($TextinFile);
+
+            }
+
+        }
+
+       else
+       {
+           echo "<script type='text/javascript'> window.alert ('Sorry, please select upload file.')</script>";
+       }
+   }
+}
+
+if($searchID!="")
+{
+?>
+
+<!-- Site navigation menu -->
+<ul class="navbar2">
+  <li><a href="graphviz_structure.php?My_key=<?php print($keyval);?>">Display structure</a>
+</ul>
+<ul class="navbar">
+  <li><a href="help.php#file_format" target="_blank">Data formatting guidelines</a>
+  <li><a href="help.php" target="_blank">Help</a>
+  <li><a href="home.php">Home</a>
+</ul>
+<?php
+}
+else
+{
+
+?>
+<!-- Site navigation menu -->
+<ul class="navbar">
+  <li><a href="help.php#file_format" target="_blank">Data formatting guidelines</a>
+  <li><a href="help.php" target='_blank'>Help</a>
+  <li><a href="home.php">Home</a>
+</ul>
+<?php
+}
+?>
+
+<div id="outernew">
+
+<h2>Upload network structure</h2>
+<FORM name="key_search" enctype="multipart/form-data" ACTION="net_structure.php" METHOD=POST>
+
+<table align="left" cellspacing="3" cellpadding="1" border="0"  width="90%">
+<tr>
+   <td>
+       <INPUT style="background-color:#FFFFFF;color:#0000FF" type="file" name="MyFile" size=45 > 
+       <INPUT TYPE="submit" value="  Upload  " onclick="return Upload();">
+      <INPUT TYPE="hidden" NAME="My_key" value=<?php print($keyval) ?> >
+        <INPUT TYPE="hidden" name="MyUpload" value="NO"> 
+   </td>
+</tr>
+<tr>
+   <td><font color=#3735CA><br>Content of uploaded structure file:</font><br>
+          <textarea name="searchkey" rows="10" cols="100"><?PHP print($searchID)?> </textarea>
+  </td>
+</tr>
+<tr>
+    <td>
+       <INPUT TYPE="submit" value="  Load example structure  " onclick="return demo_str();">&nbsp&nbsp&nbsp
+      <INPUT TYPE="hidden" NAME="My_key" value=<?php print($keyval) ?> >
+    </td>
+</tr>
+
+</table>
+</FORM>
+
+</div>
+<?php
+  $str_arr=array();
+  $searchID=trim($searchID);
+  $str_arr=explode("\n",$searchID);
+  $data=array();
+    
+  $fpmain = fopen($TextinFileFinal,"w");
+  
+  foreach($str_arr as $line)
+  {
+       $line=trim($line);
+	fwrite($fpmain, "$line\n");
+      
+  }
+
+
+?>
diff --git a/sourcecodes/network_layout_evd.php b/sourcecodes/network_layout_evd.php
new file mode 100644
index 00000000..a5909436
--- /dev/null
+++ b/sourcecodes/network_layout_evd.php
@@ -0,0 +1,667 @@
+<?php 
+include("structuremap.php");
+
+function levelmap($inx,$name,$mapdata)
+{
+
+$leve_l=array();
+$leve_l=explode("\n",$mapdata);
+$leve_d=array();
+
+foreach($leve_l as $l)
+{ 
+  $l=trim($l);
+  $leve_d=explode("\t",$l);
+  $inxname=trim($leve_d[0]);
+  $name=trim($name);
+  if($inxname==$name)
+    return $leve_d[$inx];
+}
+           
+}
+
+
+////////////////////////////////////Read data from net_figure file///////////////////////Graphp Display/////////////////////////////////////////////
+$dir="./data/";
+
+
+$keyval=$_GET["My_key"];
+
+$matfile=$dir."$keyval"."net_figure.txt";
+
+$data_val="";
+
+$matrix=file("$matfile");
+$matrix1=file_get_contents("$matfile");   
+
+$lfile=$dir.$keyval."nlevels.txt";
+$levelmap=file_get_contents($lfile);   
+
+
+$str_arrmat=array();
+$str_arrmat=explode("\n",$matrix1);
+
+if($str_arrmat[2]=="" || $matrix1=="")
+{
+?>
+<h1><font color=blue>Error: Unable to display your network structure.</font></h1>
+<?php
+exit;
+}
+
+$datamat=array();
+$data_read=array();
+ 
+$node=trim($str_arrmat[0]);
+/*
+if($node<=5)
+{
+  $width=200;
+  $hieght=150;
+  $font=14;
+}
+else if($node>5 && $node<=7)
+{
+  $width=150;
+  $hieght=120;
+  $font=12;
+
+}
+else if($node>7 && $node<=10)
+{
+  $width=110;
+  $hieght=85;
+  $font=10;
+}
+else 
+{
+  $width=80;
+  $hieght=60;
+  $font=8;
+}
+*/
+  $width=150;
+  $hieght=150;
+  $font=12;
+
+$r_index=$node+2;
+
+for($i=0;$i<$node;$i++)
+{
+$datamat=explode("\t",$str_arrmat[$r_index]);
+$data_read[$i][0]=trim($datamat[0]);  //name
+$data_read[$i][1]=trim($datamat[1]);  //datatype
+$col_in=2;
+$r_index+=4;
+	if($datamat[1]==1)  //type=coninuous
+	{
+         for($j=1;$j<=101;$j++)
+         {
+           $datamat=explode("\t",$str_arrmat[$r_index]);
+           $data_read[$i][$col_in]=trim($datamat[0]);  //x data
+         //  echo $data_read[$i][$col_in];
+          // echo '&nbsp';
+
+           $col_in++;
+           $data_read[$i][$col_in]=trim($datamat[1]);  //y data
+          // echo $data_read[$i][$col_in];
+	   // echo '&nbsp';
+
+           $col_in++;
+           $r_index++; // increment to point next data
+           // echo "<br />"; 
+         } 
+	}
+	if($datamat[1]>1)  //type=descrete
+	{
+         $iter=$datamat[1];
+         for($j=1;$j<=$iter;$j++)
+         {
+           $datamat=explode("\t",$str_arrmat[$r_index]);
+           $data_read[$i][$col_in]=trim($datamat[0]);  //x data
+           //use level mapping
+           $data_read[$i][$col_in]=levelmap($data_read[$i][$col_in],$data_read[$i][0],$levelmap);
+ 
+           $col_in++;
+           $data_read[$i][$col_in]=trim($datamat[1]);  //y data
+         
+           $col_in++;
+           $r_index++; // increment to point next data
+           //echo "<br />"; 
+         } 
+	}
+
+}
+
+
+
+
+////////////////////////////////////////////////Graphviz data read////////////////////////////////////////////////////////////////////////////////
+
+$grv=$dir.$keyval."graphviz.txt";
+$line=shell_exec('/usr/bin/dot -Tplain -y '.$grv);
+
+
+$grviz_name_list=array();
+$g_file_name="./data/".$keyval."grviz_name_file.txt";
+$grviz_name=file_get_contents("$g_file_name");
+$grviz_name_list=explode("\n",$grviz_name);
+
+
+
+//$foutnew=fopen("contentofgraphviz.txt","w");
+//fwrite($foutnew,"$line");
+
+
+//$grfilename=$keyval."graphviz.txt";
+//$cmd="/usr/bin/dot -Tplain -y  $grfilename";
+//$line=system($cmd);
+
+
+
+
+$str_arrname=array();
+$str_arrname=explode("\n",$line);
+$data=array();
+$ID_data=array();
+$i=0;
+$ii=0;
+foreach($str_arrname as $row)
+{
+  $i++;
+  if($i>1)
+  {
+       
+  	$data=explode(" ",$row);
+       $j=0;
+       $k=0;
+       $flag=0;
+  	foreach($data as $cell)
+	{
+             
+             $j++;
+             
+             $cell=trim($cell);
+             //echo $cell;
+             //echo '&nbsp';
+             if($j==1 && $cell=="node")
+             {
+                $flag=1;
+             }  
+               
+             if($j>1 && $j<5 && $flag==1)
+             {
+    		  //echo $cell;
+   		  //echo '&nbsp';
+                if($j==2)
+                {
+                    
+                   $ID_data[$ii][$k]=$grviz_name_list[$cell];
+                } 
+                else
+                   $ID_data[$ii][$k]=round($cell/10*900);
+               // echo $ID_data[$ii][$k];
+                //echo '&nbsp';
+
+                $k++; 
+             }
+       } 
+  
+       if($flag==1)
+       {
+          $ID_data[$ii][3]=$ID_data[$ii][1]+100;
+          $ID_data[$ii][4]=$ID_data[$ii][2]+150; 
+          $ID_data[$ii][5]=$ID_data[$ii][1]+100;
+          $ID_data[$ii][6]=$ID_data[$ii][2]; 
+          $ii++;
+          //echo "<br />"; 
+       } 
+     // echo "<br />"; 
+	
+  }
+}
+
+$nnode=$ii;
+$edge_data=array();
+
+$i=0;
+$ii=0;
+
+foreach($str_arrname as $row)
+{
+  $i++;
+  if($i>1)
+  {
+       
+  	$data=explode(" ",$row);
+       $j=0;
+       
+       $flag=0;
+       $number_of_point=0;
+       $index=0; 
+  	foreach($data as $cell)
+	{
+             $j++;
+             $cell=trim($cell);
+         
+             if($j==1 && $cell=="edge")
+             {
+                $flag=1;
+             }  
+               
+             if($j==2 && $flag==1)
+             {
+                
+                for($k=0;$k<$nnode;$k++)
+                {     
+                      $cell=$grviz_name_list[$cell];
+                      if($cell==$ID_data[$k][0])
+                      {
+                          $edge_data[$ii][0]=$ID_data[$k][3];
+                          $edge_data[$ii][1]=$ID_data[$k][4];
+                      }                     
+
+                }
+               
+             }
+             else if($j==3 && $flag==1)
+             {
+               for($k=0;$k<$nnode;$k++)
+                {
+                      if($cell==$ID_data[$k][0])
+                      {
+                          $edge_data[$ii][2]=$ID_data[$k][5];
+                          $edge_data[$ii][3]=$ID_data[$k][6];
+                      }                     
+
+                }
+
+             }
+             else if($j==4 && $flag==1)
+             {
+                  $edge_data[$ii][4]=$cell;
+                  $number_of_point=$cell*2;
+                  $index=5;
+             }
+             else if($j>4 && $number_of_point>0 && $flag==1)
+             {
+                if(($j%2)!=0)
+                  $edge_data[$ii][$index]=round($cell/10*900)+60;//+30+30;
+                else
+                  $edge_data[$ii][$index]=round($cell/10*900)+48;//+18+30;
+
+                $number_of_point--;
+                $index++;
+             }
+
+
+             
+       } 
+       if($flag==1)
+       {
+          $ii++;
+          //echo "<br />"; 
+       } 
+ 	
+  }
+}
+
+
+$nedges=$ii;
+
+?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
+<script type="text/javascript" src="http://www.google.com/jsapi"></script>
+ <script type="text/javascript">
+  google.load('visualization', '1', {packages: ['corechart']});
+ </script>
+ 
+
+<?php 
+$data_val="";
+
+for($i=0;$i<$nnode;$i++)
+ {
+////////////////////////////select node //////////////////////////////////////
+ $name=$ID_data[$i][0];
+ $fname="draw_".$name."()";
+ $data_val.=$name;
+ for($j=0;$j<$node;$j++)
+ {
+    if($data_read[$j][0]==$name)
+    {
+       $s_i=$j;
+       break;
+    } 
+ }
+ 
+/////////////////////////////////Display nodes//////////////////////////////////////////////////////////
+?>    
+ <script type="text/javascript">
+
+
+<?php
+  $node_type=$data_read[$s_i][1];
+  if($node_type>1) //discrete node
+  { 
+?>
+  
+ 
+  function <?php print($fname);?> {
+  // Create and populate the data table.
+ 
+  var data = google.visualization.arrayToDataTable([
+   ['<?php print($name);?>', ''],
+  <?php
+  $c_i=2; 
+
+  for($j=0;$j<$node_type-1;$j++) 
+  {     
+       $val1=trim($data_read[$s_i][$c_i]);
+
+
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;
+       $data_val.="\t".$val2;
+        
+  ?>
+   ['<?php print($val1);?>', <?php print($val2);?>],
+
+  <?php
+  }
+  if($j==$node_type-1)
+  {
+        $val1=trim($data_read[$s_i][$c_i]);
+
+
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;
+       $data_val.="\t".$val2."\n";
+  ?> 
+    ['<?php print($val1);?>', <?php print($val2);?>]
+<?php
+  }
+?>
+  ]);
+      
+        // Create and draw the visualization.
+      
+      var cnode="<?php print($name); ?>";
+      var keyv="<?php print($keyval);?>";  
+
+        var chart = new google.visualization.BarChart(document.getElementById('<?php print($name);?>'));
+        function selectHandler() {
+          var selectedItem = chart.getSelection()[0];
+          if (selectedItem) {
+            var topping = data.getValue(selectedItem.row, 0);
+            
+            var s = window.prompt('Selected evidence ' + topping + ' for ' + cnode + '. Enter new evidence ', topping );
+           
+            window.location.href = "add_evd.php?name=" + cnode + "&evidence=" + s + "&My_key="  + keyv;
+           
+
+  
+              //alert('The user selected ' + topping + topname);
+          }
+        } 
+         chart.draw(data,
+                 {title:"<?php print($name);?>", titleTextStyle: {fontSize: <?php print($font);?>},
+                  width:<?php print($width);?>, height:<?php print($hieght);?>,
+                  vAxis: {title: "State", textStyle: {fontSize:<?php print($font);?>}},
+		    hAxis: {title: "Fraction", minValue: 0, maxValue: 1, gridlines: {count: 3}}, legend: {position: 'none'},
+                  backgroundColor: {stroke: 'black', strokeWidth: 5}}
+            );
+        google.visualization.events.addListener(chart, 'select', selectHandler);  
+
+  }
+<?php
+ }
+ else //continuous node
+ {
+?>
+  function <?php print($fname);?> {
+  // Create and populate the data table.
+  var data = google.visualization.arrayToDataTable([
+   ['<?php print($name);?>', ''],
+  <?php
+  $c_i=2;
+  for($j=0;$j<100;$j++) 
+  {
+       $val1=trim($data_read[$s_i][$c_i]);
+       $val1=map($name,$val1,$keyval);
+
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;         
+       $data_val.="\t".$val2;
+  ?>
+   ['<?php print($val1);?>', <?php print($val2);?>],
+
+  <?php
+  }
+  if($j==100)
+  {
+       $val1=trim($data_read[$s_i][$c_i]);
+       $val1=map($name,$val1,$keyval);
+
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;
+       $data_val.="\t".$val2."\n";
+  ?> 
+    ['<?php print($val1);?>', <?php print($val2);?>]
+<?php
+  }
+?>
+  ]);
+      
+        // Create and draw the visualization.
+      var cnode="<?php print($name); ?>";
+      var keyv="<?php print($keyval);?>";  
+        var chart = new google.visualization.LineChart(document.getElementById('<?php print($name);?>'));
+
+        function selectHandler() {
+          var selectedItem = chart.getSelection()[0];
+          if (selectedItem) {
+           
+            var topping = data.getValue(selectedItem.row, 0);
+            var s = window.prompt('Selected evidence ' + topping + ' for ' + cnode + '. Enter new evidence ', topping );
+            window.location.href = "add_evd.php?name=" + cnode + "&evidence=" + s + "&My_key=" + keyv;  
+
+          }
+        }
+            chart.draw(data, {curveType: "function",
+                  title:"<?php print($name);?>", titleTextStyle: {fontSize: <?php print($font);?>},
+			legend: {position: 'none'},
+                  width:<?php print($width);?>, height:<?php print($hieght);?>,
+                  hAxis: {maxValue: 1, minValue: 0},
+			vAxis: {maxValue: 1, minValue: 0},
+                  backgroundColor: {stroke: 'black', strokeWidth: 5}}
+            );
+           google.visualization.events.addListener(chart, 'select', selectHandler); 
+       }
+
+<?php
+ }
+?>
+</script>
+<?php
+///////////////////////////end of display nodes////////////////////////////////////////////////
+}
+
+///////////////////////////////////write data to file///////////////////////////////////////////////////////////
+$fl=$dir.$keyval."structure_old.txt";
+$fp = fopen("$fl","w");
+fwrite($fp,"$data_val");
+?>
+
+
+
+<script type="text/javascript">
+function canvas_arrow(context, fromx, fromy, tox, toy){
+    var headlen = 15;
+    var dx = tox-fromx;
+    var dy = toy-fromy;
+    var angle = Math.atan2(dy,dx);
+    context.moveTo(fromx,fromy);
+    context.lineTo(tox,toy);
+    context.lineTo(tox-headlen*Math.cos(angle-Math.PI/6),toy-headlen*Math.sin(angle-Math.PI/6));
+    context.moveTo(tox,toy);
+    context.lineTo(tox-headlen*Math.cos(angle+Math.PI/6),toy-headlen*Math.sin(angle+Math.PI/6));
+}
+</script>
+
+<script type="text/javascript">
+function canvas_arrow_head(context, fromx, fromy, tox, toy){
+    var headlen = 15;
+    var dx = tox-fromx;
+    var dy = toy-fromy;
+    var angle = Math.atan2(dy,dx);
+    context.moveTo(tox,toy);
+    context.lineTo(tox-headlen*Math.cos(angle-Math.PI/6),toy-headlen*Math.sin(angle-Math.PI/6));
+    context.moveTo(tox,toy);
+    context.lineTo(tox-headlen*Math.cos(angle+Math.PI/6),toy-headlen*Math.sin(angle+Math.PI/6));
+}
+</script>
+
+
+</head>
+
+<body>
+<canvas id="test" width="3000" height="3000" style="position:absolute">
+<script>
+function canvas_arrow_draw(n, polypts,context){
+
+//Create jsGraphics object
+var headlen = 10;
+/*
+var hexno=new String;
+arr=new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f");
+var n1=Math.round(Math.random()*15);
+var n2=Math.round(Math.random()*15);
+var n3=Math.round(Math.random()*15);
+var n4=Math.round(Math.random()*15);
+var n5=Math.round(Math.random()*15);
+var n6=Math.round(Math.random()*15);
+hexno="#"+arr[n1]+""+arr[n2]+""+arr[n3]+""+arr[n4]+""+arr[n5]+""+arr[n6];
+*/
+hexno="black";
+var polypoints = new Array();
+var n2=n*2;
+
+
+var sx=polypts[0];
+var sy=polypts[1];
+ 
+var sx1=polypts[n2-4];
+var sy1=polypts[n2-3];
+var ex1=polypts[n2-2];
+var ey1=polypts[n2-1];
+
+context.beginPath();
+canvas_arrow_head(context,sx1,sy1,ex1,ey1);
+
+context.moveTo(polypts[0],polypts[1]);
+nm=n%3;
+ni=(n-nm)/3;
+
+for(i=0;i<ni;i++)
+{
+  i11=i*6+2;
+  i12=i*6+3;
+  i21=i*6+4;
+  i22=i*6+5;
+  i31=i*6+6;
+  i32=i*6+7;
+
+  context.bezierCurveTo(polypts[i11],polypts[i12],polypts[i21],polypts[i22],polypts[i31],polypts[i32]);
+  context.moveTo(polypts[i31],polypts[i32]);
+
+ // polypoints[i] = new jxPoint(polypts[i1], polypts[i2]);
+}
+
+
+if(nm==2)
+{
+  context.moveTo(polypts[i21],polypts[i22]);
+  context.bezierCurveTo(polypts[i31],polypts[i32],sx1,sy1,ex1,ey1);
+  context.moveTo(ex1,ey1);
+
+}
+
+ context.strokeStyle = hexno;
+ context.stroke();
+
+}
+
+
+var canvas=document.getElementById("test");
+var context = canvas.getContext("2d");
+context.lineWidth = 3;
+
+<?php
+for($i=0;$i<$nedges;$i++)
+{
+
+   $n=$edge_data[$i][4]; 
+   $n2=$n*2;
+   
+?>
+var polypoints = new Array();
+var j=0;
+var n="<?php print($n);?>";
+<?php
+for($j=0;$j<$n2;$j++)
+{
+$inx=$j+5;
+$data=$edge_data[$i][$inx];
+
+?>
+	polypoints[j] = "<?php print($data);?>";
+
+       j++;
+<?php
+}
+?>
+canvas_arrow_draw(n,polypoints,context);
+<?php
+}
+?>
+
+
+
+</script>
+</canvas>
+
+
+<?php 
+for($i=0;$i<$nnode;$i++)
+{
+  $x=$ID_data[$i][1]-8; $y=$ID_data[$i][2]-20; 
+
+  $name=$ID_data[$i][0];
+?>
+
+<script type="text/javascript">
+   google.setOnLoadCallback(draw_<?php print($name)?>);
+</script>
+<div id="<?php print($name)?>" style="left: <?php print($x)?>px; top: <?php print($y)?>px; width:<?php print($width);?>; height:<?php print($hieght);?>; position: absolute"></div>
+
+<?php 
+}
+?>
+
+
+</body>
+
+
+
+</html>
+
+
diff --git a/sourcecodes/network_layout_evd_2.php b/sourcecodes/network_layout_evd_2.php
new file mode 100644
index 00000000..c89cb465
--- /dev/null
+++ b/sourcecodes/network_layout_evd_2.php
@@ -0,0 +1,961 @@
+<?php 
+include("structuremap.php");
+
+
+function levelmap($inx,$name,$mapdata)
+{
+
+$leve_l=array();
+$leve_l=explode("\n",$mapdata);
+$leve_d=array();
+
+foreach($leve_l as $l)
+{ 
+  $l=trim($l);
+  $leve_d=explode("\t",$l);
+  $inxname=trim($leve_d[0]);
+  $name=trim($name);
+  if($inxname==$name)
+    return $leve_d[$inx];
+}
+           
+}
+
+
+
+$keyval=trim($_GET["My_key"]);
+//////////////////////////Entered evidences//////////////////////////////////////////
+$dir="./data/";
+
+$lfile=$dir.$keyval."nlevels.txt";
+$levelmap=file_get_contents($lfile);   
+
+
+
+$lf=$dir."$keyval"."varname.txt";
+
+$lines = file("$lf");
+
+$ev_arr=array();
+$evdata_arr=array();
+
+$data_cell_ev=array();
+$cev=0;
+
+// Loop through our array, show HTML source as HTML source; and line numbers too.
+foreach ($lines as $line_num => $line) 
+{
+	$data_cell_ev=explode("\t",$line);
+	foreach ($data_cell_ev as $ld)
+	{
+  		$ldd=trim($ld);
+  		if($ldd !="")
+  		{
+        		$ev_arr[$cev]=$ldd;  
+                     $cev++;
+  			//echo "Line #<b>{$line_num}</b> : " . htmlspecialchars($ldd) . "<br />\n";
+  		}
+	}
+
+}
+
+$lf=$dir."$keyval"."vardata.txt";
+$linesd = file("$lf");
+
+$cevdata=0;
+// Loop through our array, show HTML source as HTML source; and line numbers too.
+foreach ($linesd as $line_num => $line) 
+{
+  
+	$data_cell_ev=explode("\t",$line);
+	foreach ($data_cell_ev as $ld)
+	{
+  		$ldd=trim($ld);
+  		if($ldd !="")
+  		{
+        		$evdata_arr[$cevdata]=$ldd;  
+                     $cevdata++;
+                     //echo "Line #<b>{$line_num}</b> : " . htmlspecialchars($ldd) . "<br />\n";
+
+  			
+  		}
+	}
+  
+}
+
+
+
+////////////////////////////////////Read data from net_figure file///////////////////////Graphp Display/////////////////////////////////////////////
+
+
+$matfile=$dir.$keyval."net_figure_new.txt";
+
+$data_val="";
+
+$matrix=file("$matfile");
+$matrix1=file_get_contents("$matfile");              //file("$matfile");
+
+
+$str_arrmat=array();
+$str_arrmat=explode("\n",$matrix1);
+
+$node=trim($str_arrmat[1]);
+
+if($str_arrmat[2]=="" || $matrix1=="")
+{
+?>
+<h1><font color=blue>Error: Unable to display your network structure.</font></h1>
+<?php
+exit;
+}
+/*
+if($node<=5)
+{
+  $width=200;
+  $hieght=150;
+  $font=11;
+}
+else if($node>5 && $node<=7)
+{
+  $width=150;
+  $hieght=120;
+  $font=10;
+
+}
+else if($node>7 && $node<=10)
+{
+  $width=110;
+  $hieght=85;
+  $font=8;
+}
+else 
+{
+  $width=80;
+  $hieght=60;
+  $font=7;
+}
+*/
+  $width=150;
+  $hieght=150;
+  $font=12;
+
+
+$datamat=array();
+$data_read=array();
+
+$r_index=$node+3;
+
+for($i=0;$i<$node;$i++)
+{
+  	$datamat=explode("\t",$str_arrmat[$r_index]);
+   	$data_read[$i][0]=trim($datamat[0]);  //name
+ 	$data_read[$i][1]=trim($datamat[1]);  //datatype
+       $nodetype=$data_read[$i][1];
+	$col_in=2;
+	$r_index+=4;
+	$evd=-9999;
+	$name=$data_read[$i][0];
+	for($ii=0;$ii<$cev;$ii++)
+	{
+     		if($ev_arr[$ii]==$name)
+     		{
+        		$evd=$evdata_arr[$ii]; 
+                     if($nodetype>1)
+                       $evd=levelmap($evd,$data_read[$i][0],$levelmap);
+ 
+        		break;
+     		}
+	}
+
+	if($evd!=-9999)//with evidence
+	{
+           $datamat=explode("\t",$str_arrmat[$r_index]);
+           $data_read[$i][$col_in]=trim($datamat[0]);  //x data
+           $col_in++;
+           $data_read[$i][$col_in]=trim($datamat[1]);  //y data
+           $col_in++;
+           $r_index++; // increment to point next data
+
+      	
+	}
+	else //without evidence
+	{
+		if($nodetype==1)  //type=coninuous
+		{
+         		for($j=1;$j<=101;$j++)
+         		{
+           			$datamat=explode("\t",$str_arrmat[$r_index]);
+           			$data_read[$i][$col_in]=trim($datamat[0]);  //x data
+			       $col_in++;
+           			$data_read[$i][$col_in]=trim($datamat[1]);  //y data
+           			$col_in++;
+           			$r_index++; // increment to point next data
+        
+        		 } 
+		}
+		if($nodetype>1)  //type=descrete
+		{
+         		$iter=$datamat[1];
+         		for($j=1;$j<=$iter;$j++)
+         		{
+           			$datamat=explode("\t",$str_arrmat[$r_index]);
+           			$data_read[$i][$col_in]=trim($datamat[0]);  //x data
+                     	$data_read[$i][$col_in]=levelmap($data_read[$i][$col_in],$data_read[$i][0],$levelmap);
+           			$col_in++;
+           			$data_read[$i][$col_in]=trim($datamat[1]);  //y data
+           			$col_in++;
+           			$r_index++; // increment to point next data
+           //echo "<br />"; 
+         		} 
+		}
+
+	}
+
+}
+
+
+$matfile_old=$dir.$keyval."net_figure.txt";
+
+$data_val="";
+
+$matrix_old=file("$matfile_old");
+$matrix1_old=file_get_contents("$matfile_old");              //file("$matfile");
+$str_arrmat_old=array();
+$str_arrmat_old=explode("\n",$matrix1_old);
+$datamat_old=array();
+$data_read_old=array();
+$node_old=trim($str_arrmat_old[0]);
+$r_index_old=$node_old+2;
+
+for($i=0;$i<$node_old;$i++)
+{
+	$datamat_old=explode("\t",$str_arrmat_old[$r_index_old]);
+	$data_read_old[$i][0]=trim($datamat_old[0]);  //name
+	$data_read_old[$i][1]=trim($datamat_old[1]);  //datatype
+	$col_in_old=2;
+	$r_index_old+=4;
+	if($datamat_old[1]==1)  //type=coninuous
+	{
+         for($j=1;$j<=101;$j++)
+         {
+           $datamat_old=explode("\t",$str_arrmat_old[$r_index_old]);
+           $data_read_old[$i][$col_in_old]=trim($datamat_old[0]);  //x data
+
+           $col_in_old++;
+           $data_read_old[$i][$col_in_old]=trim($datamat_old[1]);  //y data
+   
+           $col_in_old++;
+           $r_index_old++; // increment to point next data
+
+         } 
+	}
+	if($datamat_old[1]>1)  //type=descrete
+	{
+         $iter=$datamat_old[1];
+         for($j=1;$j<=$iter;$j++)
+         {
+           $datamat_old=explode("\t",$str_arrmat_old[$r_index_old]);
+           $data_read_old[$i][$col_in_old]=trim($datamat_old[0]);  //x data
+           //$data_read_old[$i][$col_in_old]='y';
+           $data_read_old[$i][$col_in_old]=levelmap($data_read_old[$i][$col_in_old],$data_read_old[$i][0],$levelmap);
+ 
+           $col_in_old++;
+           $data_read_old[$i][$col_in_old]=trim($datamat_old[1]);  //y data
+           $col_in_old++;
+           $r_index_old++; // increment to point next data
+
+         } 
+	}
+}
+
+
+////////////////////////////////////////////////Graphviz data read////////////////////////////////////////////////////////////////////////////////
+$grv=$dir.$keyval."graphviz.txt";
+$line=shell_exec('/usr/bin/dot -Tplain -y '.$grv);
+
+
+$grviz_name_list=array();
+$g_file_name="./data/".$keyval."grviz_name_file.txt";
+$grviz_name=file_get_contents("$g_file_name");
+$grviz_name_list=explode("\n",$grviz_name);
+
+
+
+//$grfilename=$keyval."graphviz.txt";
+//$cmd="/usr/bin/dot -Tplain -y  $grfilename";
+//$line=system($cmd);
+
+
+
+//shell_exec('/usr/bin/dot -Tpng -o /var/www/html/compbio/BNW/graphviz.png /var/www/html/compbio/BNW/graphviz.txt');
+$str_arrname=array();
+$str_arrname=explode("\n",$line);
+$data=array();
+$ID_data=array();
+$i=0;
+$ii=0;
+foreach($str_arrname as $row)
+{
+  $i++;
+  if($i>1)
+  {
+       
+  	$data=explode(" ",$row);
+       $j=0;
+       $k=0;
+       $flag=0;
+  	foreach($data as $cell)
+	{
+             
+             $j++;
+             
+             $cell=trim($cell);
+             //echo $cell;
+             //echo '&nbsp';
+             if($j==1 && $cell=="node")
+             {
+                $flag=1;
+             }  
+               
+             if($j>1 && $j<5 && $flag==1)
+             {
+    		  //echo $cell;
+   		  //echo '&nbsp';
+                if($j==2)
+                   $ID_data[$ii][$k]=$grviz_name_list[$cell];
+                else
+                   $ID_data[$ii][$k]=round($cell/10*900);
+               // echo $ID_data[$ii][$k];
+                //echo '&nbsp';
+
+                $k++; 
+             }
+       } 
+  
+       if($flag==1)
+       {
+          $ID_data[$ii][3]=$ID_data[$ii][1]+100;
+          $ID_data[$ii][4]=$ID_data[$ii][2]+150; 
+          $ID_data[$ii][5]=$ID_data[$ii][1]+100;
+          $ID_data[$ii][6]=$ID_data[$ii][2]; 
+          $ii++;
+          //echo "<br />"; 
+       } 
+     // echo "<br />"; 
+	
+  }
+}
+
+$nnode=$ii;
+$edge_data=array();
+
+$i=0;
+$ii=0;
+
+foreach($str_arrname as $row)
+{
+  $i++;
+  if($i>1)
+  {
+       
+  	$data=explode(" ",$row);
+       $j=0;
+       
+       $flag=0;
+       $number_of_point=0;
+       $index=0; 
+  	foreach($data as $cell)
+	{
+             $j++;
+             $cell=trim($cell);
+         
+             if($j==1 && $cell=="edge")
+             {
+                $flag=1;
+             }  
+               
+             if($j==2 && $flag==1)
+             {
+                
+                for($k=0;$k<$nnode;$k++)
+                {
+                      $cell=$grviz_name_list[$cell];
+                      if($cell==$ID_data[$k][0])
+                      {
+                          $edge_data[$ii][0]=$ID_data[$k][3];
+                          $edge_data[$ii][1]=$ID_data[$k][4];
+                      }                     
+
+                }
+               
+             }
+             else if($j==3 && $flag==1)
+             {
+               for($k=0;$k<$nnode;$k++)
+                {
+                      if($cell==$ID_data[$k][0])
+                      {
+                          $edge_data[$ii][2]=$ID_data[$k][5];
+                          $edge_data[$ii][3]=$ID_data[$k][6];
+                      }                     
+
+                }
+
+             }
+             else if($j==4 && $flag==1)
+             {
+                  $edge_data[$ii][4]=$cell;
+                  $number_of_point=$cell*2;
+                  $index=5;
+             }
+             else if($j>4 && $number_of_point>0 && $flag==1)
+             {
+                if(($j%2)!=0)
+                  $edge_data[$ii][$index]=round($cell/10*900)+60;//+30+30;
+                else
+                  $edge_data[$ii][$index]=round($cell/10*900)+48;//+18+30;
+
+                $number_of_point--;
+                $index++;
+             }
+
+
+             
+       } 
+       if($flag==1)
+       {
+          $ii++;
+          //echo "<br />"; 
+       } 
+ 	
+  }
+}
+
+
+$nedges=$ii;
+//echo $nedges;
+
+?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
+<script type="text/javascript" src="http://www.google.com/jsapi"></script>
+ <script type="text/javascript">
+  google.load('visualization', '1', {packages: ['corechart']});
+ </script>
+ 
+
+<?php 
+$data_val="";
+
+for($i=0;$i<$nnode;$i++)
+ {
+////////////////////////////select node //////////////////////////////////////
+ $name=$ID_data[$i][0];
+ $fname="draw_".$name."()";
+ $data_val.=$name;
+ $flag=0; //evidence flag
+ for($j=0;$j<$node;$j++)
+ {
+    if($data_read[$j][0]==$name)
+    {
+       $s_i=$j;
+       break;
+    } 
+ }
+ for($j=0;$j<$node_old;$j++)
+ {
+    if($data_read_old[$j][0]==$name)
+    {
+       $s_i_old=$j;
+       break;
+    } 
+ }
+ 
+
+/////////////////////////////////Display nodes//////////////////////////////////////////////////////////
+?>    
+<script type="text/javascript">
+<?php
+  $node_type=$data_read[$s_i][1];
+  if($node_type>1) //discrete node
+  { 
+?>
+  function <?php print($fname);?> {
+  // Create and populate the data table.
+  <?php
+ $evd=-9999;
+  for($ii=0;$ii<$cev;$ii++)
+  {
+     if($ev_arr[$ii]==$name)
+     {
+        $evd=$evdata_arr[$ii]; 
+        $evd=levelmap($evd,$name,$levelmap); 
+        $flag=1;
+        break;
+     }
+  }
+if($evd==-9999)
+{
+?>
+  var data = google.visualization.arrayToDataTable([
+   ['<?php print($name);?>', 'Old', 'New'],
+<?php
+  $c_i=2; 
+  $c_i_old=2;
+  for($j=0;$j<$node_type-1;$j++) 
+  {     
+       $val1=trim($data_read[$s_i][$c_i]);
+      // $val1=map($name,$val1);
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;
+       $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;        
+  ?>
+   ['<?php print($val1);?>', <?php print($val2_old);?>, <?php print($val2);?>],
+  <?php
+  }
+  if($j==$node_type-1)
+  {
+       $val1=trim($data_read[$s_i][$c_i]);
+       // $val1=map($name,$val1);
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;
+       $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;        
+  ?>
+   ['<?php print($val1);?>', <?php print($val2_old);?>, <?php print($val2);?>]
+<?php
+  }
+}
+else
+{
+  
+?>
+  var data = google.visualization.arrayToDataTable([
+    ['<?php print($name);?>', 'Old', 'New'],
+
+<?php
+ 
+  $c_i_old=2;
+  for($j=0;$j<$node_type-1;$j++) 
+  {     
+       $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++; 
+       if($val1_old==$evd)       
+       {
+  ?>
+         ['<?php print($val1_old);?>', <?php print($val2_old);?>, 1],
+
+  <?php
+       }
+       else{
+       ?>
+         ['<?php print($val1_old);?>', <?php print($val2_old);?>, 0],
+
+<?php
+         }   
+  }
+  if($j==$node_type-1)
+  {
+       $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;
+      if($val1_old==$evd)       
+       {
+      
+  ?>
+        ['<?php print($val1_old);?>', <?php print($val2_old);?>, 1]
+      <?php
+       } 
+       else{
+       ?>
+        ['<?php print($val1_old);?>', <?php print($val2_old);?>, 0] 
+<?php
+         }  
+  }
+}
+?>
+ ]);
+ 
+      
+        // Create and draw the visualization.
+      
+      var cnode="<?php print($name); ?>";
+      var keyv="<?php print($keyval);?>";
+     <?php if($evd!=-9999)
+             {
+                $named=$name.":".$evd;
+                $bcolor="red";
+                $font=10;
+             }
+             else
+             {
+                $named=$name;
+                $bcolor="black";
+                $font=12;
+             }
+         ?>  
+
+        var chart = new google.visualization.BarChart(document.getElementById('<?php print($name);?>'));
+        function selectHandler() {
+          var selectedItem = chart.getSelection()[0];
+          if (selectedItem) {
+            var topping = data.getValue(selectedItem.row, 0);
+            
+            var s = window.prompt('Selected evidence ' + topping + ' for ' + cnode + '. Enter new evidence ', topping );
+            
+            window.location.href = "add_evd.php?name=" + cnode + "&evidence=" + s + "&My_key=" + keyv;
+           
+
+  
+              //alert('The user selected ' + topping + topname);
+          }
+        } 
+         chart.draw(data,
+                 {title:"<?php print($named);?>", titleTextStyle: {fontSize: <?php print($font);?>},
+                  width:<?php print($width);?>, height:<?php print($hieght);?>,
+                  vAxis: {title: "State", textStyle: {fontSize:<?php print($font);?>}},
+		    hAxis: {title: "Fraction", minValue: 0, maxValue: 1, gridlines: {count: 3}}, legend: {position: 'none'},
+                  backgroundColor: {stroke: '<?php print($bcolor);?>', strokeWidth: 5}}
+            );
+        google.visualization.events.addListener(chart, 'select', selectHandler);  
+
+  }
+<?php
+ }
+ else //continuous node
+ {
+?>
+  function <?php print($fname);?> {
+  // Create and populate the data table.
+  <?php
+ $evd=-9999;
+  for($ii=0;$ii<$cev;$ii++)
+  {
+     if($ev_arr[$ii]==$name)
+     {
+        $evd=$evdata_arr[$ii]; 
+        break;
+     }
+  }
+if($evd==-9999)
+{
+?>
+  var data = google.visualization.arrayToDataTable([
+   ['<?php print($name);?>', 'Old', 'New'],
+<?php
+  $c_i=2;
+  $c_i_old=2;
+  for($j=0;$j<100;$j++) 
+  {
+       $val1=trim($data_read[$s_i][$c_i]);
+       $val1=map($name,$val1,$keyval);
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;         
+
+       $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++; 
+  ?>
+   ['<?php print($val1);?>', <?php print($val2_old);?>, <?php print($val2);?>],
+
+  <?php
+  }
+  if($j==100)
+  {
+        $val1=trim($data_read[$s_i][$c_i]);
+       $val1=map($name,$val1,$keyval);
+
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;
+
+       $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;   
+  ?>
+   ['<?php print($val1);?>', <?php print($val2_old);?>, <?php print($val2);?>]
+<?php
+  }
+}
+else
+{
+    $evd=map($name,$evd,$keyval);
+    $evduse=$evd;
+?>
+  var data = google.visualization.arrayToDataTable([
+    ['<?php print($name);?>', 'Old', 'New'],
+
+<?php
+ 
+  $c_i_old=2;
+  for($j=0;$j<100;$j++) 
+  {     
+       $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $val1_old=map($name,$val1_old,$keyval);
+
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++; 
+       if($val1_old<$evduse)  
+       {
+       ?>
+         ['<?php print($val1_old);?>', <?php print($val2_old);?>, 0],
+<?php
+       }
+       else if($val1_old>=$evduse) 
+       {
+        $evduse=99999;
+       ?>
+       ['<?php print($val1_old);?>', <?php print($val2_old);?>, 1],
+     
+       <?php
+       } 
+ }
+  if($j==100)
+  {
+       $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $val1_old=map($name,$val1_old,$keyval);
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;
+      
+  ?>
+        ['<?php print($val1_old);?>', <?php print($val2_old);?>, 0]
+ 
+<?php
+  }
+}
+?>
+ ]);
+
+      
+        // Create and draw the visualization.
+      var cnode="<?php print($name); ?>";
+      var keyv="<?php print($keyval);?>";
+
+       <?php if($evd!=-9999)
+             {
+                $named=$name.":".$evd;
+                $bcolor="red";
+                $font=10;
+             }
+             else
+             {
+                $named=$name;
+                $bcolor="black";
+                $font=12;
+             }
+         ?>  
+        var chart = new google.visualization.LineChart(document.getElementById('<?php print($name);?>'));
+
+        function selectHandler() {
+          var selectedItem = chart.getSelection()[0];
+          if (selectedItem) {
+           
+            var topping = data.getValue(selectedItem.row, 0);
+            var s = window.prompt('Selected evidence ' + topping + ' for ' + cnode + '. Enter new evidence ', topping );
+            window.location.href = "add_evd.php?name=" + cnode + "&evidence=" + s + "&My_key=" + keyv;  
+
+          }
+        }
+            chart.draw(data, {curveType: "function",
+                  title:"<?php print($named);?>", titleTextStyle: {fontSize: <?php print($font);?>},
+			legend: {position: 'none'},
+                  width:<?php print($width);?>, height:<?php print($hieght);?>,
+                  hAxis: {maxValue: 1, minValue: 0},
+			vAxis: {maxValue: 1, minValue: 0},
+                  backgroundColor: {stroke: '<?php print($bcolor);?>', strokeWidth: 5}}
+            );
+           google.visualization.events.addListener(chart, 'select', selectHandler); 
+       }
+
+<?php
+ }
+?>
+</script>
+<?php
+///////////////////////////end of display nodes////////////////////////////////////////////////
+}
+
+
+///////////////////////////////////write data to file///////////////////////////////////////////////////////////
+?>
+
+
+
+<script type="text/javascript">
+function canvas_arrow(context, fromx, fromy, tox, toy){
+    var headlen = 15;
+    var dx = tox-fromx;
+    var dy = toy-fromy;
+    var angle = Math.atan2(dy,dx);
+    context.moveTo(fromx,fromy);
+    context.lineTo(tox,toy);
+    context.lineTo(tox-headlen*Math.cos(angle-Math.PI/6),toy-headlen*Math.sin(angle-Math.PI/6));
+    context.moveTo(tox,toy);
+    context.lineTo(tox-headlen*Math.cos(angle+Math.PI/6),toy-headlen*Math.sin(angle+Math.PI/6));
+}
+</script>
+
+<script type="text/javascript">
+function canvas_arrow_head(context, fromx, fromy, tox, toy){
+    var headlen = 15;
+    var dx = tox-fromx;
+    var dy = toy-fromy;
+    var angle = Math.atan2(dy,dx);
+    context.moveTo(tox,toy);
+    context.lineTo(tox-headlen*Math.cos(angle-Math.PI/6),toy-headlen*Math.sin(angle-Math.PI/6));
+    context.moveTo(tox,toy);
+    context.lineTo(tox-headlen*Math.cos(angle+Math.PI/6),toy-headlen*Math.sin(angle+Math.PI/6));
+}
+</script>
+
+
+</head>
+
+<body>
+<canvas id="test" width="3000" height="3000" style="position:absolute">
+<script>
+function canvas_arrow_draw(n, polypts,context){
+
+//Create jsGraphics object
+var headlen = 10;
+/*
+var hexno=new String;
+arr=new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f");
+var n1=Math.round(Math.random()*15);
+var n2=Math.round(Math.random()*15);
+var n3=Math.round(Math.random()*15);
+var n4=Math.round(Math.random()*15);
+var n5=Math.round(Math.random()*15);
+var n6=Math.round(Math.random()*15);
+hexno="#"+arr[n1]+""+arr[n2]+""+arr[n3]+""+arr[n4]+""+arr[n5]+""+arr[n6];
+*/
+hexno="black";
+var polypoints = new Array();
+var n2=n*2;
+
+
+var sx=polypts[0];
+var sy=polypts[1];
+ 
+var sx1=polypts[n2-4];
+var sy1=polypts[n2-3];
+var ex1=polypts[n2-2];
+var ey1=polypts[n2-1];
+
+context.beginPath();
+canvas_arrow_head(context,sx1,sy1,ex1,ey1);
+
+context.moveTo(polypts[0],polypts[1]);
+nm=n%3;
+ni=(n-nm)/3;
+
+for(i=0;i<ni;i++)
+{
+  i11=i*6+2;
+  i12=i*6+3;
+  i21=i*6+4;
+  i22=i*6+5;
+  i31=i*6+6;
+  i32=i*6+7;
+
+  context.bezierCurveTo(polypts[i11],polypts[i12],polypts[i21],polypts[i22],polypts[i31],polypts[i32]);
+  context.moveTo(polypts[i31],polypts[i32]);
+
+ // polypoints[i] = new jxPoint(polypts[i1], polypts[i2]);
+}
+
+
+if(nm==2)
+{
+  context.moveTo(polypts[i21],polypts[i22]);
+  context.bezierCurveTo(polypts[i31],polypts[i32],sx1,sy1,ex1,ey1);
+  context.moveTo(ex1,ey1);
+
+}
+
+ context.strokeStyle = hexno;
+ context.stroke();
+
+}
+
+
+var canvas=document.getElementById("test");
+var context = canvas.getContext("2d");
+context.lineWidth = 3;
+
+<?php
+for($i=0;$i<$nedges;$i++)
+{
+
+   $n=$edge_data[$i][4]; 
+   $n2=$n*2;
+   
+?>
+var polypoints = new Array();
+var j=0;
+var n="<?php print($n);?>";
+<?php
+for($j=0;$j<$n2;$j++)
+{
+$inx=$j+5;
+$data=$edge_data[$i][$inx];
+
+?>
+	polypoints[j] = "<?php print($data);?>";
+
+       j++;
+<?php
+}
+?>
+canvas_arrow_draw(n,polypoints,context);
+<?php
+}
+?>
+
+
+
+</script>
+</canvas>
+
+
+<?php 
+for($i=0;$i<$nnode;$i++)
+{
+  $x=$ID_data[$i][1]-8; $y=$ID_data[$i][2]-20; 
+  $name=$ID_data[$i][0];
+?>
+
+<script type="text/javascript">
+   google.setOnLoadCallback(draw_<?php print($name)?>);
+</script>
+<div id="<?php print($name)?>" style="left: <?php print($x)?>px; top: <?php print($y)?>px; width:<?php print($width);?>; height:<?php print($hieght);?>; position: absolute"></div>
+
+<?php 
+}
+?>
+
+
+</body>
+
+
+
+</html>
+
diff --git a/sourcecodes/network_layout_evd_2_example.php b/sourcecodes/network_layout_evd_2_example.php
new file mode 100644
index 00000000..055216e3
--- /dev/null
+++ b/sourcecodes/network_layout_evd_2_example.php
@@ -0,0 +1,953 @@
+<?php 
+include("structuremap.php");
+
+
+function levelmap($inx,$name,$mapdata)
+{
+
+$leve_l=array();
+$leve_l=explode("\n",$mapdata);
+$leve_d=array();
+
+foreach($leve_l as $l)
+{ 
+  $l=trim($l);
+  $leve_d=explode("\t",$l);
+  $inxname=trim($leve_d[0]);
+  $name=trim($name);
+  if($inxname==$name)
+    return $leve_d[$inx];
+}
+           
+}
+
+
+
+$keyval=trim($_GET["My_key"]);
+//////////////////////////Entered evidences//////////////////////////////////////////
+$dir="./data/";
+
+$lfile=$dir.$keyval."nlevels.txt";
+$levelmap=file_get_contents($lfile);   
+
+
+
+$lf=$dir."$keyval"."varname.txt";
+
+$lines = file("$lf");
+
+$ev_arr=array();
+$evdata_arr=array();
+
+$data_cell_ev=array();
+$cev=0;
+
+// Loop through our array, show HTML source as HTML source; and line numbers too.
+foreach ($lines as $line_num => $line) 
+{
+	$data_cell_ev=explode("\t",$line);
+	foreach ($data_cell_ev as $ld)
+	{
+  		$ldd=trim($ld);
+  		if($ldd !="")
+  		{
+        		$ev_arr[$cev]=$ldd;  
+                     $cev++;
+  			//echo "Line #<b>{$line_num}</b> : " . htmlspecialchars($ldd) . "<br />\n";
+  		}
+	}
+
+}
+
+$lf=$dir."$keyval"."vardata.txt";
+$linesd = file("$lf");
+
+$cevdata=0;
+// Loop through our array, show HTML source as HTML source; and line numbers too.
+foreach ($linesd as $line_num => $line) 
+{
+  
+	$data_cell_ev=explode("\t",$line);
+	foreach ($data_cell_ev as $ld)
+	{
+  		$ldd=trim($ld);
+  		if($ldd !="")
+  		{
+        		$evdata_arr[$cevdata]=$ldd;  
+                     $cevdata++;
+                     //echo "Line #<b>{$line_num}</b> : " . htmlspecialchars($ldd) . "<br />\n";
+
+  			
+  		}
+	}
+  
+}
+
+
+
+////////////////////////////////////Read data from net_figure file///////////////////////Graphp Display/////////////////////////////////////////////
+
+
+$matfile=$dir.$keyval."net_figure_new.txt";
+
+$data_val="";
+
+$matrix=file("$matfile");
+$matrix1=file_get_contents("$matfile");              //file("$matfile");
+
+
+$str_arrmat=array();
+$str_arrmat=explode("\n",$matrix1);
+
+$node=trim($str_arrmat[1]);
+
+if($str_arrmat[2]=="" || $matrix1=="")
+{
+?>
+<h1><font color=blue>Error: Unable to display your network structure.</font></h1>
+<?php
+exit;
+}
+/*
+if($node<=5)
+{
+  $width=200;
+  $hieght=150;
+  $font=11;
+}
+else if($node>5 && $node<=7)
+{
+  $width=150;
+  $hieght=120;
+  $font=10;
+
+}
+else if($node>7 && $node<=10)
+{
+  $width=110;
+  $hieght=85;
+  $font=8;
+}
+else 
+{
+  $width=80;
+  $hieght=60;
+  $font=7;
+}
+*/
+  $width=150;
+  $hieght=150;
+  $font=12;
+
+
+$datamat=array();
+$data_read=array();
+
+$r_index=$node+3;
+
+for($i=0;$i<$node;$i++)
+{
+  	$datamat=explode("\t",$str_arrmat[$r_index]);
+   	$data_read[$i][0]=trim($datamat[0]);  //name
+ 	$data_read[$i][1]=trim($datamat[1]);  //datatype
+       $nodetype=$data_read[$i][1];
+	$col_in=2;
+	$r_index+=4;
+	$evd=-9999;
+	$name=$data_read[$i][0];
+	for($ii=0;$ii<$cev;$ii++)
+	{
+     		if($ev_arr[$ii]==$name)
+     		{
+        		$evd=$evdata_arr[$ii]; 
+                     if($nodetype>1)
+                       $evd=levelmap($evd,$data_read[$i][0],$levelmap);
+ 
+        		break;
+     		}
+	}
+
+	if($evd!=-9999)//with evidence
+	{
+           $datamat=explode("\t",$str_arrmat[$r_index]);
+           $data_read[$i][$col_in]=trim($datamat[0]);  //x data
+           $col_in++;
+           $data_read[$i][$col_in]=trim($datamat[1]);  //y data
+           $col_in++;
+           $r_index++; // increment to point next data
+
+      	
+	}
+	else //without evidence
+	{
+		if($nodetype==1)  //type=coninuous
+		{
+         		for($j=1;$j<=101;$j++)
+         		{
+           			$datamat=explode("\t",$str_arrmat[$r_index]);
+           			$data_read[$i][$col_in]=trim($datamat[0]);  //x data
+			       $col_in++;
+           			$data_read[$i][$col_in]=trim($datamat[1]);  //y data
+           			$col_in++;
+           			$r_index++; // increment to point next data
+        
+        		 } 
+		}
+		if($nodetype>1)  //type=descrete
+		{
+         		$iter=$datamat[1];
+         		for($j=1;$j<=$iter;$j++)
+         		{
+           			$datamat=explode("\t",$str_arrmat[$r_index]);
+           			$data_read[$i][$col_in]=trim($datamat[0]);  //x data
+                     	$data_read[$i][$col_in]=levelmap($data_read[$i][$col_in],$data_read[$i][0],$levelmap);
+           			$col_in++;
+           			$data_read[$i][$col_in]=trim($datamat[1]);  //y data
+           			$col_in++;
+           			$r_index++; // increment to point next data
+           //echo "<br />"; 
+         		} 
+		}
+
+	}
+
+}
+
+
+$matfile_old=$dir.$keyval."net_figure.txt";
+
+$data_val="";
+
+$matrix_old=file("$matfile_old");
+$matrix1_old=file_get_contents("$matfile_old");              //file("$matfile");
+$str_arrmat_old=array();
+$str_arrmat_old=explode("\n",$matrix1_old);
+$datamat_old=array();
+$data_read_old=array();
+$node_old=trim($str_arrmat_old[0]);
+$r_index_old=$node_old+2;
+
+for($i=0;$i<$node_old;$i++)
+{
+	$datamat_old=explode("\t",$str_arrmat_old[$r_index_old]);
+	$data_read_old[$i][0]=trim($datamat_old[0]);  //name
+	$data_read_old[$i][1]=trim($datamat_old[1]);  //datatype
+	$col_in_old=2;
+	$r_index_old+=4;
+	if($datamat_old[1]==1)  //type=coninuous
+	{
+         for($j=1;$j<=101;$j++)
+         {
+           $datamat_old=explode("\t",$str_arrmat_old[$r_index_old]);
+           $data_read_old[$i][$col_in_old]=trim($datamat_old[0]);  //x data
+
+           $col_in_old++;
+           $data_read_old[$i][$col_in_old]=trim($datamat_old[1]);  //y data
+   
+           $col_in_old++;
+           $r_index_old++; // increment to point next data
+
+         } 
+	}
+	if($datamat_old[1]>1)  //type=descrete
+	{
+         $iter=$datamat_old[1];
+         for($j=1;$j<=$iter;$j++)
+         {
+           $datamat_old=explode("\t",$str_arrmat_old[$r_index_old]);
+           $data_read_old[$i][$col_in_old]=trim($datamat_old[0]);  //x data
+           //$data_read_old[$i][$col_in_old]='y';
+           $data_read_old[$i][$col_in_old]=levelmap($data_read_old[$i][$col_in_old],$data_read_old[$i][0],$levelmap);
+ 
+           $col_in_old++;
+           $data_read_old[$i][$col_in_old]=trim($datamat_old[1]);  //y data
+           $col_in_old++;
+           $r_index_old++; // increment to point next data
+
+         } 
+	}
+}
+
+
+////////////////////////////////////////////////Graphviz data read////////////////////////////////////////////////////////////////////////////////
+$grv=$dir.$keyval."graphviz.txt";
+$line=shell_exec('/usr/bin/dot -Tplain -y '.$grv);
+
+
+//$grfilename=$keyval."graphviz.txt";
+//$cmd="/usr/bin/dot -Tplain -y  $grfilename";
+//$line=system($cmd);
+
+
+
+//shell_exec('/usr/bin/dot -Tpng -o /var/www/html/compbio/BNW/graphviz.png /var/www/html/compbio/BNW/graphviz.txt');
+$str_arrname=array();
+$str_arrname=explode("\n",$line);
+$data=array();
+$ID_data=array();
+$i=0;
+$ii=0;
+foreach($str_arrname as $row)
+{
+  $i++;
+  if($i>1)
+  {
+       
+  	$data=explode(" ",$row);
+       $j=0;
+       $k=0;
+       $flag=0;
+  	foreach($data as $cell)
+	{
+             
+             $j++;
+             
+             $cell=trim($cell);
+             //echo $cell;
+             //echo '&nbsp';
+             if($j==1 && $cell=="node")
+             {
+                $flag=1;
+             }  
+               
+             if($j>1 && $j<5 && $flag==1)
+             {
+    		  //echo $cell;
+   		  //echo '&nbsp';
+                if($j==2)
+                   $ID_data[$ii][$k]=$cell;
+                else
+                   $ID_data[$ii][$k]=round($cell/10*900);
+               // echo $ID_data[$ii][$k];
+                //echo '&nbsp';
+
+                $k++; 
+             }
+       } 
+  
+       if($flag==1)
+       {
+          $ID_data[$ii][3]=$ID_data[$ii][1]+100;
+          $ID_data[$ii][4]=$ID_data[$ii][2]+150; 
+          $ID_data[$ii][5]=$ID_data[$ii][1]+100;
+          $ID_data[$ii][6]=$ID_data[$ii][2]; 
+          $ii++;
+          //echo "<br />"; 
+       } 
+     // echo "<br />"; 
+	
+  }
+}
+
+$nnode=$ii;
+$edge_data=array();
+
+$i=0;
+$ii=0;
+
+foreach($str_arrname as $row)
+{
+  $i++;
+  if($i>1)
+  {
+       
+  	$data=explode(" ",$row);
+       $j=0;
+       
+       $flag=0;
+       $number_of_point=0;
+       $index=0; 
+  	foreach($data as $cell)
+	{
+             $j++;
+             $cell=trim($cell);
+         
+             if($j==1 && $cell=="edge")
+             {
+                $flag=1;
+             }  
+               
+             if($j==2 && $flag==1)
+             {
+                
+                for($k=0;$k<$nnode;$k++)
+                {
+                      if($cell==$ID_data[$k][0])
+                      {
+                          $edge_data[$ii][0]=$ID_data[$k][3];
+                          $edge_data[$ii][1]=$ID_data[$k][4];
+                      }                     
+
+                }
+               
+             }
+             else if($j==3 && $flag==1)
+             {
+               for($k=0;$k<$nnode;$k++)
+                {
+                      if($cell==$ID_data[$k][0])
+                      {
+                          $edge_data[$ii][2]=$ID_data[$k][5];
+                          $edge_data[$ii][3]=$ID_data[$k][6];
+                      }                     
+
+                }
+
+             }
+             else if($j==4 && $flag==1)
+             {
+                  $edge_data[$ii][4]=$cell;
+                  $number_of_point=$cell*2;
+                  $index=5;
+             }
+             else if($j>4 && $number_of_point>0 && $flag==1)
+             {
+                if(($j%2)!=0)
+                  $edge_data[$ii][$index]=round($cell/10*900)+60;//+30+30;
+                else
+                  $edge_data[$ii][$index]=round($cell/10*900)+48;//+18+30;
+
+                $number_of_point--;
+                $index++;
+             }
+
+
+             
+       } 
+       if($flag==1)
+       {
+          $ii++;
+          //echo "<br />"; 
+       } 
+ 	
+  }
+}
+
+
+$nedges=$ii;
+//echo $nedges;
+
+?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
+<script type="text/javascript" src="http://www.google.com/jsapi"></script>
+ <script type="text/javascript">
+  google.load('visualization', '1', {packages: ['corechart']});
+ </script>
+ 
+
+<?php 
+$data_val="";
+
+for($i=0;$i<$nnode;$i++)
+ {
+////////////////////////////select node //////////////////////////////////////
+ $name=$ID_data[$i][0];
+ $fname="draw_".$name."()";
+ $data_val.=$name;
+ $flag=0; //evidence flag
+ for($j=0;$j<$node;$j++)
+ {
+    if($data_read[$j][0]==$name)
+    {
+       $s_i=$j;
+       break;
+    } 
+ }
+ for($j=0;$j<$node_old;$j++)
+ {
+    if($data_read_old[$j][0]==$name)
+    {
+       $s_i_old=$j;
+       break;
+    } 
+ }
+ 
+
+/////////////////////////////////Display nodes//////////////////////////////////////////////////////////
+?>    
+<script type="text/javascript">
+<?php
+  $node_type=$data_read[$s_i][1];
+  if($node_type>1) //discrete node
+  { 
+?>
+  function <?php print($fname);?> {
+  // Create and populate the data table.
+  <?php
+ $evd=-9999;
+  for($ii=0;$ii<$cev;$ii++)
+  {
+     if($ev_arr[$ii]==$name)
+     {
+        $evd=$evdata_arr[$ii]; 
+        $evd=levelmap($evd,$name,$levelmap); 
+        $flag=1;
+        break;
+     }
+  }
+if($evd==-9999)
+{
+?>
+  var data = google.visualization.arrayToDataTable([
+   ['<?php print($name);?>', 'Old', 'New'],
+<?php
+  $c_i=2; 
+  $c_i_old=2;
+  for($j=0;$j<$node_type-1;$j++) 
+  {     
+       $val1=trim($data_read[$s_i][$c_i]);
+      // $val1=map($name,$val1);
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;
+       $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;        
+  ?>
+   ['<?php print($val1);?>', <?php print($val2_old);?>, <?php print($val2);?>],
+  <?php
+  }
+  if($j==$node_type-1)
+  {
+       $val1=trim($data_read[$s_i][$c_i]);
+       // $val1=map($name,$val1);
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;
+       $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;        
+  ?>
+   ['<?php print($val1);?>', <?php print($val2_old);?>, <?php print($val2);?>]
+<?php
+  }
+}
+else
+{
+  
+?>
+  var data = google.visualization.arrayToDataTable([
+    ['<?php print($name);?>', 'Old', 'New'],
+
+<?php
+ 
+  $c_i_old=2;
+  for($j=0;$j<$node_type-1;$j++) 
+  {     
+       $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++; 
+       if($val1_old==$evd)       
+       {
+  ?>
+         ['<?php print($val1_old);?>', <?php print($val2_old);?>, 1],
+
+  <?php
+       }
+       else{
+       ?>
+         ['<?php print($val1_old);?>', <?php print($val2_old);?>, 0],
+
+<?php
+         }   
+  }
+  if($j==$node_type-1)
+  {
+       $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;
+      if($val1_old==$evd)       
+       {
+      
+  ?>
+        ['<?php print($val1_old);?>', <?php print($val2_old);?>, 1]
+      <?php
+       } 
+       else{
+       ?>
+        ['<?php print($val1_old);?>', <?php print($val2_old);?>, 0] 
+<?php
+         }  
+  }
+}
+?>
+ ]);
+ 
+      
+        // Create and draw the visualization.
+      
+      var cnode="<?php print($name); ?>";
+      var keyv="<?php print($keyval);?>";
+     <?php if($evd!=-9999)
+             {
+                $named=$name.":".$evd;
+                $bcolor="red";
+                $font=10;
+             }
+             else
+             {
+                $named=$name;
+                $bcolor="black";
+                $font=12;
+             }
+         ?>  
+
+        var chart = new google.visualization.BarChart(document.getElementById('<?php print($name);?>'));
+        function selectHandler() {
+          var selectedItem = chart.getSelection()[0];
+          if (selectedItem) {
+            var topping = data.getValue(selectedItem.row, 0);
+            
+            var s = window.prompt('Selected evidence ' + topping + ' for ' + cnode + '. Enter new evidence ', topping );
+            
+            window.location.href = "add_evd_example.php?name=" + cnode + "&evidence=" + s + "&My_key=" + keyv;
+           
+
+  
+              //alert('The user selected ' + topping + topname);
+          }
+        } 
+         chart.draw(data,
+                 {title:"<?php print($named);?>", titleTextStyle: {fontSize: <?php print($font);?>},
+                  width:<?php print($width);?>, height:<?php print($hieght);?>,
+                  vAxis: {title: "State", textStyle: {fontSize:<?php print($font);?>}},
+		    hAxis: {title: "Fraction", minValue: 0, maxValue: 1, gridlines: {count: 3}}, legend: {position: 'none'},
+                  backgroundColor: {stroke: '<?php print($bcolor);?>', strokeWidth: 5}}
+            );
+        google.visualization.events.addListener(chart, 'select', selectHandler);  
+
+  }
+<?php
+ }
+ else //continuous node
+ {
+?>
+  function <?php print($fname);?> {
+  // Create and populate the data table.
+  <?php
+ $evd=-9999;
+  for($ii=0;$ii<$cev;$ii++)
+  {
+     if($ev_arr[$ii]==$name)
+     {
+        $evd=$evdata_arr[$ii]; 
+        break;
+     }
+  }
+if($evd==-9999)
+{
+?>
+  var data = google.visualization.arrayToDataTable([
+   ['<?php print($name);?>', 'Old', 'New'],
+<?php
+  $c_i=2;
+  $c_i_old=2;
+  for($j=0;$j<100;$j++) 
+  {
+       $val1=trim($data_read[$s_i][$c_i]);
+       $val1=map($name,$val1,$keyval);
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;         
+
+       $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++; 
+  ?>
+   ['<?php print($val1);?>', <?php print($val2_old);?>, <?php print($val2);?>],
+
+  <?php
+  }
+  if($j==100)
+  {
+        $val1=trim($data_read[$s_i][$c_i]);
+       $val1=map($name,$val1,$keyval);
+
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;
+
+       $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;   
+  ?>
+   ['<?php print($val1);?>', <?php print($val2_old);?>, <?php print($val2);?>]
+<?php
+  }
+}
+else
+{
+    $evd=map($name,$evd,$keyval);
+    $evduse=$evd;
+?>
+  var data = google.visualization.arrayToDataTable([
+    ['<?php print($name);?>', 'Old', 'New'],
+
+<?php
+ 
+  $c_i_old=2;
+  for($j=0;$j<100;$j++) 
+  {     
+       $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $val1_old=map($name,$val1_old,$keyval);
+
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++; 
+       if($val1_old<$evduse)  
+       {
+       ?>
+         ['<?php print($val1_old);?>', <?php print($val2_old);?>, 0],
+<?php
+       }
+       else if($val1_old>=$evduse) 
+       {
+        $evduse=99999;
+       ?>
+       ['<?php print($val1_old);?>', <?php print($val2_old);?>, 1],
+     
+       <?php
+       } 
+ }
+  if($j==100)
+  {
+       $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $val1_old=map($name,$val1_old,$keyval);
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;
+      
+  ?>
+        ['<?php print($val1_old);?>', <?php print($val2_old);?>, 0]
+ 
+<?php
+  }
+}
+?>
+ ]);
+
+      
+        // Create and draw the visualization.
+      var cnode="<?php print($name); ?>";
+      var keyv="<?php print($keyval);?>";
+
+       <?php if($evd!=-9999)
+             {
+                $named=$name.":".$evd;
+                $bcolor="red";
+                $font=10;
+             }
+             else
+             {
+                $named=$name;
+                $bcolor="black";
+                $font=12;
+             }
+         ?>  
+        var chart = new google.visualization.LineChart(document.getElementById('<?php print($name);?>'));
+
+        function selectHandler() {
+          var selectedItem = chart.getSelection()[0];
+          if (selectedItem) {
+           
+            var topping = data.getValue(selectedItem.row, 0);
+            var s = window.prompt('Selected evidence ' + topping + ' for ' + cnode + '. Enter new evidence ', topping );
+            window.location.href = "add_evd_example.php?name=" + cnode + "&evidence=" + s + "&My_key=" + keyv;  
+
+          }
+        }
+            chart.draw(data, {curveType: "function",
+                  title:"<?php print($named);?>", titleTextStyle: {fontSize: <?php print($font);?>},
+			legend: {position: 'none'},
+                  width:<?php print($width);?>, height:<?php print($hieght);?>,
+                  hAxis: {maxValue: 1, minValue: 0},
+			vAxis: {maxValue: 1, minValue: 0},
+                  backgroundColor: {stroke: '<?php print($bcolor);?>', strokeWidth: 5}}
+            );
+           google.visualization.events.addListener(chart, 'select', selectHandler); 
+       }
+
+<?php
+ }
+?>
+</script>
+<?php
+///////////////////////////end of display nodes////////////////////////////////////////////////
+}
+
+
+///////////////////////////////////write data to file///////////////////////////////////////////////////////////
+?>
+
+
+
+<script type="text/javascript">
+function canvas_arrow(context, fromx, fromy, tox, toy){
+    var headlen = 15;
+    var dx = tox-fromx;
+    var dy = toy-fromy;
+    var angle = Math.atan2(dy,dx);
+    context.moveTo(fromx,fromy);
+    context.lineTo(tox,toy);
+    context.lineTo(tox-headlen*Math.cos(angle-Math.PI/6),toy-headlen*Math.sin(angle-Math.PI/6));
+    context.moveTo(tox,toy);
+    context.lineTo(tox-headlen*Math.cos(angle+Math.PI/6),toy-headlen*Math.sin(angle+Math.PI/6));
+}
+</script>
+
+<script type="text/javascript">
+function canvas_arrow_head(context, fromx, fromy, tox, toy){
+    var headlen = 15;
+    var dx = tox-fromx;
+    var dy = toy-fromy;
+    var angle = Math.atan2(dy,dx);
+    context.moveTo(tox,toy);
+    context.lineTo(tox-headlen*Math.cos(angle-Math.PI/6),toy-headlen*Math.sin(angle-Math.PI/6));
+    context.moveTo(tox,toy);
+    context.lineTo(tox-headlen*Math.cos(angle+Math.PI/6),toy-headlen*Math.sin(angle+Math.PI/6));
+}
+</script>
+
+
+</head>
+
+<body>
+<canvas id="test" width="3000" height="3000" style="position:absolute">
+<script>
+function canvas_arrow_draw(n, polypts,context){
+
+//Create jsGraphics object
+var headlen = 10;
+/*
+var hexno=new String;
+arr=new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f");
+var n1=Math.round(Math.random()*15);
+var n2=Math.round(Math.random()*15);
+var n3=Math.round(Math.random()*15);
+var n4=Math.round(Math.random()*15);
+var n5=Math.round(Math.random()*15);
+var n6=Math.round(Math.random()*15);
+hexno="#"+arr[n1]+""+arr[n2]+""+arr[n3]+""+arr[n4]+""+arr[n5]+""+arr[n6];
+*/
+hexno="black";
+var polypoints = new Array();
+var n2=n*2;
+
+
+var sx=polypts[0];
+var sy=polypts[1];
+ 
+var sx1=polypts[n2-4];
+var sy1=polypts[n2-3];
+var ex1=polypts[n2-2];
+var ey1=polypts[n2-1];
+
+context.beginPath();
+canvas_arrow_head(context,sx1,sy1,ex1,ey1);
+
+context.moveTo(polypts[0],polypts[1]);
+nm=n%3;
+ni=(n-nm)/3;
+
+for(i=0;i<ni;i++)
+{
+  i11=i*6+2;
+  i12=i*6+3;
+  i21=i*6+4;
+  i22=i*6+5;
+  i31=i*6+6;
+  i32=i*6+7;
+
+  context.bezierCurveTo(polypts[i11],polypts[i12],polypts[i21],polypts[i22],polypts[i31],polypts[i32]);
+  context.moveTo(polypts[i31],polypts[i32]);
+
+ // polypoints[i] = new jxPoint(polypts[i1], polypts[i2]);
+}
+
+
+if(nm==2)
+{
+  context.moveTo(polypts[i21],polypts[i22]);
+  context.bezierCurveTo(polypts[i31],polypts[i32],sx1,sy1,ex1,ey1);
+  context.moveTo(ex1,ey1);
+
+}
+
+ context.strokeStyle = hexno;
+ context.stroke();
+
+}
+
+
+var canvas=document.getElementById("test");
+var context = canvas.getContext("2d");
+context.lineWidth = 3;
+
+<?php
+for($i=0;$i<$nedges;$i++)
+{
+
+   $n=$edge_data[$i][4]; 
+   $n2=$n*2;
+   
+?>
+var polypoints = new Array();
+var j=0;
+var n="<?php print($n);?>";
+<?php
+for($j=0;$j<$n2;$j++)
+{
+$inx=$j+5;
+$data=$edge_data[$i][$inx];
+
+?>
+	polypoints[j] = "<?php print($data);?>";
+
+       j++;
+<?php
+}
+?>
+canvas_arrow_draw(n,polypoints,context);
+<?php
+}
+?>
+
+
+
+</script>
+</canvas>
+
+
+<?php 
+for($i=0;$i<$nnode;$i++)
+{
+  $x=$ID_data[$i][1]-8; $y=$ID_data[$i][2]-20; 
+  $name=$ID_data[$i][0];
+?>
+
+<script type="text/javascript">
+   google.setOnLoadCallback(draw_<?php print($name)?>);
+</script>
+<div id="<?php print($name)?>" style="left: <?php print($x)?>px; top: <?php print($y)?>px; width:<?php print($width);?>; height:<?php print($hieght);?>; position: absolute"></div>
+
+<?php 
+}
+?>
+
+
+</body>
+
+
+
+</html>
+
diff --git a/sourcecodes/network_layout_evd_example.php b/sourcecodes/network_layout_evd_example.php
new file mode 100644
index 00000000..4cec1f2f
--- /dev/null
+++ b/sourcecodes/network_layout_evd_example.php
@@ -0,0 +1,651 @@
+<?php 
+include("structuremap.php");
+
+function levelmap($inx,$name,$mapdata)
+{
+
+$leve_l=array();
+$leve_l=explode("\n",$mapdata);
+$leve_d=array();
+
+foreach($leve_l as $l)
+{ 
+  $l=trim($l);
+  $leve_d=explode("\t",$l);
+  $inxname=trim($leve_d[0]);
+  $name=trim($name);
+  if($inxname==$name)
+    return $leve_d[$inx];
+}
+           
+}
+
+
+////////////////////////////////////Read data from net_figure file///////////////////////Graphp Display/////////////////////////////////////////////
+$dir="./data/";
+
+
+$keyval=$_GET["My_key"];
+
+$matfile=$dir."$keyval"."net_figure.txt";
+
+$data_val="";
+
+$matrix=file("$matfile");
+$matrix1=file_get_contents("$matfile");   
+
+$lfile=$dir.$keyval."nlevels.txt";
+$levelmap=file_get_contents($lfile);   
+
+
+$str_arrmat=array();
+$str_arrmat=explode("\n",$matrix1);
+
+if($str_arrmat[2]=="" || $matrix1=="")
+{
+?>
+<h1><font color=blue>Error: Unable to display your network structure.</font></h1>
+<?php
+exit;
+}
+
+$datamat=array();
+$data_read=array();
+ 
+$node=trim($str_arrmat[0]);
+/*
+if($node<=5)
+{
+  $width=200;
+  $hieght=150;
+  $font=14;
+}
+else if($node>5 && $node<=7)
+{
+  $width=150;
+  $hieght=120;
+  $font=12;
+
+}
+else if($node>7 && $node<=10)
+{
+  $width=110;
+  $hieght=85;
+  $font=10;
+}
+else 
+{
+  $width=80;
+  $hieght=60;
+  $font=8;
+}
+*/
+  $width=150;
+  $hieght=150;
+  $font=12;
+
+$r_index=$node+2;
+
+for($i=0;$i<$node;$i++)
+{
+$datamat=explode("\t",$str_arrmat[$r_index]);
+$data_read[$i][0]=trim($datamat[0]);  //name
+$data_read[$i][1]=trim($datamat[1]);  //datatype
+$col_in=2;
+$r_index+=4;
+	if($datamat[1]==1)  //type=coninuous
+	{
+         for($j=1;$j<=101;$j++)
+         {
+           $datamat=explode("\t",$str_arrmat[$r_index]);
+           $data_read[$i][$col_in]=trim($datamat[0]);  //x data
+         //  echo $data_read[$i][$col_in];
+          // echo '&nbsp';
+
+           $col_in++;
+           $data_read[$i][$col_in]=trim($datamat[1]);  //y data
+          // echo $data_read[$i][$col_in];
+	   // echo '&nbsp';
+
+           $col_in++;
+           $r_index++; // increment to point next data
+           // echo "<br />"; 
+         } 
+	}
+	if($datamat[1]>1)  //type=descrete
+	{
+         $iter=$datamat[1];
+         for($j=1;$j<=$iter;$j++)
+         {
+           $datamat=explode("\t",$str_arrmat[$r_index]);
+           $data_read[$i][$col_in]=trim($datamat[0]);  //x data
+           //use level mapping
+           $data_read[$i][$col_in]=levelmap($data_read[$i][$col_in],$data_read[$i][0],$levelmap);
+ 
+           $col_in++;
+           $data_read[$i][$col_in]=trim($datamat[1]);  //y data
+         
+           $col_in++;
+           $r_index++; // increment to point next data
+           //echo "<br />"; 
+         } 
+	}
+
+}
+
+
+
+
+////////////////////////////////////////////////Graphviz data read////////////////////////////////////////////////////////////////////////////////
+
+$grv=$dir.$keyval."graphviz.txt";
+$line=shell_exec('/usr/bin/dot -Tplain -y '.$grv);
+
+//$grfilename=$keyval."graphviz.txt";
+//$cmd="/usr/bin/dot -Tplain -y  $grfilename";
+//$line=system($cmd);
+
+
+
+
+$str_arrname=array();
+$str_arrname=explode("\n",$line);
+$data=array();
+$ID_data=array();
+$i=0;
+$ii=0;
+foreach($str_arrname as $row)
+{
+  $i++;
+  if($i>1)
+  {
+       
+  	$data=explode(" ",$row);
+       $j=0;
+       $k=0;
+       $flag=0;
+  	foreach($data as $cell)
+	{
+             
+             $j++;
+             
+             $cell=trim($cell);
+             //echo $cell;
+             //echo '&nbsp';
+             if($j==1 && $cell=="node")
+             {
+                $flag=1;
+             }  
+               
+             if($j>1 && $j<5 && $flag==1)
+             {
+    		  //echo $cell;
+   		  //echo '&nbsp';
+                if($j==2)
+                   $ID_data[$ii][$k]=$cell;
+                else
+                   $ID_data[$ii][$k]=round($cell/10*900);
+               // echo $ID_data[$ii][$k];
+                //echo '&nbsp';
+
+                $k++; 
+             }
+       } 
+  
+       if($flag==1)
+       {
+          $ID_data[$ii][3]=$ID_data[$ii][1]+100;
+          $ID_data[$ii][4]=$ID_data[$ii][2]+150; 
+          $ID_data[$ii][5]=$ID_data[$ii][1]+100;
+          $ID_data[$ii][6]=$ID_data[$ii][2]; 
+          $ii++;
+          //echo "<br />"; 
+       } 
+     // echo "<br />"; 
+	
+  }
+}
+
+$nnode=$ii;
+$edge_data=array();
+
+$i=0;
+$ii=0;
+
+foreach($str_arrname as $row)
+{
+  $i++;
+  if($i>1)
+  {
+       
+  	$data=explode(" ",$row);
+       $j=0;
+       
+       $flag=0;
+       $number_of_point=0;
+       $index=0; 
+  	foreach($data as $cell)
+	{
+             $j++;
+             $cell=trim($cell);
+         
+             if($j==1 && $cell=="edge")
+             {
+                $flag=1;
+             }  
+               
+             if($j==2 && $flag==1)
+             {
+                
+                for($k=0;$k<$nnode;$k++)
+                {
+                      if($cell==$ID_data[$k][0])
+                      {
+                          $edge_data[$ii][0]=$ID_data[$k][3];
+                          $edge_data[$ii][1]=$ID_data[$k][4];
+                      }                     
+
+                }
+               
+             }
+             else if($j==3 && $flag==1)
+             {
+               for($k=0;$k<$nnode;$k++)
+                {
+                      if($cell==$ID_data[$k][0])
+                      {
+                          $edge_data[$ii][2]=$ID_data[$k][5];
+                          $edge_data[$ii][3]=$ID_data[$k][6];
+                      }                     
+
+                }
+
+             }
+             else if($j==4 && $flag==1)
+             {
+                  $edge_data[$ii][4]=$cell;
+                  $number_of_point=$cell*2;
+                  $index=5;
+             }
+             else if($j>4 && $number_of_point>0 && $flag==1)
+             {
+                if(($j%2)!=0)
+                  $edge_data[$ii][$index]=round($cell/10*900)+60;//+30+30;
+                else
+                  $edge_data[$ii][$index]=round($cell/10*900)+48;//+18+30;
+
+                $number_of_point--;
+                $index++;
+             }
+
+
+             
+       } 
+       if($flag==1)
+       {
+          $ii++;
+          //echo "<br />"; 
+       } 
+ 	
+  }
+}
+
+
+$nedges=$ii;
+
+?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
+<script type="text/javascript" src="http://www.google.com/jsapi"></script>
+ <script type="text/javascript">
+  google.load('visualization', '1', {packages: ['corechart']});
+ </script>
+ 
+
+<?php 
+$data_val="";
+
+for($i=0;$i<$nnode;$i++)
+ {
+////////////////////////////select node //////////////////////////////////////
+ $name=$ID_data[$i][0];
+ $fname="draw_".$name."()";
+ $data_val.=$name;
+ for($j=0;$j<$node;$j++)
+ {
+    if($data_read[$j][0]==$name)
+    {
+       $s_i=$j;
+       break;
+    } 
+ }
+ 
+/////////////////////////////////Display nodes//////////////////////////////////////////////////////////
+?>    
+ <script type="text/javascript">
+
+
+<?php
+  $node_type=$data_read[$s_i][1];
+  if($node_type>1) //discrete node
+  { 
+?>
+  
+ 
+  function <?php print($fname);?> {
+  // Create and populate the data table.
+ 
+  var data = google.visualization.arrayToDataTable([
+   ['<?php print($name);?>', ''],
+  <?php
+  $c_i=2; 
+
+  for($j=0;$j<$node_type-1;$j++) 
+  {     
+       $val1=trim($data_read[$s_i][$c_i]);
+
+
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;
+       $data_val.="\t".$val2;
+        
+  ?>
+   ['<?php print($val1);?>', <?php print($val2);?>],
+
+  <?php
+  }
+  if($j==$node_type-1)
+  {
+        $val1=trim($data_read[$s_i][$c_i]);
+
+
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;
+       $data_val.="\t".$val2."\n";
+  ?> 
+    ['<?php print($val1);?>', <?php print($val2);?>]
+<?php
+  }
+?>
+  ]);
+      
+        // Create and draw the visualization.
+      
+      var cnode="<?php print($name); ?>";
+      var keyv="<?php print($keyval);?>";  
+
+        var chart = new google.visualization.BarChart(document.getElementById('<?php print($name);?>'));
+        function selectHandler() {
+          var selectedItem = chart.getSelection()[0];
+          if (selectedItem) {
+            var topping = data.getValue(selectedItem.row, 0);
+            
+            var s = window.prompt('Selected evidence ' + topping + ' for ' + cnode + '. Enter new evidence ', topping );
+           
+            window.location.href = "add_evd_example.php?name=" + cnode + "&evidence=" + s + "&My_key="  + keyv;
+           
+
+  
+              //alert('The user selected ' + topping + topname);
+          }
+        } 
+         chart.draw(data,
+                 {title:"<?php print($name);?>", titleTextStyle: {fontSize: <?php print($font);?>},
+                  width:<?php print($width);?>, height:<?php print($hieght);?>,
+                  vAxis: {title: "State", textStyle: {fontSize:<?php print($font);?>}},
+		    hAxis: {title: "Fraction", minValue: 0, maxValue: 1, gridlines: {count: 3}}, legend: {position: 'none'},
+                  backgroundColor: {stroke: 'black', strokeWidth: 5}}
+            );
+        google.visualization.events.addListener(chart, 'select', selectHandler);  
+
+  }
+<?php
+ }
+ else //continuous node
+ {
+?>
+  function <?php print($fname);?> {
+  // Create and populate the data table.
+  var data = google.visualization.arrayToDataTable([
+   ['<?php print($name);?>', ''],
+  <?php
+  $c_i=2;
+  for($j=0;$j<100;$j++) 
+  {
+       $val1=trim($data_read[$s_i][$c_i]);
+       $val1=map($name,$val1,$keyval);
+
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;         
+       $data_val.="\t".$val2;
+  ?>
+   ['<?php print($val1);?>', <?php print($val2);?>],
+
+  <?php
+  }
+  if($j==100)
+  {
+       $val1=trim($data_read[$s_i][$c_i]);
+       $val1=map($name,$val1,$keyval);
+
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;
+       $data_val.="\t".$val2."\n";
+  ?> 
+    ['<?php print($val1);?>', <?php print($val2);?>]
+<?php
+  }
+?>
+  ]);
+      
+        // Create and draw the visualization.
+      var cnode="<?php print($name); ?>";
+      var keyv="<?php print($keyval);?>";  
+        var chart = new google.visualization.LineChart(document.getElementById('<?php print($name);?>'));
+
+        function selectHandler() {
+          var selectedItem = chart.getSelection()[0];
+          if (selectedItem) {
+           
+            var topping = data.getValue(selectedItem.row, 0);
+            var s = window.prompt('Selected evidence ' + topping + ' for ' + cnode + '. Enter new evidence ', topping );
+            window.location.href = "add_evd_example.php?name=" + cnode + "&evidence=" + s + "&My_key=" + keyv;  
+
+          }
+        }
+            chart.draw(data, {curveType: "function",
+                  title:"<?php print($name);?>", titleTextStyle: {fontSize: <?php print($font);?>},
+			legend: {position: 'none'},
+                  width:<?php print($width);?>, height:<?php print($hieght);?>,
+                  hAxis: {maxValue: 1, minValue: 0},
+			vAxis: {maxValue: 1, minValue: 0},
+                  backgroundColor: {stroke: 'black', strokeWidth: 5}}
+            );
+           google.visualization.events.addListener(chart, 'select', selectHandler); 
+       }
+
+<?php
+ }
+?>
+</script>
+<?php
+///////////////////////////end of display nodes////////////////////////////////////////////////
+}
+
+///////////////////////////////////write data to file///////////////////////////////////////////////////////////
+$fl=$dir.$keyval."structure_old.txt";
+$fp = fopen("$fl","w");
+fwrite($fp,"$data_val");
+?>
+
+
+
+<script type="text/javascript">
+function canvas_arrow(context, fromx, fromy, tox, toy){
+    var headlen = 15;
+    var dx = tox-fromx;
+    var dy = toy-fromy;
+    var angle = Math.atan2(dy,dx);
+    context.moveTo(fromx,fromy);
+    context.lineTo(tox,toy);
+    context.lineTo(tox-headlen*Math.cos(angle-Math.PI/6),toy-headlen*Math.sin(angle-Math.PI/6));
+    context.moveTo(tox,toy);
+    context.lineTo(tox-headlen*Math.cos(angle+Math.PI/6),toy-headlen*Math.sin(angle+Math.PI/6));
+}
+</script>
+
+<script type="text/javascript">
+function canvas_arrow_head(context, fromx, fromy, tox, toy){
+    var headlen = 15;
+    var dx = tox-fromx;
+    var dy = toy-fromy;
+    var angle = Math.atan2(dy,dx);
+    context.moveTo(tox,toy);
+    context.lineTo(tox-headlen*Math.cos(angle-Math.PI/6),toy-headlen*Math.sin(angle-Math.PI/6));
+    context.moveTo(tox,toy);
+    context.lineTo(tox-headlen*Math.cos(angle+Math.PI/6),toy-headlen*Math.sin(angle+Math.PI/6));
+}
+</script>
+
+
+</head>
+
+<body>
+<canvas id="test" width="3000" height="3000" style="position:absolute">
+<script>
+function canvas_arrow_draw(n, polypts,context){
+
+//Create jsGraphics object
+var headlen = 10;
+/*
+var hexno=new String;
+arr=new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f");
+var n1=Math.round(Math.random()*15);
+var n2=Math.round(Math.random()*15);
+var n3=Math.round(Math.random()*15);
+var n4=Math.round(Math.random()*15);
+var n5=Math.round(Math.random()*15);
+var n6=Math.round(Math.random()*15);
+hexno="#"+arr[n1]+""+arr[n2]+""+arr[n3]+""+arr[n4]+""+arr[n5]+""+arr[n6];
+*/
+hexno="black";
+var polypoints = new Array();
+var n2=n*2;
+
+
+var sx=polypts[0];
+var sy=polypts[1];
+ 
+var sx1=polypts[n2-4];
+var sy1=polypts[n2-3];
+var ex1=polypts[n2-2];
+var ey1=polypts[n2-1];
+
+context.beginPath();
+canvas_arrow_head(context,sx1,sy1,ex1,ey1);
+
+context.moveTo(polypts[0],polypts[1]);
+nm=n%3;
+ni=(n-nm)/3;
+
+for(i=0;i<ni;i++)
+{
+  i11=i*6+2;
+  i12=i*6+3;
+  i21=i*6+4;
+  i22=i*6+5;
+  i31=i*6+6;
+  i32=i*6+7;
+
+  context.bezierCurveTo(polypts[i11],polypts[i12],polypts[i21],polypts[i22],polypts[i31],polypts[i32]);
+  context.moveTo(polypts[i31],polypts[i32]);
+
+ // polypoints[i] = new jxPoint(polypts[i1], polypts[i2]);
+}
+
+
+if(nm==2)
+{
+  context.moveTo(polypts[i21],polypts[i22]);
+  context.bezierCurveTo(polypts[i31],polypts[i32],sx1,sy1,ex1,ey1);
+  context.moveTo(ex1,ey1);
+
+}
+
+ context.strokeStyle = hexno;
+ context.stroke();
+
+}
+
+
+var canvas=document.getElementById("test");
+var context = canvas.getContext("2d");
+context.lineWidth = 3;
+
+<?php
+for($i=0;$i<$nedges;$i++)
+{
+
+   $n=$edge_data[$i][4]; 
+   $n2=$n*2;
+   
+?>
+var polypoints = new Array();
+var j=0;
+var n="<?php print($n);?>";
+<?php
+for($j=0;$j<$n2;$j++)
+{
+$inx=$j+5;
+$data=$edge_data[$i][$inx];
+
+?>
+	polypoints[j] = "<?php print($data);?>";
+
+       j++;
+<?php
+}
+?>
+canvas_arrow_draw(n,polypoints,context);
+<?php
+}
+?>
+
+
+
+</script>
+</canvas>
+
+
+<?php 
+for($i=0;$i<$nnode;$i++)
+{
+  $x=$ID_data[$i][1]-8; $y=$ID_data[$i][2]-20; 
+
+  $name=$ID_data[$i][0];
+?>
+
+<script type="text/javascript">
+   google.setOnLoadCallback(draw_<?php print($name)?>);
+</script>
+<div id="<?php print($name)?>" style="left: <?php print($x)?>px; top: <?php print($y)?>px; width:<?php print($width);?>; height:<?php print($hieght);?>; position: absolute"></div>
+
+<?php 
+}
+?>
+
+
+</body>
+
+
+
+</html>
+
+
diff --git a/sourcecodes/network_layout_inv.php b/sourcecodes/network_layout_inv.php
new file mode 100644
index 00000000..c11fc774
--- /dev/null
+++ b/sourcecodes/network_layout_inv.php
@@ -0,0 +1,664 @@
+<?php 
+include("structuremap.php");
+
+function levelmap($inx,$name,$mapdata)
+{
+
+$leve_l=array();
+$leve_l=explode("\n",$mapdata);
+$leve_d=array();
+
+foreach($leve_l as $l)
+{ 
+  $l=trim($l);
+  $leve_d=explode("\t",$l);
+  $inxname=trim($leve_d[0]);
+  $name=trim($name);
+  if($inxname==$name)
+    return $leve_d[$inx];
+}
+           
+}
+
+////////////////////////////////////Read data from net_figure file///////////////////////Graphp Display/////////////////////////////////////////////
+
+$keyval=$_GET["My_key"];
+$dir="./data/";
+
+$lfile=$dir.$keyval."nlevels.txt";
+$levelmap=file_get_contents($lfile);   
+
+
+
+
+$matfile=$dir."$keyval"."net_figure.txt";
+
+
+$data_val="";
+
+$matrix=file("$matfile");
+$matrix1=file_get_contents("$matfile");              //file("$matfile");
+
+$str_arrmat=array();
+$str_arrmat=explode("\n",$matrix1);
+
+
+if($str_arrmat[2]=="" || $matrix1=="")
+{
+?>
+<h1><font color=blue>Error: Unable to display your network structure.</font></h1>
+
+<?php
+exit;
+}
+
+$datamat=array();
+$data_read=array();
+ 
+$node=trim($str_arrmat[0]);
+/*
+if($node<=5)
+{
+  $width=200;
+  $hieght=150;
+  $font=14;
+}
+else if($node>5 && $node<=7)
+{
+  $width=150;
+  $hieght=120;
+  $font=12;
+
+}
+else if($node>7 && $node<=10)
+{
+  $width=110;
+  $hieght=85;
+  $font=10;
+}
+else 
+{
+  $width=80;
+  $hieght=60;
+  $font=8;
+}
+*/
+  $width=150;
+  $hieght=150;
+  $font=12;
+
+$r_index=$node+2;
+
+for($i=0;$i<$node;$i++)
+{
+$datamat=explode("\t",$str_arrmat[$r_index]);
+$data_read[$i][0]=trim($datamat[0]);  //name
+$data_read[$i][1]=trim($datamat[1]);  //datatype
+$col_in=2;
+$r_index+=4;
+	if($datamat[1]==1)  //type=coninuous
+	{
+         for($j=1;$j<=101;$j++)
+         {
+           $datamat=explode("\t",$str_arrmat[$r_index]);
+           $data_read[$i][$col_in]=trim($datamat[0]);  //x data
+         //  echo $data_read[$i][$col_in];
+          // echo '&nbsp';
+
+           $col_in++;
+           $data_read[$i][$col_in]=trim($datamat[1]);  //y data
+          // echo $data_read[$i][$col_in];
+	   // echo '&nbsp';
+
+           $col_in++;
+           $r_index++; // increment to point next data
+           // echo "<br />"; 
+         } 
+	}
+	if($datamat[1]>1)  //type=descrete
+	{
+         $iter=$datamat[1];
+         for($j=1;$j<=$iter;$j++)
+         {
+           $datamat=explode("\t",$str_arrmat[$r_index]);
+           $data_read[$i][$col_in]=trim($datamat[0]);  //x data
+           $data_read[$i][$col_in]=levelmap($data_read[$i][$col_in],$data_read[$i][0],$levelmap);
+
+         //  echo $data_read[$i][$col_in];
+          // echo '&nbsp';
+  
+           $col_in++;
+           $data_read[$i][$col_in]=trim($datamat[1]);  //y data
+          // echo $data_read[$i][$col_in];
+           //echo '&nbsp';
+
+           $col_in++;
+           $r_index++; // increment to point next data
+           //echo "<br />"; 
+         } 
+	}
+
+}
+
+
+
+
+////////////////////////////////////////////////Graphviz data read////////////////////////////////////////////////////////////////////////////////
+$grv=$dir.$keyval."graphviz.txt";
+$line=shell_exec('/usr/bin/dot -Tplain -y '.$grv);
+
+
+$grviz_name_list=array();
+$g_file_name="./data/".$keyval."grviz_name_file.txt";
+$grviz_name=file_get_contents("$g_file_name");
+$grviz_name_list=explode("\n",$grviz_name);
+
+
+//$grfilename=$keyval."graphviz.txt";
+//$cmd="/usr/bin/dot -Tplain -y  $grfilename";
+//$line=system($cmd);
+
+
+//shell_exec('/usr/bin/dot -Tpng -o /var/www/html/compbio/BNW/graphviz.png /var/www/html/compbio/BNW/graphviz.txt');
+$str_arrname=array();
+$str_arrname=explode("\n",$line);
+$data=array();
+$ID_data=array();
+$i=0;
+$ii=0;
+foreach($str_arrname as $row)
+{
+  $i++;
+  if($i>1)
+  {
+       
+  	$data=explode(" ",$row);
+       $j=0;
+       $k=0;
+       $flag=0;
+  	foreach($data as $cell)
+	{
+             
+             $j++;
+             
+             $cell=trim($cell);
+             //echo $cell;
+             //echo '&nbsp';
+             if($j==1 && $cell=="node")
+             {
+                $flag=1;
+             }  
+               
+             if($j>1 && $j<5 && $flag==1)
+             {
+    		  //echo $cell;
+   		  //echo '&nbsp';
+                if($j==2)
+                   $ID_data[$ii][$k]=$grviz_name_list[$cell];
+                else
+                   $ID_data[$ii][$k]=round($cell/10*900);
+               // echo $ID_data[$ii][$k];
+                //echo '&nbsp';
+
+                $k++; 
+             }
+       } 
+  
+       if($flag==1)
+       {
+          $ID_data[$ii][3]=$ID_data[$ii][1]+100;
+          $ID_data[$ii][4]=$ID_data[$ii][2]+150; 
+          $ID_data[$ii][5]=$ID_data[$ii][1]+100;
+          $ID_data[$ii][6]=$ID_data[$ii][2]; 
+          $ii++;
+          //echo "<br />"; 
+       } 
+     // echo "<br />"; 
+	
+  }
+}
+
+$nnode=$ii;
+$edge_data=array();
+
+$i=0;
+$ii=0;
+
+foreach($str_arrname as $row)
+{
+  $i++;
+  if($i>1)
+  {
+       
+  	$data=explode(" ",$row);
+       $j=0;
+       
+       $flag=0;
+       $number_of_point=0;
+       $index=0; 
+  	foreach($data as $cell)
+	{
+             $j++;
+             $cell=trim($cell);
+         
+             if($j==1 && $cell=="edge")
+             {
+                $flag=1;
+             }  
+               
+             if($j==2 && $flag==1)
+             {
+                
+                for($k=0;$k<$nnode;$k++)
+                {
+                      $cell=$grviz_name_list[$cell];
+                      if($cell==$ID_data[$k][0])
+                      {
+                          $edge_data[$ii][0]=$ID_data[$k][3];
+                          $edge_data[$ii][1]=$ID_data[$k][4];
+                      }                     
+
+                }
+               
+             }
+             else if($j==3 && $flag==1)
+             {
+               for($k=0;$k<$nnode;$k++)
+                {
+                      if($cell==$ID_data[$k][0])
+                      {
+                          $edge_data[$ii][2]=$ID_data[$k][5];
+                          $edge_data[$ii][3]=$ID_data[$k][6];
+                      }                     
+
+                }
+
+             }
+             else if($j==4 && $flag==1)
+             {
+                  $edge_data[$ii][4]=$cell;
+                  $number_of_point=$cell*2;
+                  $index=5;
+             }
+             else if($j>4 && $number_of_point>0 && $flag==1)
+             {
+                if(($j%2)!=0)
+                  $edge_data[$ii][$index]=round($cell/10*900)+60;//+30+30;
+                else
+                  $edge_data[$ii][$index]=round($cell/10*900)+48;//+18+30;
+
+                $number_of_point--;
+                $index++;
+             }
+
+
+             
+       } 
+       if($flag==1)
+       {
+          $ii++;
+          //echo "<br />"; 
+       } 
+ 	
+  }
+}
+
+
+$nedges=$ii;
+
+?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
+<script type="text/javascript" src="http://www.google.com/jsapi"></script>
+ <script type="text/javascript">
+  google.load('visualization', '1', {packages: ['corechart']});
+ </script>
+ 
+
+<?php 
+$data_val="";
+
+for($i=0;$i<$nnode;$i++)
+ {
+////////////////////////////select node //////////////////////////////////////
+ $name=$ID_data[$i][0];
+ $fname="draw_".$name."()";
+ $data_val.=$name;
+ for($j=0;$j<$node;$j++)
+ {
+    if($data_read[$j][0]==$name)
+    {
+       $s_i=$j;
+       break;
+    } 
+ }
+ 
+/////////////////////////////////Display nodes//////////////////////////////////////////////////////////
+?>    
+ <script type="text/javascript">
+
+
+<?php
+  $node_type=$data_read[$s_i][1];
+  if($node_type>1) //discrete node
+  { 
+?>
+  
+ 
+  function <?php print($fname);?> {
+  // Create and populate the data table.
+ 
+  var data = google.visualization.arrayToDataTable([
+   ['<?php print($name);?>', ''],
+  <?php
+  $c_i=2; 
+
+  for($j=0;$j<$node_type-1;$j++) 
+  {     
+       $val1=trim($data_read[$s_i][$c_i]);
+
+
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;
+       $data_val.="\t".$val2;
+        
+  ?>
+   ['<?php print($val1);?>', <?php print($val2);?>],
+
+  <?php
+  }
+  if($j==$node_type-1)
+  {
+        $val1=trim($data_read[$s_i][$c_i]);
+
+
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;
+       $data_val.="\t".$val2."\n";
+  ?> 
+    ['<?php print($val1);?>', <?php print($val2);?>]
+<?php
+  }
+?>
+  ]);
+      
+        // Create and draw the visualization.
+      
+      var cnode="<?php print($name); ?>";
+       var keyv="<?php print($keyval);?>";  
+        var chart = new google.visualization.BarChart(document.getElementById('<?php print($name);?>'));
+        function selectHandler() {
+          var selectedItem = chart.getSelection()[0];
+          if (selectedItem) {
+            var topping = data.getValue(selectedItem.row, 0);
+            
+            var s = window.prompt('Selected evidence ' + topping + ' for ' + cnode + '. Enter new evidence ', topping );
+           
+            window.location.href = "add_inv.php?name=" + cnode + "&evidence=" + s + "&My_key=" + keyv;
+           
+
+  
+              //alert('The user selected ' + topping + topname);
+          }
+        } 
+         chart.draw(data,
+                 {title:"<?php print($name);?>", titleTextStyle: {fontSize: <?php print($font);?>},
+                  width:<?php print($width);?>, height:<?php print($hieght);?>,
+                  vAxis: {title: "State", textStyle: {fontSize:<?php print($font);?>}},
+		    hAxis: {title: "Fraction", minValue: 0, maxValue: 1, gridlines: {count: 3}}, legend: {position: 'none'},
+                  backgroundColor: {stroke: 'black', strokeWidth: 5}}
+            );
+        google.visualization.events.addListener(chart, 'select', selectHandler);  
+
+  }
+<?php
+ }
+ else //continuous node
+ {
+?>
+  function <?php print($fname);?> {
+  // Create and populate the data table.
+  var data = google.visualization.arrayToDataTable([
+   ['<?php print($name);?>', ''],
+  <?php
+  $c_i=2;
+  for($j=0;$j<100;$j++) 
+  {
+       $val1=trim($data_read[$s_i][$c_i]);
+       $val1=map($name,$val1,$keyval);
+
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;         
+       $data_val.="\t".$val2;
+  ?>
+   ['<?php print($val1);?>', <?php print($val2);?>],
+
+  <?php
+  }
+  if($j==100)
+  {
+       $val1=trim($data_read[$s_i][$c_i]);
+       $val1=map($name,$val1,$keyval);
+
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;
+       $data_val.="\t".$val2."\n";
+  ?> 
+    ['<?php print($val1);?>', <?php print($val2);?>]
+<?php
+  }
+?>
+  ]);
+      
+        // Create and draw the visualization.
+      var cnode="<?php print($name); ?>";
+      var keyv="<?php print($keyval);?>";
+
+        var chart = new google.visualization.LineChart(document.getElementById('<?php print($name);?>'));
+
+        function selectHandler() {
+          var selectedItem = chart.getSelection()[0];
+          if (selectedItem) {
+           
+            var topping = data.getValue(selectedItem.row, 0);
+            var s = window.prompt('Selected evidence ' + topping + ' for ' + cnode + '. Enter new evidence ', topping );
+            window.location.href = "add_inv.php?name=" + cnode + "&evidence=" + s + "&My_key=" + keyv;  
+
+          }
+        }
+            chart.draw(data, {curveType: "function",
+                  title:"<?php print($name);?>", titleTextStyle: {fontSize: <?php print($font);?>},
+			legend: {position: 'none'},
+                  width:<?php print($width);?>, height:<?php print($hieght);?>,
+                  hAxis: {maxValue: 1, minValue: 0},
+			vAxis: {maxValue: 1, minValue: 0},
+                  backgroundColor: {stroke: 'black', strokeWidth: 5}}
+            );
+           google.visualization.events.addListener(chart, 'select', selectHandler); 
+       }
+
+<?php
+ }
+?>
+</script>
+<?php
+///////////////////////////end of display nodes////////////////////////////////////////////////
+}
+
+
+///////////////////////////////////write data to file///////////////////////////////////////////////////////////
+
+
+?>
+
+
+
+<script type="text/javascript">
+function canvas_arrow(context, fromx, fromy, tox, toy){
+    var headlen = 15;
+    var dx = tox-fromx;
+    var dy = toy-fromy;
+    var angle = Math.atan2(dy,dx);
+    context.moveTo(fromx,fromy);
+    context.lineTo(tox,toy);
+    context.lineTo(tox-headlen*Math.cos(angle-Math.PI/6),toy-headlen*Math.sin(angle-Math.PI/6));
+    context.moveTo(tox,toy);
+    context.lineTo(tox-headlen*Math.cos(angle+Math.PI/6),toy-headlen*Math.sin(angle+Math.PI/6));
+}
+</script>
+
+<script type="text/javascript">
+function canvas_arrow_head(context, fromx, fromy, tox, toy){
+    var headlen = 15;
+    var dx = tox-fromx;
+    var dy = toy-fromy;
+    var angle = Math.atan2(dy,dx);
+    context.moveTo(tox,toy);
+    context.lineTo(tox-headlen*Math.cos(angle-Math.PI/6),toy-headlen*Math.sin(angle-Math.PI/6));
+    context.moveTo(tox,toy);
+    context.lineTo(tox-headlen*Math.cos(angle+Math.PI/6),toy-headlen*Math.sin(angle+Math.PI/6));
+}
+</script>
+
+
+</head>
+
+<body>
+<canvas id="test" width="3000" height="3000" style="position:absolute">
+<script>
+function canvas_arrow_draw(n, polypts,context){
+
+//Create jsGraphics object
+var headlen = 10;
+/*
+var hexno=new String;
+arr=new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f");
+var n1=Math.round(Math.random()*15);
+var n2=Math.round(Math.random()*15);
+var n3=Math.round(Math.random()*15);
+var n4=Math.round(Math.random()*15);
+var n5=Math.round(Math.random()*15);
+var n6=Math.round(Math.random()*15);
+hexno="#"+arr[n1]+""+arr[n2]+""+arr[n3]+""+arr[n4]+""+arr[n5]+""+arr[n6];
+*/
+hexno="black";
+var polypoints = new Array();
+var n2=n*2;
+
+
+var sx=polypts[0];
+var sy=polypts[1];
+ 
+var sx1=polypts[n2-4];
+var sy1=polypts[n2-3];
+var ex1=polypts[n2-2];
+var ey1=polypts[n2-1];
+
+context.beginPath();
+canvas_arrow_head(context,sx1,sy1,ex1,ey1);
+
+context.moveTo(polypts[0],polypts[1]);
+nm=n%3;
+ni=(n-nm)/3;
+
+for(i=0;i<ni;i++)
+{
+  i11=i*6+2;
+  i12=i*6+3;
+  i21=i*6+4;
+  i22=i*6+5;
+  i31=i*6+6;
+  i32=i*6+7;
+
+  context.bezierCurveTo(polypts[i11],polypts[i12],polypts[i21],polypts[i22],polypts[i31],polypts[i32]);
+  context.moveTo(polypts[i31],polypts[i32]);
+
+ // polypoints[i] = new jxPoint(polypts[i1], polypts[i2]);
+}
+
+
+if(nm==2)
+{
+  context.moveTo(polypts[i21],polypts[i22]);
+  context.bezierCurveTo(polypts[i31],polypts[i32],sx1,sy1,ex1,ey1);
+  context.moveTo(ex1,ey1);
+
+}
+
+ context.strokeStyle = hexno;
+ context.stroke();
+
+}
+
+
+var canvas=document.getElementById("test");
+var context = canvas.getContext("2d");
+context.lineWidth = 3;
+
+<?php
+for($i=0;$i<$nedges;$i++)
+{
+
+   $n=$edge_data[$i][4]; 
+   $n2=$n*2;
+   
+?>
+var polypoints = new Array();
+var j=0;
+var n="<?php print($n);?>";
+<?php
+for($j=0;$j<$n2;$j++)
+{
+$inx=$j+5;
+$data=$edge_data[$i][$inx];
+
+?>
+	polypoints[j] = "<?php print($data);?>";
+
+       j++;
+<?php
+}
+?>
+canvas_arrow_draw(n,polypoints,context);
+<?php
+}
+?>
+
+
+
+</script>
+</canvas>
+
+
+<?php 
+for($i=0;$i<$nnode;$i++)
+{
+  $x=$ID_data[$i][1]-8; $y=$ID_data[$i][2]-20; 
+
+  $name=$ID_data[$i][0];
+?>
+
+<script type="text/javascript">
+   google.setOnLoadCallback(draw_<?php print($name)?>);
+</script>
+<div id="<?php print($name)?>" style="left: <?php print($x)?>px; top: <?php print($y)?>px; width:<?php print($width);?>; height:<?php print($hieght);?>; position: absolute"></div>
+
+<?php 
+}
+?>
+
+
+</body>
+
+
+
+</html>
+
+
diff --git a/sourcecodes/network_layout_inv_2.php b/sourcecodes/network_layout_inv_2.php
new file mode 100644
index 00000000..4a1471a5
--- /dev/null
+++ b/sourcecodes/network_layout_inv_2.php
@@ -0,0 +1,1160 @@
+<?php 
+include("structuremap.php");
+
+
+function levelmap($inx,$name,$mapdata)
+{
+
+$leve_l=array();
+$leve_l=explode("\n",$mapdata);
+$leve_d=array();
+
+foreach($leve_l as $l)
+{ 
+  $l=trim($l);
+  $leve_d=explode("\t",$l);
+  $inxname=trim($leve_d[0]);
+  $name=trim($name);
+  if($inxname==$name)
+    return $leve_d[$inx];
+}
+           
+}
+
+
+
+$keyval=$_GET["My_key"];
+
+$dir="./data/";
+
+$lfile=$dir.$keyval."nlevels.txt";
+$levelmap=file_get_contents($lfile); 
+///////////////////Search for child nodes////////////////////////////////
+
+function ischild($ev_child_arr,$name)
+{
+  $match=0;
+  $dataname=array();
+  $dataname=explode("|",$ev_child_arr);
+  $n=count($dataname);
+  for($i=0;$i<$n;$i++)
+  {
+
+     if($dataname[$i]==$name)
+     {
+         $match=1;
+         break;
+     
+     }
+
+  } 
+
+  return $match;
+}
+
+
+
+
+//////////////////////////Entered evidences//////////////////////////////////////////
+
+$fl=$dir.$keyval."varname.txt";
+$lines = file("$fl");
+
+$ev_arr=array();
+$ev_arr_tmp=array();
+
+$evdata_arr=array();
+
+$data_cell_ev=array();
+$cev=0;
+
+// Loop through our array, show HTML source as HTML source; and line numbers too.
+foreach ($lines as $line_num => $line) 
+{
+	$data_cell_ev=explode("\t",$line);
+	foreach ($data_cell_ev as $ld)
+	{
+  		$ldd=trim($ld);
+  		if($ldd !="")
+  		{
+        		$ev_arr[$cev]=$ldd;
+                     $ev_arr_tmp[$cev]=$ldd;  
+                     $cev++;
+  			//echo "Line #<b>{$line_num}</b> : " . htmlspecialchars($ldd) . "<br />\n";
+  		}
+	}
+
+}
+//////number of evidence node
+$temp_cev=$cev;
+/////////////////////////////////////
+//$ev_arr[$cev]  evidence array  
+//$cev  number of evidence
+/////////////////////////////////////
+// go through the structure file to pick childern of evidence node 
+//
+////////////////////////////////////
+$matfile=$dir.$keyval."structure_input_new.txt";
+$matrix1=file_get_contents("$matfile");           
+$str_arrmat=array();
+$str_arrmat=explode("\n",$matrix1);
+$datamat=array();
+$data_cell=array(); 
+$col_arr=array();
+$dataname=array();
+$dataname=explode("\t",$str_arrmat[0]);
+$n=count($dataname);
+
+$ev_child_arr="";
+  
+for($ii=0;$ii<$temp_cev;$ii++)
+{
+         $evdname=$ev_arr_tmp[$ii];
+         for($i=1;$i<=$n;$i++)
+         {
+                   $iii=$i-1; 
+                   $row_name=trim($dataname[$iii]);
+           
+                   if($row_name==$evdname)
+                   {
+	                      $col_arr=explode("\t",$str_arrmat[$i]);
+		               for($j=0;$j<$n;$j++)
+	  	               {
+               	           $col_val=trim($col_arr[$j]);
+               	           if($col_val==1)
+               	           { 
+                                       $ddname=trim($dataname[$j]); 
+                                       $pos = strpos($ev_child_arr, $ddname);
+                                       if ($pos === false)
+                                       {
+                                          $ev_arr_tmp[$temp_cev]=$ddname; 
+                                          $temp_cev++;
+                                          $ev_child_arr.="|".$ddname;
+                                       }
+                           
+	        	            }
+          	                }
+
+                   }
+        }        
+     
+} 
+
+
+
+$fl=$dir.$keyval."vardata.txt";
+$linesd = file("$fl");
+$cevdata=0;
+// Loop through our array, show HTML source as HTML source; and line numbers too.
+foreach ($linesd as $line_num => $line) 
+{
+  
+	$data_cell_ev=explode("\t",$line);
+	foreach ($data_cell_ev as $ld)
+	{
+  		$ldd=trim($ld);
+  		if($ldd !="")
+  		{
+        		$evdata_arr[$cevdata]=$ldd;  
+                     $cevdata++;
+                     //echo "Line #<b>{$line_num}</b> : " . htmlspecialchars($ldd) . "<br />\n";
+
+  			
+  		}
+	}
+  
+}
+
+
+
+////////////////////////////////////Read data from net_figure file///////////////////////Graphp Display/////////////////////////////////////////////
+
+
+$matfile=$dir.$keyval."net_figure_new.txt";
+
+$data_val="";
+
+$matrix=file("$matfile");
+$matrix1=file_get_contents("$matfile");              //file("$matfile");
+
+$str_arrmat=array();
+$str_arrmat=explode("\n",$matrix1);
+
+if($str_arrmat[2]=="" || $matrix1=="")
+{
+?>
+<h1><font color=blue>Error: Unable to display your network structure.</font></h1>
+<?php
+exit;
+}
+
+$node=trim($str_arrmat[1]);
+
+
+
+
+
+/*
+if($node<=5)
+{
+  $width=200;
+  $hieght=150;
+  $font=14;
+}
+else if($node>5 && $node<=7)
+{
+  $width=150;
+  $hieght=120;
+  $font=12;
+
+}
+else if($node>7 && $node<=10)
+{
+  $width=110;
+  $hieght=85;
+  $font=10;
+}
+else 
+{
+  $width=80;
+  $hieght=60;
+  $font=8;
+}
+*/
+  $width=150;
+  $hieght=150;
+  $font=12;
+
+
+$datamat=array();
+$data_read=array();
+
+$r_index=$node+3;
+
+for($i=0;$i<$node;$i++)
+{
+$datamat=explode("\t",$str_arrmat[$r_index]);
+$data_read[$i][0]=trim($datamat[0]);  //name
+$data_read[$i][1]=trim($datamat[1]);  //datatype
+$nodetype=$data_read[$i][1];
+$col_in=2;
+$r_index+=4;
+$evd=-9999;
+$name=$data_read[$i][0];
+for($ii=0;$ii<$cev;$ii++)
+{
+     if($ev_arr[$ii]==$name)
+     {
+        $evd=$evdata_arr[$ii]; 
+        if($nodetype>1)
+            $evd=levelmap($evd,$data_read[$i][0],$levelmap);
+
+        break;
+     }
+}
+
+if($evd!=-9999)//with evidence
+{
+           $datamat=explode("\t",$str_arrmat[$r_index]);
+           $data_read[$i][$col_in]=trim($datamat[0]);  //x data
+           $col_in++;
+           $data_read[$i][$col_in]=trim($datamat[1]);  //y data
+           $col_in++;
+           $r_index++; // increment to point next data
+
+      
+}
+else //without evidence
+{
+	if($nodetype==1)  //type=coninuous
+	{
+         for($j=1;$j<=101;$j++)
+         {
+           $datamat=explode("\t",$str_arrmat[$r_index]);
+           $data_read[$i][$col_in]=trim($datamat[0]);  //x data
+ 
+           $col_in++;
+           $data_read[$i][$col_in]=trim($datamat[1]);  //y data
+ 
+           $col_in++;
+           $r_index++; // increment to point next data
+         } 
+	}
+	if($nodetype>1)  //type=descrete
+	{
+         $iter=$datamat[1];
+         for($j=1;$j<=$iter;$j++)
+         {
+           $datamat=explode("\t",$str_arrmat[$r_index]);
+           $data_read[$i][$col_in]=trim($datamat[0]);  //x data
+           $data_read[$i][$col_in]=levelmap($data_read[$i][$col_in],$data_read[$i][0],$levelmap);
+  
+           $col_in++;
+           $data_read[$i][$col_in]=trim($datamat[1]);  //y data
+            $col_in++;
+           $r_index++; // increment to point next data
+         } 
+	}
+
+}
+
+}
+
+
+$matfile_old=$dir.$keyval."net_figure.txt";
+
+$data_val="";
+
+$matrix_old=file("$matfile_old");
+$matrix1_old=file_get_contents("$matfile_old");              //file("$matfile");
+$str_arrmat_old=array();
+$str_arrmat_old=explode("\n",$matrix1_old);
+$datamat_old=array();
+$data_read_old=array();
+$node_old=trim($str_arrmat_old[0]);
+$r_index_old=$node_old+2;
+
+for($i=0;$i<$node_old;$i++)
+{
+	$datamat_old=explode("\t",$str_arrmat_old[$r_index_old]);
+	$data_read_old[$i][0]=trim($datamat_old[0]);  //name
+	$data_read_old[$i][1]=trim($datamat_old[1]);  //datatype
+	$col_in_old=2;
+	$r_index_old+=4;
+	if($datamat_old[1]==1)  //type=coninuous
+	{
+         for($j=1;$j<=101;$j++)
+         {
+           $datamat_old=explode("\t",$str_arrmat_old[$r_index_old]);
+           $data_read_old[$i][$col_in_old]=trim($datamat_old[0]);  //x data
+
+           $col_in_old++;
+           $data_read_old[$i][$col_in_old]=trim($datamat_old[1]);  //y data
+   
+           $col_in_old++;
+           $r_index_old++; // increment to point next data
+
+         } 
+	}
+	if($datamat_old[1]>1)  //type=descrete
+	{
+         $iter=$datamat_old[1];
+         for($j=1;$j<=$iter;$j++)
+         {
+           $datamat_old=explode("\t",$str_arrmat_old[$r_index_old]);
+           $data_read_old[$i][$col_in_old]=trim($datamat_old[0]);  //x data
+           $data_read_old[$i][$col_in_old]=levelmap($data_read_old[$i][$col_in_old],$data_read_old[$i][0],$levelmap);
+           $col_in_old++;
+           $data_read_old[$i][$col_in_old]=trim($datamat_old[1]);  //y data
+           $col_in_old++;
+           $r_index_old++; // increment to point next data
+
+         } 
+	}
+}
+
+
+////////////////////////////////////////////////Graphviz data read////////////////////////////////////////////////////////////////////////////////
+$grv=$dir.$keyval."graphviz_new.txt";
+$line=shell_exec('/usr/bin/dot -Tplain -y '.$grv);
+
+$grviz_name_list=array();
+$g_file_name="./data/".$keyval."grviz_name_file_new.txt";
+$grviz_name=file_get_contents("$g_file_name");
+$grviz_name_list=explode("\n",$grviz_name);
+
+
+
+//$grfilename=$keyval."graphviz.txt";
+//$cmd="/usr/bin/dot -Tplain -y  $grfilename";
+//$line=system($cmd);
+
+
+//shell_exec('/usr/bin/dot -Tpng -o /var/www/html/compbio/BNW/graphviz.png /var/www/html/compbio/BNW/graphviz.txt');
+$str_arrname=array();
+$str_arrname=explode("\n",$line);
+$data=array();
+$ID_data=array();
+$i=0;
+$ii=0;
+foreach($str_arrname as $row)
+{
+  $i++;
+  if($i>1)
+  {
+       
+  	$data=explode(" ",$row);
+       $j=0;
+       $k=0;
+       $flag=0;
+  	foreach($data as $cell)
+	{
+             
+             $j++;
+             
+             $cell=trim($cell);
+             //echo $cell;
+             //echo '&nbsp';
+             if($j==1 && $cell=="node")
+             {
+                $flag=1;
+             }  
+               
+             if($j>1 && $j<5 && $flag==1)
+             {
+    		  //echo $cell;
+   		  //echo '&nbsp';
+                if($j==2)
+                   $ID_data[$ii][$k]=$grviz_name_list[$cell];
+                else
+                   $ID_data[$ii][$k]=round($cell/10*900);
+               // echo $ID_data[$ii][$k];
+                //echo '&nbsp';
+
+                $k++; 
+             }
+       } 
+  
+       if($flag==1)
+       {
+          $ID_data[$ii][3]=$ID_data[$ii][1]+100;
+          $ID_data[$ii][4]=$ID_data[$ii][2]+150; 
+          $ID_data[$ii][5]=$ID_data[$ii][1]+100;
+          $ID_data[$ii][6]=$ID_data[$ii][2]; 
+          $ii++;
+          //echo "<br />"; 
+       } 
+     // echo "<br />"; 
+	
+  }
+}
+
+$nnode=$ii;
+$edge_data=array();
+
+$i=0;
+$ii=0;
+
+foreach($str_arrname as $row)
+{
+  $i++;
+  if($i>1)
+  {
+       
+  	$data=explode(" ",$row);
+       $j=0;
+       
+       $flag=0;
+       $number_of_point=0;
+       $index=0; 
+  	foreach($data as $cell)
+	{
+             $j++;
+             $cell=trim($cell);
+         
+             if($j==1 && $cell=="edge")
+             {
+                $flag=1;
+             }  
+               
+             if($j==2 && $flag==1)
+             {
+                
+                for($k=0;$k<$nnode;$k++)
+                {
+                      $cell=$grviz_name_list[$cell];
+                      if($cell==$ID_data[$k][0])
+                      {
+                          $edge_data[$ii][0]=$ID_data[$k][3];
+                          $edge_data[$ii][1]=$ID_data[$k][4];
+                      }                     
+
+                }
+               
+             }
+             else if($j==3 && $flag==1)
+             {
+               for($k=0;$k<$nnode;$k++)
+                {
+                      if($cell==$ID_data[$k][0])
+                      {
+                          $edge_data[$ii][2]=$ID_data[$k][5];
+                          $edge_data[$ii][3]=$ID_data[$k][6];
+                      }                     
+
+                }
+
+             }
+             else if($j==4 && $flag==1)
+             {
+                  $edge_data[$ii][4]=$cell;
+                  $number_of_point=$cell*2;
+                  $index=5;
+             }
+             else if($j>4 && $number_of_point>0 && $flag==1)
+             {
+                if(($j%2)!=0)
+                  $edge_data[$ii][$index]=round($cell/10*900)+60;//+30+30;
+                else
+                  $edge_data[$ii][$index]=round($cell/10*900)+48;//+18+30;
+
+                $number_of_point--;
+                $index++;
+             }
+
+
+             
+       } 
+       if($flag==1)
+       {
+          $ii++;
+          //echo "<br />"; 
+       } 
+ 	
+  }
+}
+
+
+$nedges=$ii;
+//echo $nedges;
+
+?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
+<script type="text/javascript" src="http://www.google.com/jsapi"></script>
+ <script type="text/javascript">
+  google.load('visualization', '1', {packages: ['corechart']});
+ </script>
+ 
+
+<?php 
+$data_val="";
+
+for($i=0;$i<$nnode;$i++)
+ {
+////////////////////////////select node //////////////////////////////////////
+ $name=$ID_data[$i][0];
+ $fname="draw_".$name."()";
+ $data_val.=$name;
+$flag=0; //evidence flag
+ for($j=0;$j<$node;$j++)
+ {
+    if($data_read[$j][0]==$name)
+    {
+       $s_i=$j;
+       break;
+    } 
+ }
+ for($j=0;$j<$node_old;$j++)
+ {
+    if($data_read_old[$j][0]==$name)
+    {
+       $s_i_old=$j;
+       break;
+    } 
+ }
+ 
+
+/////////////////////////////////Display nodes//////////////////////////////////////////////////////////
+?>    
+ <script type="text/javascript">
+
+
+<?php
+  $node_type=$data_read[$s_i][1];
+  if($node_type>1) //discrete node
+  { 
+?>
+ 
+  function <?php print($fname);?> {
+  // Create and populate the data table.
+ 
+  <?php
+ $evd=-9999;
+  for($ii=0;$ii<$cev;$ii++)
+  {
+     if($ev_arr[$ii]==$name)
+     {
+        $evd=$evdata_arr[$ii]; 
+        $evd=levelmap($evd,$name,$levelmap);
+        $flag=1;
+        break;
+     }
+  }
+if($evd==-9999)
+{
+
+    //$pos = strpos($ev_child_arr,$name);
+    //if ($pos == false)
+    $match=ischild($ev_child_arr,$name);
+    if($match==0)
+    {
+?>
+  var data = google.visualization.arrayToDataTable([
+   ['<?php print($name);?>', 'Old'],
+<?php
+  $c_i=2; 
+  $c_i_old=2;
+  for($j=0;$j<$node_type-1;$j++) 
+  {     
+       $val1=trim($data_read[$s_i][$c_i]);
+      // $val1=map($name,$val1);
+
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;
+
+       $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;        
+  ?>
+   ['<?php print($val1_old);?>', <?php print($val2_old);?>],
+
+  <?php
+  }
+  if($j==$node_type-1)
+  {
+        $val1=trim($data_read[$s_i][$c_i]);
+      // $val1=map($name,$val1);
+
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;
+
+        $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;        
+  ?>
+   ['<?php print($val1_old);?>', <?php print($val2_old);?>]
+<?php
+   }
+ }
+ else 
+ {
+   ?>
+  var data = google.visualization.arrayToDataTable([
+   ['<?php print($name);?>', 'Old', 'New'],
+<?php
+  $c_i=2; 
+  $c_i_old=2;
+  for($j=0;$j<$node_type-1;$j++) 
+  {     
+       $val1=trim($data_read[$s_i][$c_i]);
+      // $val1=map($name,$val1);
+
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;
+
+       $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;        
+  ?>
+   ['<?php print($val1);?>', <?php print($val2_old);?>, <?php print($val2);?>],
+
+  <?php
+  }
+  if($j==$node_type-1)
+  {
+        $val1=trim($data_read[$s_i][$c_i]);
+      // $val1=map($name,$val1);
+
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;
+
+        $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;        
+  ?>
+   ['<?php print($val1);?>', <?php print($val2_old);?>, <?php print($val2);?>]
+<?php
+   }
+  }
+}
+else
+{
+  
+?>
+  var data = google.visualization.arrayToDataTable([
+    ['<?php print($name);?>', 'Old', 'New'],
+
+<?php
+ 
+  $c_i_old=2;
+  for($j=0;$j<$node_type-1;$j++) 
+  {     
+       $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++; 
+       if($val1_old==$evd)       
+       {
+  ?>
+         ['<?php print($val1_old);?>', <?php print($val2_old);?>, 1],
+
+  <?php
+       }
+       else{
+       ?>
+         ['<?php print($val1_old);?>', <?php print($val2_old);?>, 0],
+
+<?php
+         }   
+  }
+  if($j==$node_type-1)
+  {
+       $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;
+      if($val1_old==$evd)       
+       {
+      
+  ?>
+        ['<?php print($val1_old);?>', <?php print($val2_old);?>, 1]
+      <?php
+       } 
+       else{
+       ?>
+        ['<?php print($val1_old);?>', <?php print($val2_old);?>, 0] 
+<?php
+         }  
+  }
+}
+?>
+ ]);
+
+ 
+      
+        // Create and draw the visualization.
+      
+      var cnode="<?php print($name); ?>";
+      var keyv="<?php print($keyval);?>";
+
+    <?php if($evd!=-9999)
+             {
+                $named=$name.":".$evd;
+                $bcolor="red";
+                $font=10;
+             }
+             else
+             {
+                $named=$name;
+                $bcolor="black";
+                $font=12;
+             }
+         ?>  
+
+
+        var chart = new google.visualization.BarChart(document.getElementById('<?php print($name);?>'));
+        function selectHandler() {
+          var selectedItem = chart.getSelection()[0];
+          if (selectedItem) {
+            var topping = data.getValue(selectedItem.row, 0);
+            
+            var s = window.prompt('Selected evidence ' + topping + ' for ' + cnode + '. Enter new evidence ', topping );
+            
+            window.location.href = "add_inv.php?name=" + cnode + "&evidence=" + s + "&My_key=" + keyv;
+           
+
+  
+              //alert('The user selected ' + topping + topname);
+          }
+        } 
+         chart.draw(data,
+                 {title:"<?php print($named);?>", titleTextStyle: {fontSize: <?php print($font);?>},
+                  width:<?php print($width);?>, height:<?php print($hieght);?>,
+                  vAxis: {title: "State", textStyle: {fontSize:<?php print($font);?>}},
+		    hAxis: {title: "Fraction", minValue: 0, maxValue: 1, gridlines: {count: 3}}, legend: {position: 'none'},
+                  backgroundColor: {stroke: '<?php print($bcolor);?>', strokeWidth: 5}}
+            );
+        google.visualization.events.addListener(chart, 'select', selectHandler);  
+
+  }
+<?php
+ }
+ else //continuous node
+ {
+?>
+  function <?php print($fname);?> {
+  // Create and populate the data table.
+  <?php
+ $evd=-9999;
+  for($ii=0;$ii<$cev;$ii++)
+  {
+     if($ev_arr[$ii]==$name)
+     {
+        $evd=$evdata_arr[$ii]; 
+        break;
+     }
+  }
+if($evd==-9999)
+{
+
+    //$pos = strpos($ev_child_arr,$name);
+    //if ($pos == false)
+    $match=ischild($ev_child_arr,$name);
+    if($match==0)
+    {
+?>
+  var data = google.visualization.arrayToDataTable([
+   ['<?php print($name);?>', 'Old'],
+<?php
+  $c_i=2;
+  $c_i_old=2;
+  for($j=0;$j<100;$j++) 
+  {
+       $val1=trim($data_read[$s_i][$c_i]);
+       $val1=map($name,$val1,$keyval);
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;         
+
+       $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $val1_old=map($name,$val1_old,$keyval);
+
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++; 
+  ?>
+   ['<?php print($val1_old);?>', <?php print($val2_old);?>],
+
+  <?php
+  }
+  if($j==100)
+  {
+        $val1=trim($data_read[$s_i][$c_i]);
+       $val1=map($name,$val1,$keyval);
+
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;
+
+       $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $val1_old=map($name,$val1_old,$keyval);
+  
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;   
+  ?>
+   ['<?php print($val1_old);?>', <?php print($val2_old);?>]
+
+
+<?php 
+     }
+    }
+    else 
+    {
+
+?>
+  var data = google.visualization.arrayToDataTable([
+   ['<?php print($name);?>', 'Old', 'New'],
+<?php
+  $c_i=2;
+  $c_i_old=2;
+  for($j=0;$j<100;$j++) 
+  {
+       $val1=trim($data_read[$s_i][$c_i]);
+       $val1=map($name,$val1,$keyval);
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;         
+
+       $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++; 
+  ?>
+   ['<?php print($val1);?>', <?php print($val2_old);?>, <?php print($val2);?>],
+
+  <?php
+  }
+  if($j==100)
+  {
+        $val1=trim($data_read[$s_i][$c_i]);
+       $val1=map($name,$val1,$keyval);
+
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;
+
+       $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;   
+  ?>
+   ['<?php print($val1);?>', <?php print($val2_old);?>, <?php print($val2);?>]
+<?php
+   }
+  }
+}
+else
+{
+    $evd=map($name,$evd,$keyval);
+    $evduse=$evd;
+?>
+  var data = google.visualization.arrayToDataTable([
+    ['<?php print($name);?>', 'Old', 'New'],
+
+<?php
+ 
+  $c_i_old=2;
+  for($j=0;$j<100;$j++) 
+  {     
+       $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $val1_old=map($name,$val1_old,$keyval);
+
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++; 
+       if($val1_old<$evduse)  
+       {
+       ?>
+         ['<?php print($val1_old);?>', <?php print($val2_old);?>, 0],
+<?php
+       }
+       else if($val1_old>=$evduse) 
+       {
+        $evduse=99999;
+       ?>
+       ['<?php print($val1_old);?>', <?php print($val2_old);?>, 1],
+     
+       <?php
+       } 
+ }
+  if($j==100)
+  {
+       $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $val1_old=map($name,$val1_old,$keyval);
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;
+      
+  ?>
+        ['<?php print($val1_old);?>', <?php print($val2_old);?>, 0]
+ 
+<?php
+  }
+}
+?>
+ ]);
+      
+        // Create and draw the visualization.
+      var cnode="<?php print($name); ?>";
+      var keyv="<?php print($keyval);?>";
+     <?php if($evd!=-9999)
+             {
+                $named=$name.":".$evd;
+                $bcolor="red";
+                $font=10;
+             }
+             else
+             {
+                $named=$name;
+                $bcolor="black";
+                $font=12;
+             }
+       ?>  
+        var chart = new google.visualization.LineChart(document.getElementById('<?php print($name);?>'));
+
+        function selectHandler() {
+          var selectedItem = chart.getSelection()[0];
+          if (selectedItem) {
+           
+            var topping = data.getValue(selectedItem.row, 0);
+            var s = window.prompt('Selected evidence ' + topping + ' for ' + cnode + '. Enter new evidence ', topping );
+            window.location.href = "add_inv.php?name=" + cnode + "&evidence=" + s + "&My_key=" + keyv;  
+
+          }
+        }
+            chart.draw(data, {curveType: "function",
+                  title:"<?php print($named);?>", titleTextStyle: {fontSize: <?php print($font);?>},
+			legend: {position: 'none'},
+                  width:<?php print($width);?>, height:<?php print($hieght);?>,
+                  hAxis: {maxValue: 1, minValue: 0},
+			vAxis: {maxValue: 1, minValue: 0},
+                  backgroundColor: {stroke: '<?php print($bcolor);?>', strokeWidth: 5}}
+            );
+           google.visualization.events.addListener(chart, 'select', selectHandler); 
+       }
+
+<?php
+ }
+?>
+</script>
+<?php
+///////////////////////////end of display nodes////////////////////////////////////////////////
+}
+
+?>
+
+
+
+<script type="text/javascript">
+function canvas_arrow(context, fromx, fromy, tox, toy){
+    var headlen = 15;
+    var dx = tox-fromx;
+    var dy = toy-fromy;
+    var angle = Math.atan2(dy,dx);
+    context.moveTo(fromx,fromy);
+    context.lineTo(tox,toy);
+    context.lineTo(tox-headlen*Math.cos(angle-Math.PI/6),toy-headlen*Math.sin(angle-Math.PI/6));
+    context.moveTo(tox,toy);
+    context.lineTo(tox-headlen*Math.cos(angle+Math.PI/6),toy-headlen*Math.sin(angle+Math.PI/6));
+}
+</script>
+
+<script type="text/javascript">
+function canvas_arrow_head(context, fromx, fromy, tox, toy){
+    var headlen = 15;
+    var dx = tox-fromx;
+    var dy = toy-fromy;
+    var angle = Math.atan2(dy,dx);
+    context.moveTo(tox,toy);
+    context.lineTo(tox-headlen*Math.cos(angle-Math.PI/6),toy-headlen*Math.sin(angle-Math.PI/6));
+    context.moveTo(tox,toy);
+    context.lineTo(tox-headlen*Math.cos(angle+Math.PI/6),toy-headlen*Math.sin(angle+Math.PI/6));
+}
+</script>
+
+
+</head>
+
+<body>
+<canvas id="test" width="3000" height="3000" style="position:absolute">
+<script>
+function canvas_arrow_draw(n, polypts,context){
+
+//Create jsGraphics object
+var headlen = 10;
+/*
+var hexno=new String;
+arr=new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f");
+var n1=Math.round(Math.random()*15);
+var n2=Math.round(Math.random()*15);
+var n3=Math.round(Math.random()*15);
+var n4=Math.round(Math.random()*15);
+var n5=Math.round(Math.random()*15);
+var n6=Math.round(Math.random()*15);
+hexno="#"+arr[n1]+""+arr[n2]+""+arr[n3]+""+arr[n4]+""+arr[n5]+""+arr[n6];
+*/
+hexno="black";
+var polypoints = new Array();
+var n2=n*2;
+
+
+var sx=polypts[0];
+var sy=polypts[1];
+ 
+var sx1=polypts[n2-4];
+var sy1=polypts[n2-3];
+var ex1=polypts[n2-2];
+var ey1=polypts[n2-1];
+
+context.beginPath();
+canvas_arrow_head(context,sx1,sy1,ex1,ey1);
+
+context.moveTo(polypts[0],polypts[1]);
+nm=n%3;
+ni=(n-nm)/3;
+
+for(i=0;i<ni;i++)
+{
+  i11=i*6+2;
+  i12=i*6+3;
+  i21=i*6+4;
+  i22=i*6+5;
+  i31=i*6+6;
+  i32=i*6+7;
+
+  context.bezierCurveTo(polypts[i11],polypts[i12],polypts[i21],polypts[i22],polypts[i31],polypts[i32]);
+  context.moveTo(polypts[i31],polypts[i32]);
+
+ // polypoints[i] = new jxPoint(polypts[i1], polypts[i2]);
+}
+
+
+if(nm==2)
+{
+  context.moveTo(polypts[i21],polypts[i22]);
+  context.bezierCurveTo(polypts[i31],polypts[i32],sx1,sy1,ex1,ey1);
+  context.moveTo(ex1,ey1);
+
+}
+
+ context.strokeStyle = hexno;
+ context.stroke();
+
+}
+
+
+var canvas=document.getElementById("test");
+var context = canvas.getContext("2d");
+context.lineWidth = 3;
+
+<?php
+for($i=0;$i<$nedges;$i++)
+{
+
+   $n=$edge_data[$i][4]; 
+   $n2=$n*2;
+   
+?>
+var polypoints = new Array();
+var j=0;
+var n="<?php print($n);?>";
+<?php
+for($j=0;$j<$n2;$j++)
+{
+$inx=$j+5;
+$data=$edge_data[$i][$inx];
+
+?>
+	polypoints[j] = "<?php print($data);?>";
+
+       j++;
+<?php
+}
+?>
+canvas_arrow_draw(n,polypoints,context);
+<?php
+}
+?>
+
+
+
+</script>
+</canvas>
+
+
+<?php 
+for($i=0;$i<$nnode;$i++)
+{
+  $x=$ID_data[$i][1]-8; $y=$ID_data[$i][2]-20;
+  $name=$ID_data[$i][0];
+?>
+
+<script type="text/javascript">
+   google.setOnLoadCallback(draw_<?php print($name)?>);
+</script>
+<div id="<?php print($name)?>" style="left: <?php print($x)?>px; top: <?php print($y)?>px; width:<?php print($width);?>; height:<?php print($hieght);?>; position: absolute"></div>
+
+<?php 
+}
+?>
+
+
+</body>
+
+
+
+</html>
+
diff --git a/sourcecodes/network_layout_inv_2_example.php b/sourcecodes/network_layout_inv_2_example.php
new file mode 100644
index 00000000..3ec0d84c
--- /dev/null
+++ b/sourcecodes/network_layout_inv_2_example.php
@@ -0,0 +1,1154 @@
+<?php 
+include("structuremap.php");
+
+
+function levelmap($inx,$name,$mapdata)
+{
+
+$leve_l=array();
+$leve_l=explode("\n",$mapdata);
+$leve_d=array();
+
+foreach($leve_l as $l)
+{ 
+  $l=trim($l);
+  $leve_d=explode("\t",$l);
+  $inxname=trim($leve_d[0]);
+  $name=trim($name);
+  if($inxname==$name)
+    return $leve_d[$inx];
+}
+           
+}
+
+
+
+$keyval=$_GET["My_key"];
+
+$dir="./data/";
+
+$lfile=$dir.$keyval."nlevels.txt";
+$levelmap=file_get_contents($lfile); 
+///////////////////Search for child nodes////////////////////////////////
+
+function ischild($ev_child_arr,$name)
+{
+  $match=0;
+  $dataname=array();
+  $dataname=explode("|",$ev_child_arr);
+  $n=count($dataname);
+  for($i=0;$i<$n;$i++)
+  {
+
+     if($dataname[$i]==$name)
+     {
+         $match=1;
+         break;
+     
+     }
+
+  } 
+
+  return $match;
+}
+
+
+
+
+//////////////////////////Entered evidences//////////////////////////////////////////
+
+$fl=$dir.$keyval."varname.txt";
+$lines = file("$fl");
+
+$ev_arr=array();
+$ev_arr_tmp=array();
+
+$evdata_arr=array();
+
+$data_cell_ev=array();
+$cev=0;
+
+// Loop through our array, show HTML source as HTML source; and line numbers too.
+foreach ($lines as $line_num => $line) 
+{
+	$data_cell_ev=explode("\t",$line);
+	foreach ($data_cell_ev as $ld)
+	{
+  		$ldd=trim($ld);
+  		if($ldd !="")
+  		{
+        		$ev_arr[$cev]=$ldd;
+                     $ev_arr_tmp[$cev]=$ldd;  
+                     $cev++;
+  			//echo "Line #<b>{$line_num}</b> : " . htmlspecialchars($ldd) . "<br />\n";
+  		}
+	}
+
+}
+//////number of evidence node
+$temp_cev=$cev;
+/////////////////////////////////////
+//$ev_arr[$cev]  evidence array  
+//$cev  number of evidence
+/////////////////////////////////////
+// go through the structure file to pick childern of evidence node 
+//
+////////////////////////////////////
+$matfile=$dir.$keyval."structure_input_new.txt";
+$matrix1=file_get_contents("$matfile");           
+$str_arrmat=array();
+$str_arrmat=explode("\n",$matrix1);
+$datamat=array();
+$data_cell=array(); 
+$col_arr=array();
+$dataname=array();
+$dataname=explode("\t",$str_arrmat[0]);
+$n=count($dataname);
+
+$ev_child_arr="";
+  
+for($ii=0;$ii<$temp_cev;$ii++)
+{
+         $evdname=$ev_arr_tmp[$ii];
+         for($i=1;$i<=$n;$i++)
+         {
+                   $iii=$i-1; 
+                   $row_name=trim($dataname[$iii]);
+           
+                   if($row_name==$evdname)
+                   {
+	                      $col_arr=explode("\t",$str_arrmat[$i]);
+		               for($j=0;$j<$n;$j++)
+	  	               {
+               	           $col_val=trim($col_arr[$j]);
+               	           if($col_val==1)
+               	           { 
+                                       $ddname=trim($dataname[$j]); 
+                                       $pos = strpos($ev_child_arr, $ddname);
+                                       if ($pos === false)
+                                       {
+                                          $ev_arr_tmp[$temp_cev]=$ddname; 
+                                          $temp_cev++;
+                                          $ev_child_arr.="|".$ddname;
+                                       }
+                           
+	        	            }
+          	                }
+
+                   }
+        }        
+     
+} 
+
+
+
+$fl=$dir.$keyval."vardata.txt";
+$linesd = file("$fl");
+$cevdata=0;
+// Loop through our array, show HTML source as HTML source; and line numbers too.
+foreach ($linesd as $line_num => $line) 
+{
+  
+	$data_cell_ev=explode("\t",$line);
+	foreach ($data_cell_ev as $ld)
+	{
+  		$ldd=trim($ld);
+  		if($ldd !="")
+  		{
+        		$evdata_arr[$cevdata]=$ldd;  
+                     $cevdata++;
+                     //echo "Line #<b>{$line_num}</b> : " . htmlspecialchars($ldd) . "<br />\n";
+
+  			
+  		}
+	}
+  
+}
+
+
+
+////////////////////////////////////Read data from net_figure file///////////////////////Graphp Display/////////////////////////////////////////////
+
+
+$matfile=$dir.$keyval."net_figure_new.txt";
+
+$data_val="";
+
+$matrix=file("$matfile");
+$matrix1=file_get_contents("$matfile");              //file("$matfile");
+
+$str_arrmat=array();
+$str_arrmat=explode("\n",$matrix1);
+
+if($str_arrmat[2]=="" || $matrix1=="")
+{
+?>
+<h1><font color=blue>Error: Unable to display your network structure.</font></h1>
+<?php
+exit;
+}
+
+$node=trim($str_arrmat[1]);
+
+
+
+
+
+/*
+if($node<=5)
+{
+  $width=200;
+  $hieght=150;
+  $font=14;
+}
+else if($node>5 && $node<=7)
+{
+  $width=150;
+  $hieght=120;
+  $font=12;
+
+}
+else if($node>7 && $node<=10)
+{
+  $width=110;
+  $hieght=85;
+  $font=10;
+}
+else 
+{
+  $width=80;
+  $hieght=60;
+  $font=8;
+}
+*/
+  $width=150;
+  $hieght=150;
+  $font=12;
+
+
+$datamat=array();
+$data_read=array();
+
+$r_index=$node+3;
+
+for($i=0;$i<$node;$i++)
+{
+$datamat=explode("\t",$str_arrmat[$r_index]);
+$data_read[$i][0]=trim($datamat[0]);  //name
+$data_read[$i][1]=trim($datamat[1]);  //datatype
+$nodetype=$data_read[$i][1];
+$col_in=2;
+$r_index+=4;
+$evd=-9999;
+$name=$data_read[$i][0];
+for($ii=0;$ii<$cev;$ii++)
+{
+     if($ev_arr[$ii]==$name)
+     {
+        $evd=$evdata_arr[$ii]; 
+        if($nodetype>1)
+            $evd=levelmap($evd,$data_read[$i][0],$levelmap);
+
+        break;
+     }
+}
+
+if($evd!=-9999)//with evidence
+{
+           $datamat=explode("\t",$str_arrmat[$r_index]);
+           $data_read[$i][$col_in]=trim($datamat[0]);  //x data
+           $col_in++;
+           $data_read[$i][$col_in]=trim($datamat[1]);  //y data
+           $col_in++;
+           $r_index++; // increment to point next data
+
+      
+}
+else //without evidence
+{
+	if($nodetype==1)  //type=coninuous
+	{
+         for($j=1;$j<=101;$j++)
+         {
+           $datamat=explode("\t",$str_arrmat[$r_index]);
+           $data_read[$i][$col_in]=trim($datamat[0]);  //x data
+ 
+           $col_in++;
+           $data_read[$i][$col_in]=trim($datamat[1]);  //y data
+ 
+           $col_in++;
+           $r_index++; // increment to point next data
+         } 
+	}
+	if($nodetype>1)  //type=descrete
+	{
+         $iter=$datamat[1];
+         for($j=1;$j<=$iter;$j++)
+         {
+           $datamat=explode("\t",$str_arrmat[$r_index]);
+           $data_read[$i][$col_in]=trim($datamat[0]);  //x data
+           $data_read[$i][$col_in]=levelmap($data_read[$i][$col_in],$data_read[$i][0],$levelmap);
+  
+           $col_in++;
+           $data_read[$i][$col_in]=trim($datamat[1]);  //y data
+            $col_in++;
+           $r_index++; // increment to point next data
+         } 
+	}
+
+}
+
+}
+
+
+$matfile_old=$dir.$keyval."net_figure.txt";
+
+$data_val="";
+
+$matrix_old=file("$matfile_old");
+$matrix1_old=file_get_contents("$matfile_old");              //file("$matfile");
+$str_arrmat_old=array();
+$str_arrmat_old=explode("\n",$matrix1_old);
+$datamat_old=array();
+$data_read_old=array();
+$node_old=trim($str_arrmat_old[0]);
+$r_index_old=$node_old+2;
+
+for($i=0;$i<$node_old;$i++)
+{
+	$datamat_old=explode("\t",$str_arrmat_old[$r_index_old]);
+	$data_read_old[$i][0]=trim($datamat_old[0]);  //name
+	$data_read_old[$i][1]=trim($datamat_old[1]);  //datatype
+	$col_in_old=2;
+	$r_index_old+=4;
+	if($datamat_old[1]==1)  //type=coninuous
+	{
+         for($j=1;$j<=101;$j++)
+         {
+           $datamat_old=explode("\t",$str_arrmat_old[$r_index_old]);
+           $data_read_old[$i][$col_in_old]=trim($datamat_old[0]);  //x data
+
+           $col_in_old++;
+           $data_read_old[$i][$col_in_old]=trim($datamat_old[1]);  //y data
+   
+           $col_in_old++;
+           $r_index_old++; // increment to point next data
+
+         } 
+	}
+	if($datamat_old[1]>1)  //type=descrete
+	{
+         $iter=$datamat_old[1];
+         for($j=1;$j<=$iter;$j++)
+         {
+           $datamat_old=explode("\t",$str_arrmat_old[$r_index_old]);
+           $data_read_old[$i][$col_in_old]=trim($datamat_old[0]);  //x data
+           $data_read_old[$i][$col_in_old]=levelmap($data_read_old[$i][$col_in_old],$data_read_old[$i][0],$levelmap);
+           $col_in_old++;
+           $data_read_old[$i][$col_in_old]=trim($datamat_old[1]);  //y data
+           $col_in_old++;
+           $r_index_old++; // increment to point next data
+
+         } 
+	}
+}
+
+
+////////////////////////////////////////////////Graphviz data read////////////////////////////////////////////////////////////////////////////////
+$grv=$dir.$keyval."graphviz_new.txt";
+$line=shell_exec('/usr/bin/dot -Tplain -y '.$grv);
+
+
+
+//$grfilename=$keyval."graphviz.txt";
+//$cmd="/usr/bin/dot -Tplain -y  $grfilename";
+//$line=system($cmd);
+
+
+//shell_exec('/usr/bin/dot -Tpng -o /var/www/html/compbio/BNW/graphviz.png /var/www/html/compbio/BNW/graphviz.txt');
+$str_arrname=array();
+$str_arrname=explode("\n",$line);
+$data=array();
+$ID_data=array();
+$i=0;
+$ii=0;
+foreach($str_arrname as $row)
+{
+  $i++;
+  if($i>1)
+  {
+       
+  	$data=explode(" ",$row);
+       $j=0;
+       $k=0;
+       $flag=0;
+  	foreach($data as $cell)
+	{
+             
+             $j++;
+             
+             $cell=trim($cell);
+             //echo $cell;
+             //echo '&nbsp';
+             if($j==1 && $cell=="node")
+             {
+                $flag=1;
+             }  
+               
+             if($j>1 && $j<5 && $flag==1)
+             {
+    		  //echo $cell;
+   		  //echo '&nbsp';
+                if($j==2)
+                   $ID_data[$ii][$k]=$cell;
+                else
+                   $ID_data[$ii][$k]=round($cell/10*900);
+               // echo $ID_data[$ii][$k];
+                //echo '&nbsp';
+
+                $k++; 
+             }
+       } 
+  
+       if($flag==1)
+       {
+          $ID_data[$ii][3]=$ID_data[$ii][1]+100;
+          $ID_data[$ii][4]=$ID_data[$ii][2]+150; 
+          $ID_data[$ii][5]=$ID_data[$ii][1]+100;
+          $ID_data[$ii][6]=$ID_data[$ii][2]; 
+          $ii++;
+          //echo "<br />"; 
+       } 
+     // echo "<br />"; 
+	
+  }
+}
+
+$nnode=$ii;
+$edge_data=array();
+
+$i=0;
+$ii=0;
+
+foreach($str_arrname as $row)
+{
+  $i++;
+  if($i>1)
+  {
+       
+  	$data=explode(" ",$row);
+       $j=0;
+       
+       $flag=0;
+       $number_of_point=0;
+       $index=0; 
+  	foreach($data as $cell)
+	{
+             $j++;
+             $cell=trim($cell);
+         
+             if($j==1 && $cell=="edge")
+             {
+                $flag=1;
+             }  
+               
+             if($j==2 && $flag==1)
+             {
+                
+                for($k=0;$k<$nnode;$k++)
+                {
+                      if($cell==$ID_data[$k][0])
+                      {
+                          $edge_data[$ii][0]=$ID_data[$k][3];
+                          $edge_data[$ii][1]=$ID_data[$k][4];
+                      }                     
+
+                }
+               
+             }
+             else if($j==3 && $flag==1)
+             {
+               for($k=0;$k<$nnode;$k++)
+                {
+                      if($cell==$ID_data[$k][0])
+                      {
+                          $edge_data[$ii][2]=$ID_data[$k][5];
+                          $edge_data[$ii][3]=$ID_data[$k][6];
+                      }                     
+
+                }
+
+             }
+             else if($j==4 && $flag==1)
+             {
+                  $edge_data[$ii][4]=$cell;
+                  $number_of_point=$cell*2;
+                  $index=5;
+             }
+             else if($j>4 && $number_of_point>0 && $flag==1)
+             {
+                if(($j%2)!=0)
+                  $edge_data[$ii][$index]=round($cell/10*900)+60;//+30+30;
+                else
+                  $edge_data[$ii][$index]=round($cell/10*900)+48;//+18+30;
+
+                $number_of_point--;
+                $index++;
+             }
+
+
+             
+       } 
+       if($flag==1)
+       {
+          $ii++;
+          //echo "<br />"; 
+       } 
+ 	
+  }
+}
+
+
+$nedges=$ii;
+//echo $nedges;
+
+?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
+<script type="text/javascript" src="http://www.google.com/jsapi"></script>
+ <script type="text/javascript">
+  google.load('visualization', '1', {packages: ['corechart']});
+ </script>
+ 
+
+<?php 
+$data_val="";
+
+for($i=0;$i<$nnode;$i++)
+ {
+////////////////////////////select node //////////////////////////////////////
+ $name=$ID_data[$i][0];
+ $fname="draw_".$name."()";
+ $data_val.=$name;
+$flag=0; //evidence flag
+ for($j=0;$j<$node;$j++)
+ {
+    if($data_read[$j][0]==$name)
+    {
+       $s_i=$j;
+       break;
+    } 
+ }
+ for($j=0;$j<$node_old;$j++)
+ {
+    if($data_read_old[$j][0]==$name)
+    {
+       $s_i_old=$j;
+       break;
+    } 
+ }
+ 
+
+/////////////////////////////////Display nodes//////////////////////////////////////////////////////////
+?>    
+ <script type="text/javascript">
+
+
+<?php
+  $node_type=$data_read[$s_i][1];
+  if($node_type>1) //discrete node
+  { 
+?>
+ 
+  function <?php print($fname);?> {
+  // Create and populate the data table.
+ 
+  <?php
+ $evd=-9999;
+  for($ii=0;$ii<$cev;$ii++)
+  {
+     if($ev_arr[$ii]==$name)
+     {
+        $evd=$evdata_arr[$ii]; 
+        $evd=levelmap($evd,$name,$levelmap);
+        $flag=1;
+        break;
+     }
+  }
+if($evd==-9999)
+{
+
+    //$pos = strpos($ev_child_arr,$name);
+    //if ($pos == false)
+    $match=ischild($ev_child_arr,$name);
+    if($match==0)
+    {
+?>
+  var data = google.visualization.arrayToDataTable([
+   ['<?php print($name);?>', 'Old'],
+<?php
+  $c_i=2; 
+  $c_i_old=2;
+  for($j=0;$j<$node_type-1;$j++) 
+  {     
+       $val1=trim($data_read[$s_i][$c_i]);
+      // $val1=map($name,$val1);
+
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;
+
+       $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;        
+  ?>
+   ['<?php print($val1_old);?>', <?php print($val2_old);?>],
+
+  <?php
+  }
+  if($j==$node_type-1)
+  {
+        $val1=trim($data_read[$s_i][$c_i]);
+      // $val1=map($name,$val1);
+
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;
+
+        $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;        
+  ?>
+   ['<?php print($val1_old);?>', <?php print($val2_old);?>]
+<?php
+   }
+ }
+ else 
+ {
+   ?>
+  var data = google.visualization.arrayToDataTable([
+   ['<?php print($name);?>', 'Old', 'New'],
+<?php
+  $c_i=2; 
+  $c_i_old=2;
+  for($j=0;$j<$node_type-1;$j++) 
+  {     
+       $val1=trim($data_read[$s_i][$c_i]);
+      // $val1=map($name,$val1);
+
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;
+
+       $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;        
+  ?>
+   ['<?php print($val1);?>', <?php print($val2_old);?>, <?php print($val2);?>],
+
+  <?php
+  }
+  if($j==$node_type-1)
+  {
+        $val1=trim($data_read[$s_i][$c_i]);
+      // $val1=map($name,$val1);
+
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;
+
+        $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;        
+  ?>
+   ['<?php print($val1);?>', <?php print($val2_old);?>, <?php print($val2);?>]
+<?php
+   }
+  }
+}
+else
+{
+  
+?>
+  var data = google.visualization.arrayToDataTable([
+    ['<?php print($name);?>', 'Old', 'New'],
+
+<?php
+ 
+  $c_i_old=2;
+  for($j=0;$j<$node_type-1;$j++) 
+  {     
+       $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++; 
+       if($val1_old==$evd)       
+       {
+  ?>
+         ['<?php print($val1_old);?>', <?php print($val2_old);?>, 1],
+
+  <?php
+       }
+       else{
+       ?>
+         ['<?php print($val1_old);?>', <?php print($val2_old);?>, 0],
+
+<?php
+         }   
+  }
+  if($j==$node_type-1)
+  {
+       $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;
+      if($val1_old==$evd)       
+       {
+      
+  ?>
+        ['<?php print($val1_old);?>', <?php print($val2_old);?>, 1]
+      <?php
+       } 
+       else{
+       ?>
+        ['<?php print($val1_old);?>', <?php print($val2_old);?>, 0] 
+<?php
+         }  
+  }
+}
+?>
+ ]);
+
+ 
+      
+        // Create and draw the visualization.
+      
+      var cnode="<?php print($name); ?>";
+      var keyv="<?php print($keyval);?>";
+
+    <?php if($evd!=-9999)
+             {
+                $named=$name.":".$evd;
+                $bcolor="red";
+                $font=10;
+             }
+             else
+             {
+                $named=$name;
+                $bcolor="black";
+                $font=12;
+             }
+         ?>  
+
+
+        var chart = new google.visualization.BarChart(document.getElementById('<?php print($name);?>'));
+        function selectHandler() {
+          var selectedItem = chart.getSelection()[0];
+          if (selectedItem) {
+            var topping = data.getValue(selectedItem.row, 0);
+            
+            var s = window.prompt('Selected evidence ' + topping + ' for ' + cnode + '. Enter new evidence ', topping );
+            
+            window.location.href = "add_inv_example.php?name=" + cnode + "&evidence=" + s + "&My_key=" + keyv;
+           
+
+  
+              //alert('The user selected ' + topping + topname);
+          }
+        } 
+         chart.draw(data,
+                 {title:"<?php print($named);?>", titleTextStyle: {fontSize: <?php print($font);?>},
+                  width:<?php print($width);?>, height:<?php print($hieght);?>,
+                  vAxis: {title: "State", textStyle: {fontSize:<?php print($font);?>}},
+		    hAxis: {title: "Fraction", minValue: 0, maxValue: 1, gridlines: {count: 3}}, legend: {position: 'none'},
+                  backgroundColor: {stroke: '<?php print($bcolor);?>', strokeWidth: 5}}
+            );
+        google.visualization.events.addListener(chart, 'select', selectHandler);  
+
+  }
+<?php
+ }
+ else //continuous node
+ {
+?>
+  function <?php print($fname);?> {
+  // Create and populate the data table.
+  <?php
+ $evd=-9999;
+  for($ii=0;$ii<$cev;$ii++)
+  {
+     if($ev_arr[$ii]==$name)
+     {
+        $evd=$evdata_arr[$ii]; 
+        break;
+     }
+  }
+if($evd==-9999)
+{
+
+    //$pos = strpos($ev_child_arr,$name);
+    //if ($pos == false)
+    $match=ischild($ev_child_arr,$name);
+    if($match==0)
+    {
+?>
+  var data = google.visualization.arrayToDataTable([
+   ['<?php print($name);?>', 'Old'],
+<?php
+  $c_i=2;
+  $c_i_old=2;
+  for($j=0;$j<100;$j++) 
+  {
+       $val1=trim($data_read[$s_i][$c_i]);
+       $val1=map($name,$val1,$keyval);
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;         
+
+       $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $val1_old=map($name,$val1_old,$keyval);
+
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++; 
+  ?>
+   ['<?php print($val1_old);?>', <?php print($val2_old);?>],
+
+  <?php
+  }
+  if($j==100)
+  {
+        $val1=trim($data_read[$s_i][$c_i]);
+       $val1=map($name,$val1,$keyval);
+
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;
+
+       $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $val1_old=map($name,$val1_old,$keyval);
+  
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;   
+  ?>
+   ['<?php print($val1_old);?>', <?php print($val2_old);?>]
+
+
+<?php 
+     }
+    }
+    else 
+    {
+
+?>
+  var data = google.visualization.arrayToDataTable([
+   ['<?php print($name);?>', 'Old', 'New'],
+<?php
+  $c_i=2;
+  $c_i_old=2;
+  for($j=0;$j<100;$j++) 
+  {
+       $val1=trim($data_read[$s_i][$c_i]);
+       $val1=map($name,$val1,$keyval);
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;         
+
+       $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++; 
+  ?>
+   ['<?php print($val1);?>', <?php print($val2_old);?>, <?php print($val2);?>],
+
+  <?php
+  }
+  if($j==100)
+  {
+        $val1=trim($data_read[$s_i][$c_i]);
+       $val1=map($name,$val1,$keyval);
+
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;
+
+       $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;   
+  ?>
+   ['<?php print($val1);?>', <?php print($val2_old);?>, <?php print($val2);?>]
+<?php
+   }
+  }
+}
+else
+{
+    $evd=map($name,$evd,$keyval);
+    $evduse=$evd;
+?>
+  var data = google.visualization.arrayToDataTable([
+    ['<?php print($name);?>', 'Old', 'New'],
+
+<?php
+ 
+  $c_i_old=2;
+  for($j=0;$j<100;$j++) 
+  {     
+       $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $val1_old=map($name,$val1_old,$keyval);
+
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++; 
+       if($val1_old<$evduse)  
+       {
+       ?>
+         ['<?php print($val1_old);?>', <?php print($val2_old);?>, 0],
+<?php
+       }
+       else if($val1_old>=$evduse) 
+       {
+        $evduse=99999;
+       ?>
+       ['<?php print($val1_old);?>', <?php print($val2_old);?>, 1],
+     
+       <?php
+       } 
+ }
+  if($j==100)
+  {
+       $val1_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $val1_old=map($name,$val1_old,$keyval);
+       $c_i_old++;
+       $val2_old=trim($data_read_old[$s_i_old][$c_i_old]);
+       $c_i_old++;
+      
+  ?>
+        ['<?php print($val1_old);?>', <?php print($val2_old);?>, 0]
+ 
+<?php
+  }
+}
+?>
+ ]);
+      
+        // Create and draw the visualization.
+      var cnode="<?php print($name); ?>";
+      var keyv="<?php print($keyval);?>";
+     <?php if($evd!=-9999)
+             {
+                $named=$name.":".$evd;
+                $bcolor="red";
+                $font=10;
+             }
+             else
+             {
+                $named=$name;
+                $bcolor="black";
+                $font=12;
+             }
+       ?>  
+        var chart = new google.visualization.LineChart(document.getElementById('<?php print($name);?>'));
+
+        function selectHandler() {
+          var selectedItem = chart.getSelection()[0];
+          if (selectedItem) {
+           
+            var topping = data.getValue(selectedItem.row, 0);
+            var s = window.prompt('Selected evidence ' + topping + ' for ' + cnode + '. Enter new evidence ', topping );
+            window.location.href = "add_inv_example.php?name=" + cnode + "&evidence=" + s + "&My_key=" + keyv;  
+
+          }
+        }
+            chart.draw(data, {curveType: "function",
+                  title:"<?php print($named);?>", titleTextStyle: {fontSize: <?php print($font);?>},
+			legend: {position: 'none'},
+                  width:<?php print($width);?>, height:<?php print($hieght);?>,
+                  hAxis: {maxValue: 1, minValue: 0},
+			vAxis: {maxValue: 1, minValue: 0},
+                  backgroundColor: {stroke: '<?php print($bcolor);?>', strokeWidth: 5}}
+            );
+           google.visualization.events.addListener(chart, 'select', selectHandler); 
+       }
+
+<?php
+ }
+?>
+</script>
+<?php
+///////////////////////////end of display nodes////////////////////////////////////////////////
+}
+
+?>
+
+
+
+<script type="text/javascript">
+function canvas_arrow(context, fromx, fromy, tox, toy){
+    var headlen = 15;
+    var dx = tox-fromx;
+    var dy = toy-fromy;
+    var angle = Math.atan2(dy,dx);
+    context.moveTo(fromx,fromy);
+    context.lineTo(tox,toy);
+    context.lineTo(tox-headlen*Math.cos(angle-Math.PI/6),toy-headlen*Math.sin(angle-Math.PI/6));
+    context.moveTo(tox,toy);
+    context.lineTo(tox-headlen*Math.cos(angle+Math.PI/6),toy-headlen*Math.sin(angle+Math.PI/6));
+}
+</script>
+
+<script type="text/javascript">
+function canvas_arrow_head(context, fromx, fromy, tox, toy){
+    var headlen = 15;
+    var dx = tox-fromx;
+    var dy = toy-fromy;
+    var angle = Math.atan2(dy,dx);
+    context.moveTo(tox,toy);
+    context.lineTo(tox-headlen*Math.cos(angle-Math.PI/6),toy-headlen*Math.sin(angle-Math.PI/6));
+    context.moveTo(tox,toy);
+    context.lineTo(tox-headlen*Math.cos(angle+Math.PI/6),toy-headlen*Math.sin(angle+Math.PI/6));
+}
+</script>
+
+
+</head>
+
+<body>
+<canvas id="test" width="3000" height="3000" style="position:absolute">
+<script>
+function canvas_arrow_draw(n, polypts,context){
+
+//Create jsGraphics object
+var headlen = 10;
+/*
+var hexno=new String;
+arr=new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f");
+var n1=Math.round(Math.random()*15);
+var n2=Math.round(Math.random()*15);
+var n3=Math.round(Math.random()*15);
+var n4=Math.round(Math.random()*15);
+var n5=Math.round(Math.random()*15);
+var n6=Math.round(Math.random()*15);
+hexno="#"+arr[n1]+""+arr[n2]+""+arr[n3]+""+arr[n4]+""+arr[n5]+""+arr[n6];
+*/
+hexno="black";
+var polypoints = new Array();
+var n2=n*2;
+
+
+var sx=polypts[0];
+var sy=polypts[1];
+ 
+var sx1=polypts[n2-4];
+var sy1=polypts[n2-3];
+var ex1=polypts[n2-2];
+var ey1=polypts[n2-1];
+
+context.beginPath();
+canvas_arrow_head(context,sx1,sy1,ex1,ey1);
+
+context.moveTo(polypts[0],polypts[1]);
+nm=n%3;
+ni=(n-nm)/3;
+
+for(i=0;i<ni;i++)
+{
+  i11=i*6+2;
+  i12=i*6+3;
+  i21=i*6+4;
+  i22=i*6+5;
+  i31=i*6+6;
+  i32=i*6+7;
+
+  context.bezierCurveTo(polypts[i11],polypts[i12],polypts[i21],polypts[i22],polypts[i31],polypts[i32]);
+  context.moveTo(polypts[i31],polypts[i32]);
+
+ // polypoints[i] = new jxPoint(polypts[i1], polypts[i2]);
+}
+
+
+if(nm==2)
+{
+  context.moveTo(polypts[i21],polypts[i22]);
+  context.bezierCurveTo(polypts[i31],polypts[i32],sx1,sy1,ex1,ey1);
+  context.moveTo(ex1,ey1);
+
+}
+
+ context.strokeStyle = hexno;
+ context.stroke();
+
+}
+
+
+var canvas=document.getElementById("test");
+var context = canvas.getContext("2d");
+context.lineWidth = 3;
+
+<?php
+for($i=0;$i<$nedges;$i++)
+{
+
+   $n=$edge_data[$i][4]; 
+   $n2=$n*2;
+   
+?>
+var polypoints = new Array();
+var j=0;
+var n="<?php print($n);?>";
+<?php
+for($j=0;$j<$n2;$j++)
+{
+$inx=$j+5;
+$data=$edge_data[$i][$inx];
+
+?>
+	polypoints[j] = "<?php print($data);?>";
+
+       j++;
+<?php
+}
+?>
+canvas_arrow_draw(n,polypoints,context);
+<?php
+}
+?>
+
+
+
+</script>
+</canvas>
+
+
+<?php 
+for($i=0;$i<$nnode;$i++)
+{
+  $x=$ID_data[$i][1]-8; $y=$ID_data[$i][2]-20;
+  $name=$ID_data[$i][0];
+?>
+
+<script type="text/javascript">
+   google.setOnLoadCallback(draw_<?php print($name)?>);
+</script>
+<div id="<?php print($name)?>" style="left: <?php print($x)?>px; top: <?php print($y)?>px; width:<?php print($width);?>; height:<?php print($hieght);?>; position: absolute"></div>
+
+<?php 
+}
+?>
+
+
+</body>
+
+
+
+</html>
+
diff --git a/sourcecodes/network_layout_inv_example.php b/sourcecodes/network_layout_inv_example.php
new file mode 100644
index 00000000..1e5cd51b
--- /dev/null
+++ b/sourcecodes/network_layout_inv_example.php
@@ -0,0 +1,657 @@
+<?php 
+include("structuremap.php");
+
+function levelmap($inx,$name,$mapdata)
+{
+
+$leve_l=array();
+$leve_l=explode("\n",$mapdata);
+$leve_d=array();
+
+foreach($leve_l as $l)
+{ 
+  $l=trim($l);
+  $leve_d=explode("\t",$l);
+  $inxname=trim($leve_d[0]);
+  $name=trim($name);
+  if($inxname==$name)
+    return $leve_d[$inx];
+}
+           
+}
+
+////////////////////////////////////Read data from net_figure file///////////////////////Graphp Display/////////////////////////////////////////////
+
+$keyval=$_GET["My_key"];
+$dir="./data/";
+
+$lfile=$dir.$keyval."nlevels.txt";
+$levelmap=file_get_contents($lfile);   
+
+
+
+
+$matfile=$dir."$keyval"."net_figure.txt";
+
+
+$data_val="";
+
+$matrix=file("$matfile");
+$matrix1=file_get_contents("$matfile");              //file("$matfile");
+
+$str_arrmat=array();
+$str_arrmat=explode("\n",$matrix1);
+
+
+if($str_arrmat[2]=="" || $matrix1=="")
+{
+?>
+<h1><font color=blue>Error: Unable to display your network structure.</font></h1>
+
+<?php
+exit;
+}
+
+$datamat=array();
+$data_read=array();
+ 
+$node=trim($str_arrmat[0]);
+/*
+if($node<=5)
+{
+  $width=200;
+  $hieght=150;
+  $font=14;
+}
+else if($node>5 && $node<=7)
+{
+  $width=150;
+  $hieght=120;
+  $font=12;
+
+}
+else if($node>7 && $node<=10)
+{
+  $width=110;
+  $hieght=85;
+  $font=10;
+}
+else 
+{
+  $width=80;
+  $hieght=60;
+  $font=8;
+}
+*/
+  $width=150;
+  $hieght=150;
+  $font=12;
+
+$r_index=$node+2;
+
+for($i=0;$i<$node;$i++)
+{
+$datamat=explode("\t",$str_arrmat[$r_index]);
+$data_read[$i][0]=trim($datamat[0]);  //name
+$data_read[$i][1]=trim($datamat[1]);  //datatype
+$col_in=2;
+$r_index+=4;
+	if($datamat[1]==1)  //type=coninuous
+	{
+         for($j=1;$j<=101;$j++)
+         {
+           $datamat=explode("\t",$str_arrmat[$r_index]);
+           $data_read[$i][$col_in]=trim($datamat[0]);  //x data
+         //  echo $data_read[$i][$col_in];
+          // echo '&nbsp';
+
+           $col_in++;
+           $data_read[$i][$col_in]=trim($datamat[1]);  //y data
+          // echo $data_read[$i][$col_in];
+	   // echo '&nbsp';
+
+           $col_in++;
+           $r_index++; // increment to point next data
+           // echo "<br />"; 
+         } 
+	}
+	if($datamat[1]>1)  //type=descrete
+	{
+         $iter=$datamat[1];
+         for($j=1;$j<=$iter;$j++)
+         {
+           $datamat=explode("\t",$str_arrmat[$r_index]);
+           $data_read[$i][$col_in]=trim($datamat[0]);  //x data
+           $data_read[$i][$col_in]=levelmap($data_read[$i][$col_in],$data_read[$i][0],$levelmap);
+
+         //  echo $data_read[$i][$col_in];
+          // echo '&nbsp';
+  
+           $col_in++;
+           $data_read[$i][$col_in]=trim($datamat[1]);  //y data
+          // echo $data_read[$i][$col_in];
+           //echo '&nbsp';
+
+           $col_in++;
+           $r_index++; // increment to point next data
+           //echo "<br />"; 
+         } 
+	}
+
+}
+
+
+
+
+////////////////////////////////////////////////Graphviz data read////////////////////////////////////////////////////////////////////////////////
+$grv=$dir.$keyval."graphviz.txt";
+$line=shell_exec('/usr/bin/dot -Tplain -y '.$grv);
+
+
+//$grfilename=$keyval."graphviz.txt";
+//$cmd="/usr/bin/dot -Tplain -y  $grfilename";
+//$line=system($cmd);
+
+
+//shell_exec('/usr/bin/dot -Tpng -o /var/www/html/compbio/BNW/graphviz.png /var/www/html/compbio/BNW/graphviz.txt');
+$str_arrname=array();
+$str_arrname=explode("\n",$line);
+$data=array();
+$ID_data=array();
+$i=0;
+$ii=0;
+foreach($str_arrname as $row)
+{
+  $i++;
+  if($i>1)
+  {
+       
+  	$data=explode(" ",$row);
+       $j=0;
+       $k=0;
+       $flag=0;
+  	foreach($data as $cell)
+	{
+             
+             $j++;
+             
+             $cell=trim($cell);
+             //echo $cell;
+             //echo '&nbsp';
+             if($j==1 && $cell=="node")
+             {
+                $flag=1;
+             }  
+               
+             if($j>1 && $j<5 && $flag==1)
+             {
+    		  //echo $cell;
+   		  //echo '&nbsp';
+                if($j==2)
+                   $ID_data[$ii][$k]=$cell;
+                else
+                   $ID_data[$ii][$k]=round($cell/10*900);
+               // echo $ID_data[$ii][$k];
+                //echo '&nbsp';
+
+                $k++; 
+             }
+       } 
+  
+       if($flag==1)
+       {
+          $ID_data[$ii][3]=$ID_data[$ii][1]+100;
+          $ID_data[$ii][4]=$ID_data[$ii][2]+150; 
+          $ID_data[$ii][5]=$ID_data[$ii][1]+100;
+          $ID_data[$ii][6]=$ID_data[$ii][2]; 
+          $ii++;
+          //echo "<br />"; 
+       } 
+     // echo "<br />"; 
+	
+  }
+}
+
+$nnode=$ii;
+$edge_data=array();
+
+$i=0;
+$ii=0;
+
+foreach($str_arrname as $row)
+{
+  $i++;
+  if($i>1)
+  {
+       
+  	$data=explode(" ",$row);
+       $j=0;
+       
+       $flag=0;
+       $number_of_point=0;
+       $index=0; 
+  	foreach($data as $cell)
+	{
+             $j++;
+             $cell=trim($cell);
+         
+             if($j==1 && $cell=="edge")
+             {
+                $flag=1;
+             }  
+               
+             if($j==2 && $flag==1)
+             {
+                
+                for($k=0;$k<$nnode;$k++)
+                {
+                      if($cell==$ID_data[$k][0])
+                      {
+                          $edge_data[$ii][0]=$ID_data[$k][3];
+                          $edge_data[$ii][1]=$ID_data[$k][4];
+                      }                     
+
+                }
+               
+             }
+             else if($j==3 && $flag==1)
+             {
+               for($k=0;$k<$nnode;$k++)
+                {
+                      if($cell==$ID_data[$k][0])
+                      {
+                          $edge_data[$ii][2]=$ID_data[$k][5];
+                          $edge_data[$ii][3]=$ID_data[$k][6];
+                      }                     
+
+                }
+
+             }
+             else if($j==4 && $flag==1)
+             {
+                  $edge_data[$ii][4]=$cell;
+                  $number_of_point=$cell*2;
+                  $index=5;
+             }
+             else if($j>4 && $number_of_point>0 && $flag==1)
+             {
+                if(($j%2)!=0)
+                  $edge_data[$ii][$index]=round($cell/10*900)+60;//+30+30;
+                else
+                  $edge_data[$ii][$index]=round($cell/10*900)+48;//+18+30;
+
+                $number_of_point--;
+                $index++;
+             }
+
+
+             
+       } 
+       if($flag==1)
+       {
+          $ii++;
+          //echo "<br />"; 
+       } 
+ 	
+  }
+}
+
+
+$nedges=$ii;
+
+?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
+<script type="text/javascript" src="http://www.google.com/jsapi"></script>
+ <script type="text/javascript">
+  google.load('visualization', '1', {packages: ['corechart']});
+ </script>
+ 
+
+<?php 
+$data_val="";
+
+for($i=0;$i<$nnode;$i++)
+ {
+////////////////////////////select node //////////////////////////////////////
+ $name=$ID_data[$i][0];
+ $fname="draw_".$name."()";
+ $data_val.=$name;
+ for($j=0;$j<$node;$j++)
+ {
+    if($data_read[$j][0]==$name)
+    {
+       $s_i=$j;
+       break;
+    } 
+ }
+ 
+/////////////////////////////////Display nodes//////////////////////////////////////////////////////////
+?>    
+ <script type="text/javascript">
+
+
+<?php
+  $node_type=$data_read[$s_i][1];
+  if($node_type>1) //discrete node
+  { 
+?>
+  
+ 
+  function <?php print($fname);?> {
+  // Create and populate the data table.
+ 
+  var data = google.visualization.arrayToDataTable([
+   ['<?php print($name);?>', ''],
+  <?php
+  $c_i=2; 
+
+  for($j=0;$j<$node_type-1;$j++) 
+  {     
+       $val1=trim($data_read[$s_i][$c_i]);
+
+
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;
+       $data_val.="\t".$val2;
+        
+  ?>
+   ['<?php print($val1);?>', <?php print($val2);?>],
+
+  <?php
+  }
+  if($j==$node_type-1)
+  {
+        $val1=trim($data_read[$s_i][$c_i]);
+
+
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;
+       $data_val.="\t".$val2."\n";
+  ?> 
+    ['<?php print($val1);?>', <?php print($val2);?>]
+<?php
+  }
+?>
+  ]);
+      
+        // Create and draw the visualization.
+      
+      var cnode="<?php print($name); ?>";
+       var keyv="<?php print($keyval);?>";  
+        var chart = new google.visualization.BarChart(document.getElementById('<?php print($name);?>'));
+        function selectHandler() {
+          var selectedItem = chart.getSelection()[0];
+          if (selectedItem) {
+            var topping = data.getValue(selectedItem.row, 0);
+            
+            var s = window.prompt('Selected evidence ' + topping + ' for ' + cnode + '. Enter new evidence ', topping );
+           
+            window.location.href = "add_inv_example.php?name=" + cnode + "&evidence=" + s + "&My_key=" + keyv;
+           
+
+  
+              //alert('The user selected ' + topping + topname);
+          }
+        } 
+         chart.draw(data,
+                 {title:"<?php print($name);?>", titleTextStyle: {fontSize: <?php print($font);?>},
+                  width:<?php print($width);?>, height:<?php print($hieght);?>,
+                  vAxis: {title: "State", textStyle: {fontSize:<?php print($font);?>}},
+		    hAxis: {title: "Fraction", minValue: 0, maxValue: 1, gridlines: {count: 3}}, legend: {position: 'none'},
+                  backgroundColor: {stroke: 'black', strokeWidth: 5}}
+            );
+        google.visualization.events.addListener(chart, 'select', selectHandler);  
+
+  }
+<?php
+ }
+ else //continuous node
+ {
+?>
+  function <?php print($fname);?> {
+  // Create and populate the data table.
+  var data = google.visualization.arrayToDataTable([
+   ['<?php print($name);?>', ''],
+  <?php
+  $c_i=2;
+  for($j=0;$j<100;$j++) 
+  {
+       $val1=trim($data_read[$s_i][$c_i]);
+       $val1=map($name,$val1,$keyval);
+
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;         
+       $data_val.="\t".$val2;
+  ?>
+   ['<?php print($val1);?>', <?php print($val2);?>],
+
+  <?php
+  }
+  if($j==100)
+  {
+       $val1=trim($data_read[$s_i][$c_i]);
+       $val1=map($name,$val1,$keyval);
+
+       $c_i++;
+       $val2=trim($data_read[$s_i][$c_i]);
+       $c_i++;
+       $data_val.="\t".$val2."\n";
+  ?> 
+    ['<?php print($val1);?>', <?php print($val2);?>]
+<?php
+  }
+?>
+  ]);
+      
+        // Create and draw the visualization.
+      var cnode="<?php print($name); ?>";
+      var keyv="<?php print($keyval);?>";
+
+        var chart = new google.visualization.LineChart(document.getElementById('<?php print($name);?>'));
+
+        function selectHandler() {
+          var selectedItem = chart.getSelection()[0];
+          if (selectedItem) {
+           
+            var topping = data.getValue(selectedItem.row, 0);
+            var s = window.prompt('Selected evidence ' + topping + ' for ' + cnode + '. Enter new evidence ', topping );
+            window.location.href = "add_inv_example.php?name=" + cnode + "&evidence=" + s + "&My_key=" + keyv;  
+
+          }
+        }
+            chart.draw(data, {curveType: "function",
+                  title:"<?php print($name);?>", titleTextStyle: {fontSize: <?php print($font);?>},
+			legend: {position: 'none'},
+                  width:<?php print($width);?>, height:<?php print($hieght);?>,
+                  hAxis: {maxValue: 1, minValue: 0},
+			vAxis: {maxValue: 1, minValue: 0},
+                  backgroundColor: {stroke: 'black', strokeWidth: 5}}
+            );
+           google.visualization.events.addListener(chart, 'select', selectHandler); 
+       }
+
+<?php
+ }
+?>
+</script>
+<?php
+///////////////////////////end of display nodes////////////////////////////////////////////////
+}
+
+
+///////////////////////////////////write data to file///////////////////////////////////////////////////////////
+
+
+?>
+
+
+
+<script type="text/javascript">
+function canvas_arrow(context, fromx, fromy, tox, toy){
+    var headlen = 15;
+    var dx = tox-fromx;
+    var dy = toy-fromy;
+    var angle = Math.atan2(dy,dx);
+    context.moveTo(fromx,fromy);
+    context.lineTo(tox,toy);
+    context.lineTo(tox-headlen*Math.cos(angle-Math.PI/6),toy-headlen*Math.sin(angle-Math.PI/6));
+    context.moveTo(tox,toy);
+    context.lineTo(tox-headlen*Math.cos(angle+Math.PI/6),toy-headlen*Math.sin(angle+Math.PI/6));
+}
+</script>
+
+<script type="text/javascript">
+function canvas_arrow_head(context, fromx, fromy, tox, toy){
+    var headlen = 15;
+    var dx = tox-fromx;
+    var dy = toy-fromy;
+    var angle = Math.atan2(dy,dx);
+    context.moveTo(tox,toy);
+    context.lineTo(tox-headlen*Math.cos(angle-Math.PI/6),toy-headlen*Math.sin(angle-Math.PI/6));
+    context.moveTo(tox,toy);
+    context.lineTo(tox-headlen*Math.cos(angle+Math.PI/6),toy-headlen*Math.sin(angle+Math.PI/6));
+}
+</script>
+
+
+</head>
+
+<body>
+<canvas id="test" width="3000" height="3000" style="position:absolute">
+<script>
+function canvas_arrow_draw(n, polypts,context){
+
+//Create jsGraphics object
+var headlen = 10;
+/*
+var hexno=new String;
+arr=new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f");
+var n1=Math.round(Math.random()*15);
+var n2=Math.round(Math.random()*15);
+var n3=Math.round(Math.random()*15);
+var n4=Math.round(Math.random()*15);
+var n5=Math.round(Math.random()*15);
+var n6=Math.round(Math.random()*15);
+hexno="#"+arr[n1]+""+arr[n2]+""+arr[n3]+""+arr[n4]+""+arr[n5]+""+arr[n6];
+*/
+hexno="black";
+var polypoints = new Array();
+var n2=n*2;
+
+
+var sx=polypts[0];
+var sy=polypts[1];
+ 
+var sx1=polypts[n2-4];
+var sy1=polypts[n2-3];
+var ex1=polypts[n2-2];
+var ey1=polypts[n2-1];
+
+context.beginPath();
+canvas_arrow_head(context,sx1,sy1,ex1,ey1);
+
+context.moveTo(polypts[0],polypts[1]);
+nm=n%3;
+ni=(n-nm)/3;
+
+for(i=0;i<ni;i++)
+{
+  i11=i*6+2;
+  i12=i*6+3;
+  i21=i*6+4;
+  i22=i*6+5;
+  i31=i*6+6;
+  i32=i*6+7;
+
+  context.bezierCurveTo(polypts[i11],polypts[i12],polypts[i21],polypts[i22],polypts[i31],polypts[i32]);
+  context.moveTo(polypts[i31],polypts[i32]);
+
+ // polypoints[i] = new jxPoint(polypts[i1], polypts[i2]);
+}
+
+
+if(nm==2)
+{
+  context.moveTo(polypts[i21],polypts[i22]);
+  context.bezierCurveTo(polypts[i31],polypts[i32],sx1,sy1,ex1,ey1);
+  context.moveTo(ex1,ey1);
+
+}
+
+ context.strokeStyle = hexno;
+ context.stroke();
+
+}
+
+
+var canvas=document.getElementById("test");
+var context = canvas.getContext("2d");
+context.lineWidth = 3;
+
+<?php
+for($i=0;$i<$nedges;$i++)
+{
+
+   $n=$edge_data[$i][4]; 
+   $n2=$n*2;
+   
+?>
+var polypoints = new Array();
+var j=0;
+var n="<?php print($n);?>";
+<?php
+for($j=0;$j<$n2;$j++)
+{
+$inx=$j+5;
+$data=$edge_data[$i][$inx];
+
+?>
+	polypoints[j] = "<?php print($data);?>";
+
+       j++;
+<?php
+}
+?>
+canvas_arrow_draw(n,polypoints,context);
+<?php
+}
+?>
+
+
+
+</script>
+</canvas>
+
+
+<?php 
+for($i=0;$i<$nnode;$i++)
+{
+  $x=$ID_data[$i][1]-8; $y=$ID_data[$i][2]-20; 
+
+  $name=$ID_data[$i][0];
+?>
+
+<script type="text/javascript">
+   google.setOnLoadCallback(draw_<?php print($name)?>);
+</script>
+<div id="<?php print($name)?>" style="left: <?php print($x)?>px; top: <?php print($y)?>px; width:<?php print($width);?>; height:<?php print($hieght);?>; position: absolute"></div>
+
+<?php 
+}
+?>
+
+
+</body>
+
+
+
+</html>
+
+
diff --git a/sourcecodes/network_score b/sourcecodes/network_score
new file mode 100644
index 00000000..2fc22d5a
--- /dev/null
+++ b/sourcecodes/network_score
Binary files differdiff --git a/sourcecodes/print_structure/index.html b/sourcecodes/print_structure/index.html
new file mode 100644
index 00000000..429668c7
--- /dev/null
+++ b/sourcecodes/print_structure/index.html
@@ -0,0 +1,6 @@
+<html>
+<head>
+<title>Bayesian Network Web Server</title>
+<meta HTTP-EQUIV="REFRESH" content="0; url=http://compbio.uthsc.edu/BNW/sourcecodes/home.php">
+</head>
+</html>
diff --git a/sourcecodes/print_structure/structure.c b/sourcecodes/print_structure/structure.c
new file mode 100644
index 00000000..cc893a35
--- /dev/null
+++ b/sourcecodes/print_structure/structure.c
@@ -0,0 +1,97 @@
+#include<stdio.h>
+#include<stdlib.h>
+#include<string.h>
+#include<math.h>
+
+struct st{
+char *name;	
+double *data;	
+}*st_tab;
+
+main(int argc,char *argv[])
+{
+FILE *fp1,*fp2,*fp3;
+char line[2500];
+int i,j,rd;
+double d,row;
+double thr=atof(argv[5]);
+
+fp1=fopen(argv[2],"r");
+fp2=fopen(argv[3],"w");
+
+fp3=fopen(argv[4],"w");
+
+
+row=0.0;
+while(fgets(line,2500,fp1)!=NULL)
+   row++;
+
+rd=(int)sqrt(row);
+
+printf("%d\n",rd);
+
+fclose(fp1);
+fp1=fopen(argv[1],"r");
+
+st_tab=(struct st *)malloc(sizeof(struct st)*rd);
+
+for(i=0;i<rd;i++)
+{
+   fscanf(fp1,"%s",line);	
+   st_tab[i].name=(char *)malloc(sizeof(char)*(sizeof(line)+1));
+   strcpy(st_tab[i].name,line);
+   st_tab[i].data=(double *)calloc(rd,sizeof(double));
+}
+
+fclose(fp1);
+fp1=fopen(argv[2],"r");
+
+for(i=0;i<rd;i++)
+{
+    for(j=0;j<rd;j++)
+    {
+          fscanf(fp1,"%s",line);
+	   fscanf(fp1,"%s",line);
+	   fscanf(fp1,"%s",line);		
+   	   fscanf(fp1,"%lf",&d);
+          st_tab[i].data[j]=d;
+    
+    }
+}
+
+/*
+for(i=0;i<rd;i++)
+{
+    for(j=0;j<rd;j++)
+    {
+         if(st_tab[i].data[j]>=st_tab[j].data[i])
+                 st_tab[j].data[i]=0.0;
+    
+    }
+}
+*/
+
+for(i=0;i<rd;i++)
+{ 
+    fprintf(fp2,"%s\t",st_tab[i].name);
+    fprintf(fp3,"%s\t",st_tab[i].name);
+}
+
+fprintf(fp2,"\n");
+fprintf(fp3,"\n");
+
+for(i=0;i<rd;i++)
+{ 
+    for(j=0;j<rd;j++)
+    {
+   	   fprintf(fp2,"%lf\t",st_tab[j].data[i]);
+          if(st_tab[j].data[i]>thr)	
+   	     fprintf(fp3,"1\t");
+          else 	
+   	     fprintf(fp3,"0\t");
+    }
+    fprintf(fp2,"\n");
+    fprintf(fp3,"\n");
+}
+
+}
diff --git a/sourcecodes/restructuremap.php b/sourcecodes/restructuremap.php
new file mode 100644
index 00000000..fb2a86cc
--- /dev/null
+++ b/sourcecodes/restructuremap.php
@@ -0,0 +1,42 @@
+<?php
+
+
+function reversemap($id,$val,$keyval)
+{
+
+$dir="./data/";
+
+$matfile=$dir."$keyval"."map.txt";
+
+
+$matrix=file("$matfile");
+$matrix1=file_get_contents("$matfile");             
+$str_arrmat=array();
+$str_arrmat=explode("\n",$matrix1);
+$datamat=array();
+$data_cell=array(); 
+
+$data_cell_canvas=array();
+
+foreach($str_arrmat as $line)
+{
+
+$data_cell_canvas=explode("\t",$line);
+$map_name=trim($data_cell_canvas[0]);
+$map_type=$data_cell_canvas[1];
+$map_std=$data_cell_canvas[2];
+$map_mean=$data_cell_canvas[3];
+if($id==$map_name)
+{
+ $mapval=($val-$map_mean)/$map_std;
+  break;
+}
+
+}
+return $mapval;
+}
+
+
+
+?>
+
diff --git a/sourcecodes/run.sh b/sourcecodes/run.sh
new file mode 100644
index 00000000..95e5f417
--- /dev/null
+++ b/sourcecodes/run.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+d=`dirname $0`
+#ess=1
+DIR="$d/data/$1"
+DIR_1="$d/data/$1/"
+
+mkdir -p $DIR
+
+maxparent=$2
+k=$3
+THR=$4
+
+./network_score $d/data/$1continuous_input.txt $d/data/$1ban.txt $d/data/$1white.txt $maxparent $DIR
+
+$d/k-best/src/data2netk_poster.sh $d/data/$1continuous_input.txt $DIR $k $maxparent
+
+./structure $d/data/$1continuous_input.txt $DIR/postProbEachEdge.txt $d/data/$1structure_input_temp.txt $d/data/$1structure_input.txt $THR
+
+rm -r $DIR_1*
+rmdir $DIR
diff --git a/sourcecodes/runmat.sh b/sourcecodes/runmat.sh
new file mode 100644
index 00000000..948bdac3
--- /dev/null
+++ b/sourcecodes/runmat.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+cd ./data/
+
+chmod 0774 $1run_initialstructure.sh
+
+./$1run_initialstructure.sh /usr/local/MATLAB/R2012a/
\ No newline at end of file
diff --git a/sourcecodes/runmat_evd.sh b/sourcecodes/runmat_evd.sh
new file mode 100644
index 00000000..68f30ca5
--- /dev/null
+++ b/sourcecodes/runmat_evd.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+cd ./data/
+chmod 0774 $1run_evidencemodified.sh
+./$1run_evidencemodified.sh /usr/local/MATLAB/R2012a/
\ No newline at end of file
diff --git a/sourcecodes/runmat_inv.sh b/sourcecodes/runmat_inv.sh
new file mode 100644
index 00000000..1368b423
--- /dev/null
+++ b/sourcecodes/runmat_inv.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+cd ./data/
+chmod 0774 $1run_newintervention.sh
+./$1run_newintervention.sh /usr/local/MATLAB/R2012a/
\ No newline at end of file
diff --git a/sourcecodes/runtime_check.php b/sourcecodes/runtime_check.php
new file mode 100644
index 00000000..439a0b14
--- /dev/null
+++ b/sourcecodes/runtime_check.php
@@ -0,0 +1,63 @@
+<?php
+//This code calculates execution time of BNW for input parametrs
+function exe_time($keyval,$parent_number,$k_number)
+{
+
+$dir="./data/";
+
+$nrf = $dir.$keyval."nrows.txt";
+$nrows=trim(file_get_contents("$nrf"));
+
+fwrite($fprows,"$lc\n");
+
+$nf=$dir.$keyval."nnode.txt";
+$node=trim(file_get_contents("$nf"))-1;
+$parent_number=$parent_number-1;
+if($parent_number>$node)
+{
+  $parent_number=$node;
+}     
+
+
+$paent="maxparent_table.txt";
+$max_parent=file_get_contents("$paent");
+
+
+$max_parent_row=array();
+$max_parent_row=explode("\n",$max_parent);
+
+$max_parent_data=array();
+$max_parent_data=explode("\t",$max_parent_row[$node]);
+$local=$max_parent_data[$parent_number];
+
+
+$k_n="k_only_table.txt";
+$k_p=file_get_contents("$k_n");
+
+$k_row=array();
+$k_row=explode("\n",$k_p);
+
+$k_data=array();
+$k_data=explode("\t",$k_row[$node]);
+if($k_number==1)
+  $k_time=$k_data[0];
+else if($k_number==10)
+  $k_time=$k_data[1];
+else if($k_number==50)
+  $k_time=$k_data[2];
+else if($k_number==100)
+  $k_time=$k_data[3];
+else if($k_number==500)
+  $k_time=$k_data[4];
+else if($k_number==1000)
+  $k_time=$k_data[5];
+else if($k_number>1000)
+  $k_time=$k_data[5]*($k_number/1000);
+
+
+$totaltime=$local*($nrows/100)+$k_time+12;
+
+//return $max_parent_row[$node];
+return $totaltime;
+
+}
\ No newline at end of file
diff --git a/sourcecodes/sf-homepage.css b/sourcecodes/sf-homepage.css
new file mode 100644
index 00000000..705894ad
--- /dev/null
+++ b/sourcecodes/sf-homepage.css
@@ -0,0 +1,157 @@
+.draggable
+{
+	position: absolute;
+}
+
+div.block, h1.block, h2.block, p.block
+{
+	border: 1px solid #000000;
+	background-color: white;
+	padding: 5px;
+}
+
+div.canvas
+{
+	border: 1px solid #262A37;
+	background-color: white;
+	background-image: url('gradient.jpg');
+	background-repeat: no-repeat;
+	background-position: top right;
+	padding: 0px;	
+}
+
+.highlighter
+{
+	border: 1px solid #CFDF62 !important;
+	background-color: #F1FF90 !important;
+	margin-bottom: 2px !important;
+	padding: 0px !important;
+	z-index: 3;
+}
+
+.highlighter .highlighter
+{
+	border: 1px solid #7DAB76 !important;
+	background-color: #BAFFB0 !important;
+	margin-left: 2px !important;
+	margin-right: 2px !important;
+}
+
+
+html
+{
+	padding: 0px;
+	margin: 0px;
+}
+
+body
+{
+	font-family: verdana;
+	font-size: 11px;
+	color: #33333F;
+	padding: 3px;
+	margin: 0px;
+	background-color: white;
+}
+
+h1
+{
+	color: #FF7521;
+	margin: 0px;
+	font-size: 20px;
+}
+
+h2
+{
+	font-size: 15px;
+	margin: 0px;
+}
+
+p, div
+{
+	font-size: 11px;
+	margin: 0px;
+}
+
+a
+{
+	text-decoration: none;
+	color: #FF9900;
+}
+
+.middle-label, .source-label, .destination-label
+{
+	font-size: 11px;
+	font-weight: bold;
+	padding: 5px;
+}
+
+div.connector
+{
+	background-color: #000000;
+	z-index: 1000;
+}
+
+table.main_table 
+{
+	width: 100%; 
+	border-collapse: separate;
+}
+	
+td.menu
+{
+	padding: 5px;
+}
+
+.menu ul
+{
+	margin: 0px;
+	padding: 0px;
+	list-style-type: none;
+	list-style-position: outside;
+}
+
+.menu li
+{
+	border: none;
+	padding: 0px;
+	font-size: 12px;
+	margin-bottom: 3px;
+}
+
+.menu li a
+{
+	display: block;
+	border: 3px solid #000000;
+	width: 50px;
+	color: #000000;
+	text-decoration: none;
+	padding: 3px;
+	background-color: white;
+}
+
+.menu li a.active_menu
+{
+	color: #FF9900;
+	border-color: #FF9900;
+}
+
+.menu li a:hover
+{
+	color: blue;
+	border-color: blue;
+}
+
+.block ol, .block ul
+{
+	margin-top: 3px;
+	margin-bottom: 3px;
+	margin-left: 0px;
+	padding-left: 25px;
+}
+
+.code
+{
+	font-family: monospace;
+	line-height: 1.5em !important;
+}
\ No newline at end of file
diff --git a/sourcecodes/structure b/sourcecodes/structure
new file mode 100644
index 00000000..e9856f6d
--- /dev/null
+++ b/sourcecodes/structure
Binary files differdiff --git a/sourcecodes/structuremap.php b/sourcecodes/structuremap.php
new file mode 100644
index 00000000..6c4c1323
--- /dev/null
+++ b/sourcecodes/structuremap.php
@@ -0,0 +1,81 @@
+<?php
+
+function map($id,$val,$pre)
+{
+
+$dir="./data/";
+
+$matfile=$dir."$pre"."map.txt";
+
+
+$matrix=file("$matfile");
+$matrix1=file_get_contents("$matfile");             
+$str_arrmat=array();
+$str_arrmat=explode("\n",$matrix1);
+$datamat=array();
+$data_cell=array(); 
+
+$data_cell_canvas=array();
+
+$i=0;
+foreach($str_arrmat as $line)
+{
+  
+$data_cell_canvas=explode("\t",$line);
+$map_name=$data_cell_canvas[0];
+$map_type=$data_cell_canvas[1];
+$map_std=$data_cell_canvas[2];
+$map_mean=$data_cell_canvas[3];
+if($id==$map_name)
+{
+  $mapval=$val*$map_std+$map_mean;
+}
+
+$i++;
+}
+return $mapval;
+}
+
+
+
+function reversemap($id,$val,$pre)
+{
+$dir="./data/";
+
+
+$matfile=$dir."$pre"."map.txt";
+
+
+$matrix=file("$matfile");
+$matrix1=file_get_contents("$matfile");             
+$str_arrmat=array();
+$str_arrmat=explode("\n",$matrix1);
+$datamat=array();
+$data_cell=array(); 
+
+$data_cell_canvas=array();
+
+$i=0;
+foreach($str_arrmat as $line)
+{
+  
+$data_cell_canvas=explode("\t",$line);
+$map_name=$data_cell_canvas[0];
+$map_type=$data_cell_canvas[1];
+$map_std=$data_cell_canvas[2];
+$map_mean=$data_cell_canvas[3];
+if($id==$map_name)
+{
+  $mapval=($val-$map_mean)/$map_std;
+}
+
+$i++;
+}
+
+return $mapval;
+}
+
+
+
+?>
+
diff --git a/sourcecodes/tier_description_processing_gom.php b/sourcecodes/tier_description_processing_gom.php
new file mode 100644
index 00000000..48ac172c
--- /dev/null
+++ b/sourcecodes/tier_description_processing_gom.php
@@ -0,0 +1,216 @@
+<?php
+
+$keyval=$_GET["My_key"];
+
+function get_tier($keyval)
+{
+
+$tier=trim($_GET['tier']);
+$dir="./data/";
+$tf=$dir.$keyval."tier.txt";
+$fpvar = fopen("$tf","w");
+
+fwrite($fpvar,"$tier");
+fclose($fpvar);
+}
+
+
+function enter_ban_list($t1,$s1,$t2,$s2,$tier_d,$fpvar)
+{
+  
+   for ($i=0;$i<$s1;$i++)
+   {
+        $data_val_1=$tier_d[$t1][$i];
+           
+        for ($j=0;$j<$s2;$j++)
+        {
+            $data_val_2=$tier_d[$t2][$j];
+            if($data_val_1!=$data_val_2)
+            {
+               
+               fprintf($fpvar,"%s\t%s\n",$data_val_1,$data_val_2); 
+              
+
+            }
+   
+        }
+         
+   }
+  
+
+}
+
+
+
+function describe_tier($fpvar,$keyval)
+{
+
+
+$tierdesc=trim($_GET['tierdesc']);
+$dir="./data/";
+$tf=$dir.$keyval."tier.txt";
+$tier=file_get_contents("$tf");
+
+$tier_data=array();
+$tier_size=array();
+$tier_d=array();
+$tier_data=explode(",",$tier);
+
+$tn=$tier_data[0];
+$count=0;
+
+for ($i=0;$i<$tn;$i++)
+{
+    $count+=2;
+    $tier_size[$i]=$tier_data[$count];
+         
+    $rs=$tier_size[$i];
+    for ($j=0;$j<$rs;$j++)
+    {
+     $count++;  
+     $tier_d[$i][$j]=$tier_data[$count];
+     
+    
+    }
+   
+}
+
+
+
+$data=array();
+$data=explode(",",$tierdesc);
+$n=count($data);
+$nn=0;
+$di=0;
+for ($i=0;$i<$tn;$i++)
+{
+
+$d_y=trim($data[$di]);
+$di++;
+$d_n=trim($data[$di]);
+
+if($d_n=="true") //put data in banlist
+{
+   $s1=$tier_size[$i];
+   enter_ban_list($i,$s1,$i,$s1,$tier_d,$fpvar);
+
+}
+$di++;
+
+
+   for ($j=0;$j<$tn;$j++)
+   {
+      if($j!=$i)
+      {
+        $p_d=trim($data[$di]);
+        $di++;
+    
+        if($p_d=="false") //put data in banlist
+        {
+             $s1=$tier_size[$j];
+             $s2=$tier_size[$i];
+             //echo $tier_size[$j];
+            enter_ban_list($j,$s1,$i,$s2,$tier_d,$fpvar);
+        }
+    
+
+
+        $c_d=trim($data[$di]);
+        $di++;
+        if($c_d=="false") //put data in banlist
+        {
+             $s1=$tier_size[$i];
+             $s2=$tier_size[$j];
+                  // echo $tier_size[$j];
+            enter_ban_list($i,$s1,$j,$s2,$tier_d,$fpvar);
+        }
+
+ 
+      }
+   }
+
+}
+
+
+}
+
+
+function banlist($fpvar)
+{
+$ban=trim($_GET['ban']);
+$data=array();
+$data=explode(",",$ban);
+$n=count($data);
+$nn=0;
+for ($i=0;$i<$n;$i+=2)
+{
+	$ii=$i+1;
+	$d1=trim($data[$i]);
+	$d2=trim($data[$ii]);
+
+	if($d1!="" && $d2!="")
+	{
+  		fprintf($fpvar,"%s\t%s\n",$d1,$d2);
+  		$nn++;
+	}
+
+}
+
+}
+
+function whitelist($fpvar)
+{
+
+$white=trim($_GET['white']);
+
+
+
+$data=array();
+$data=explode(",",$white);
+$n=count($data);
+$nn=0;
+for ($i=0;$i<$n;$i+=2){
+$ii=$i+1;
+$d1=trim($data[$i]);
+$d2=trim($data[$ii]);
+
+if($d1!="" && $d2!="")
+{
+  fprintf($fpvar,"%s\t%s\n",$d1,$d2);
+  $nn++;
+}
+
+}
+
+
+}
+
+
+/////////////////////Call functions//////////////////////
+
+
+
+$dir="./data/";
+
+$sid1=$dir.$keyval."ban";
+$sid2=$dir.$keyval."white";
+
+$Textban=$sid1.".txt";
+$Textwhite=$sid2.".txt";
+$fpb = fopen($Textban,"w");
+$fpw = fopen($Textwhite,"w");
+$datpost="From\tTo\n";
+fwrite($fpb,"$datpost");
+fwrite($fpw,"$datpost");
+
+get_tier($keyval);
+describe_tier($fpb,$keyval);
+banlist($fpb);
+whitelist($fpw);
+
+
+////////////////////////////////////execute structurelearning/////////////////////////////////////////////////////////////////////////////////////////////
+?>
+<script>
+window.open("executionprogress.php?My_key=<?php print($keyval);?>",'_self',false);
+</script>
\ No newline at end of file
diff --git a/sourcecodes/upload_structure_file.php b/sourcecodes/upload_structure_file.php
new file mode 100644
index 00000000..b876d639
--- /dev/null
+++ b/sourcecodes/upload_structure_file.php
@@ -0,0 +1,315 @@
+<?php
+include("header_new.inc");
+include("header_batchsearch.inc");
+
+////////////////continuous///////////////
+$searchID="";
+$UploadValue="NO";
+$TextFile=$HTTP_POST_FILES["MyFile"]["name"];
+
+/////////////Generate a key value for current use///////////////////////////////////////////////
+$alphas=array();
+$alphas = array_merge(range('A', 'Z'), range('a', 'z'));
+
+$al1=rand(0,51);
+$al2=rand(0,51);
+$al3=rand(0,51);
+
+$alpha="$alphas[$al1]"."$alphas[$al2]"."$alphas[$al3]";
+$keyval=$alpha;
+
+
+if($_POST["My_key"]!="")
+  $keyval=$_POST["My_key"];
+
+
+$sid="continuous_input";
+$dir="./data/$keyval";
+$TextinFileFinal=$dir.$sid.".txt";
+
+$TextinFile=$dir.$sid."_temp.txt";
+
+$TextinFilenamelist=$dir."name.txt";
+
+if(isset($HTTP_POST_VARS["searchkey"]))
+{
+   $searchID=$HTTP_POST_VARS["searchkey"];
+}
+
+if(isset($HTTP_POST_VARS["MyUpload"]))
+{
+   $UploadValue=$HTTP_POST_VARS["MyUpload"];
+   if ($UploadValue=="YES")
+   {
+        if($TextFile!="")
+        {
+            $sta=move_uploaded_file($HTTP_POST_FILES['MyFile']['tmp_name'],$TextinFile);
+            if(!$sta)
+            {
+                 echo "<script type='text/javascript'> window.alert ('Sorry, error uploading $TextFile.')</script>";
+                 flush();
+                 exit();
+            }
+            else
+            {
+                 $searchID=file_get_contents("$TextinFile");
+		 //fclose($fh);
+		  unlink($TextinFile);
+
+            }
+
+        }
+
+       else
+       {
+           echo "<script type='text/javascript'> window.alert ('Sorry, please select upload file.')</script>";
+       }
+   }
+}
+
+
+if($searchID!="")
+{
+?>
+
+<!-- Site navigation menu -->
+<ul class="navbar2">
+  <li><a href="net_structure.php?My_key=<?php print($keyval);?>">Upload structure file</a>
+</ul>
+<ul class="navbar">
+  <li><a href="help.php#file_format" target="_blank">Data formatting guidelines</a>
+  <li><a href="help.php" target="_blank">Help</a>
+  <li><a href="home.php">Home</a>
+</ul>
+<?php
+}
+else
+{
+
+?>
+<!-- Site navigation menu -->
+<ul class="navbar">
+  <li><a href="help.php#file_format" target="_blank">Data formatting guidelines</a>
+  <li><a href="help.php" target="_blank">Help</a>
+  <li><a href="home.php">Home</a>
+</ul>
+<?php
+}
+?>
+
+<div id="outernew">
+<h2><font>Upload data file</font></h2>
+<FORM name="key_search" enctype="multipart/form-data" ACTION="upload_structure_file.php" METHOD=POST>
+
+<table align="left" cellspacing="3" cellpadding="1" border="0"  width="90%">
+<tr>
+   <td>
+       <INPUT style="background-color:#FFFFFF;color:#0000FF" type="file" name="MyFile" size=45 > 
+       <INPUT TYPE="submit" value="  Upload  " onclick="return Upload();">
+      <INPUT TYPE="hidden" NAME="My_key" value=<?php print($keyval) ?> >
+        <INPUT TYPE="hidden" name="MyUpload" value="NO"> 
+   </td>
+</tr>
+<tr>
+   <td><font color=#3735CA><br>Content of uploaded data file:</font><br>
+          <textarea name="searchkey" rows="10" cols="100"><?PHP print($searchID)?> </textarea>
+  </td>
+</tr>
+<tr>
+    <td>
+       <INPUT font-weight:bold" TYPE="submit" value="  Load example data  " onclick="return demo();">&nbsp&nbsp&nbsp
+      <INPUT TYPE="hidden" NAME="My_key" value=<?php print($keyval) ?> >
+    </td>
+</tr>
+
+</table>
+</FORM>
+
+</div>
+<?php
+  $str_arr=array();
+  $searchID=trim($searchID);
+  $str_arr=explode("\n",$searchID);
+  $data=array();
+ 
+   
+  $fph = fopen($TextinFilenamelist,"w");
+  $fpmain = fopen($TextinFileFinal,"w");
+  
+ $cont_arr=array();
+  $cont_arr_tmp=array();
+
+
+  $data_type=array();
+  $level_arr=array();
+
+//Who is discrete? Who is continuous?
+  $i=0;
+  $lc=0;
+  foreach($str_arr as $line)
+  {
+    $line=trim($line); 
+    if($lc==0)
+      {
+       fwrite($fph, "$line\n");
+	fprintf($fpmain, "$line\n");
+       $name_t=$line;
+
+	fclose($fph); 
+       $data=explode("\t",$line);
+	$j=0;
+       foreach($data as $d_c)
+	  {
+           $d_c=trim($d_c);
+           $level_arr[$j][0]=$d_c;  //variable name y for 
+            
+	    $data_type[$j]=0;
+            $j++;
+          }
+          $lcc=$j;  //$lcc=number of column in the input file 
+      }        
+    else
+      { 
+        
+        $strline=""; 
+        $data=explode("\t",$line);
+	 $j=0;
+        foreach($data as $d_c) 
+        {
+            $d_c=trim($d_c);
+	     $cont_arr[$i][$j]=$d_c; 
+            $cont_arr_tmp[$i][$j]=$d_c; 
+
+            $mystring = $d_c;
+	     $findme   = '.';
+	     $pos = strpos($mystring, $findme);
+            $strline.="1\t";
+  
+            if ($pos != false)
+            {
+                $data_type[$j]=1;
+            }
+            $j++;
+         }
+	 $i++; 
+    
+      }
+     $lc++;
+     
+  }
+$lc--; //$lc=number of rows in the input file
+//Now count number of labels for discrete variables and populate the $data_type[$j] 
+$data_count=0;
+$l_type="";
+for($j=0;$j<$lcc;$j++)
+{
+
+       if($data_type[$j]!=1)
+	{
+	  $data_count=0;
+	  for($i=0;$i<$lc;$i++)
+	  {
+              $vi=$i+1;
+	       for($ii=$vi;$ii<$lc;$ii++)
+	       {
+                 if($cont_arr[$i][$j]==$cont_arr[$ii][$j] && $cont_arr[$i][$j]!=-9999)
+		   {
+		       $cont_arr[$ii][$j]=-9999; 
+               
+		   } 
+	       }
+               
+              
+         }
+	  for($i=0;$i<$lc;$i++)
+	     {
+	       if($cont_arr[$i][$j]!=-9999 && $cont_arr[$i][$j]!="")
+		{
+                  // $data_count_l=$data_count+2;
+                  $data_count++;
+                  $level_arr[$j][$data_count]=$cont_arr[$i][$j];
+              }
+	     }
+	  $data_type[$j]=$data_count;
+	    
+	   
+	}
+       if($j==0)
+         $l_type.=$data_type[$j];
+       else
+	 $l_type.="\t".$data_type[$j];  
+      
+    }
+
+////////////////////////////////////
+$fptype = fopen($dir."type.txt","w");
+$fpnode= fopen($dir."nnode.txt","w");
+fwrite($fpnode,"$lcc\n");
+
+$flevel = fopen($dir."nlevels.txt","w");
+//print in level mapping file for discrete variables
+for($j=0;$j<$lcc;$j++)
+{
+  if($data_type[$j]>1)
+  {  
+      fprintf($flevel,"%s",$level_arr[$j][0]);
+      $m=$data_type[$j];
+      for($jj=1;$jj<=$m;$jj++)
+      {
+         fprintf($flevel,"\t%s",$level_arr[$j][$jj]);
+      }
+
+      fprintf($flevel,"\n");  
+  }   
+}
+
+fwrite($fptype,"$name_t\n");
+for($j=0;$j<$lcc;$j++)
+{
+  fprintf($fptype,"$data_type[$j]\t");
+
+}
+fwrite($fptype,"\n");
+////////////////////////////////////
+
+  
+fwrite($fpmain, "$l_type\n");
+$l_c=0;
+//perform discrete level replacement 
+for($m=0;$m<$lcc;$m++)  //column
+{
+  if($data_type[$m]>1)
+  {
+     $r=$data_type[$m];
+     for($j=1;$j<=$r;$j++)
+     {  
+         $search=$level_arr[$m][$j];
+         $replace=$j."#";
+         for($n=0;$n<$lc;$n++)  //row
+         { 
+           $val=$cont_arr_tmp[$n][$m];
+           if($val==$search)
+               $cont_arr_tmp[$n][$m]=$replace;  //alter levels 
+         }
+     }
+     for($n=0;$n<$lc;$n++)  //row
+          $cont_arr_tmp[$n][$m]=str_replace('#','',$cont_arr_tmp[$n][$m]);
+  }
+}
+
+//write data to output file
+for($j=0;$j<$lc;$j++)
+{
+  fprintf($fpmain,"%s",$cont_arr_tmp[$j][0]);
+  for($jj=1;$jj<$lcc;$jj++)
+    fprintf($fpmain,"\t%s",$cont_arr_tmp[$j][$jj]);
+  fprintf($fpmain, "\n");
+}
+
+fclose($fpmain);
+
+
+
+?>
+
+
diff --git a/sourcecodes/workflow.php b/sourcecodes/workflow.php
new file mode 100644
index 00000000..56b527d4
--- /dev/null
+++ b/sourcecodes/workflow.php
@@ -0,0 +1,51 @@
+<?php 
+
+$key=$_POST["My_key"];
+if($key=="")
+  $key="ab";//uniqid("");
+
+include("header_new.inc");
+?>
+
+<!-- Site navigation menu -->
+<ul class="navbar">
+  <li><a href="bn_file_load_gom.php">Learn a network model from data</a>
+  <li><a href="home_upload.php">Make predictions using a known structure</a>  
+  <li><a href="help.php">Help</a>
+  <li><a href="faq.php">FAQ</a>
+  <li><a href="home.php">Home</a>
+
+
+</ul>
+
+<div id="outer">
+<!-- Main content -->
+<br>
+<h1>Tutorials and example networks</h1>
+<br>
+<br>
+<h3>Tutorials<br></h3>
+<p align="justify"> 
+<ul class="listbar">
+  <li>Tutorial 1: Using BNW to learn a network structure and make predictions with the model. [<a href="BNW_workflow_net1.htm">View tutorial</a>] [<a href="example.php?My_key=example2|hQG" target="_blank">View network</a>]</li>
+  <li>Tutorial 2:</a> A more in-depth look at the BNW structural constraint interface. [<a href="BNW_workflow_sci.htm">View tutorial</a>] [<a href="example.php?My_key=example_sci|Llu" target="_blank">View network</a>]</li>
+<!--  <li><a href="structure_learning2.htm">Work flow diagram 2:</a> Global optimal search based structure learning.
+  <li><a href="Prediction.htm">Work flow diagram 3:</a> Entering evidence data and predictions.
+--> 
+</ul>
+</p>
+<br>
+<br>
+<h3>Examples<br></h3>
+<p align="justify"> 
+<ul class="listbar">
+  <li>Example 1: Genetic network of immune-related gene in the spleens of BXD mice. [<a href="examples/spleen_immune_example.php">Description</a>]  [<a href="example.php?My_key=example_chr2_spleen|cuL" target="_blank">View network</a>]</li>
+  <li>Example 2: Genetic network of immune response to infection with Chlamydia psittaci. [<a href="examples/chl_example.php">Description</a>]  [<a href="example.php?My_key=example_chl|bWR" target="_blank">View network</a>]</li>
+  <li>Example 3: Synthetic genetic network with 2 genotypes and 6 traits. [<a href="examples/synthetic_example2.php">Description</a>]  [<a href="example.php?My_key=example2|hQG" target="_blank">View network</a>]</li>
+  <li>Example 4: Synthetic time-series genetic network with a genotype and 3 traits measured at 3 different time points. [<a href="examples/synthetic_example3.php">Description</a>]  [<a href="example.php?My_key=example_time_series|TEb" target="_blank">View network</a>]</li>
+  <li>Example 5: Network for investigating electrical problems with a car. [<a href="examples/cardiagnosis.php">Description</a>]  [<a href="example.php?My_key=examplecar15node|eIA"  target="_blank">View network</a>]</li>
+</ul>
+</p>
+</div>
+</body>
+</html>